<Insert Picture Here>Reusability in Oracle ADF developmentDmitry NefedkinOracle ISV Migration Center FMW ConsultantDmitry....
ISV Migration Center Team• Who we Are ISV Migration Center Team is a team of senior technical consultants based in  Easter...
Agenda•   ADF Opportunities for Reusability                       <Insert Picture Here>•   Resource catalogs and ADF Libra...
Benefits of Reusability• Designing code to be reused has the following benefits:  • Increased developer productivity  • Fe...
Oracle ADF - The Bigger Picture                                 Desktop                                             Browse...
ADF Has a lot of Opportunities for Reusability, But First…• Don’t forget the obvious thing  • Java is an Object Orientated...
Agenda• ADF Opportunities for Reusability                         <Insert Picture Here>• Resource catalogs and ADF Librari...
The Resource Catalog• Enables application developers to find and incorporate  shared resources created by other members of...
Working with the Resource Catalog                      Adding to a CatalogCreating a catalog
Reusing Components with Libraries• ADF Library enables you to reuse components:  • Package them into ADF Library JAR files...
Building ADF Libraries• ADF supports reusing the following types of components in  ADF Libraries  •   Data controls  •   A...
Building ADF Libraries• Guidelines:  • Use naming conventions     • Avoid naming conflicts     • Facilitate identifying co...
Creating an ADF Library                      1              2                          3                  4
Adding an ADF Library to a Project   1                        2                               4        3
Removing an ADF Library from a Project• Remove by:  • Using Resource   • Using Project Properties    Palette
Restricting BC Visibility in Libraries• Set Library Private propertyfor a business component totrue if you don’t want cons...
Agenda•   ADF Opportunities for Reusability                       <Insert Picture Here>•   Resource catalogs and ADF Libra...
Create ADF BC extension classesCreate subclasses for ADF BC framework base classes
Register your extension classes• Tools->Preferences ->  ADF Business  Components -> Base  Classes• These settings will be ...
Basing an ADF Component on an ExtensionClass       20          Oracle Restricted and Confidential
Agenda•   ADF Opportunities for Reusability                       <Insert Picture Here>•   Resource catalogs and ADF Libra...
Page Templates• Provides layout and behavior• Layout  • Uses default ADF Faces layout managers  • Can have custom facets f...
Creating a Page Template
Creating a Page Template                Header (with Title)                           AMenu Regions                       ...
Editing a Page TemplateHeader (with Title)                   Header (with Title)           A                              ...
Applying a Page Template to a Page
UI Shell – page template used by Fusion AppsUI Shell goals:• Accelerate the ADF learning curve for teams new to ADF• Provi...
Anatomy of ADF UI ShellBest practice use of stretching & flowing layout
Anatomy of ADF UI ShellRuntime example UI Shell tutorial and demo application:      http://www.oracle.com/technetwork/deve...
Declarative Components• Characteristics of Declarative Components:  •   Are component definitions that are reusable across...
Creating a Declarative Component• The JSF DeclarativeComponent dialog box:  • Is invoked with  New > Web Tier > JSF  > JSF...
Using a Declarative Component on a Page• To use a declarative component on a page:  •   Deploy the component’s project as ...
Declarative Components – Use Cases• Create layout fragments  • Use in addition to page templates for consistent look and f...
ADF Skinning• This allows you to customize the look and feel of an application  • Without affecting functionality  • Witho...
Skinning Examples• Icons• Change messages, text, tooltips etc.af_messages.TIP_FATAL "What were you thinking"af_messages.TI...
Creating a skin•   When creating a skin, one extends a delivered skin•   You can create multiple skins to serve different ...
Creating a skin
Skin development in JDeveloper 11g R1• Code editing support• ADF Faces Skin Extension  • Tool > Preferences >CSS Editor   ...
Skin development in JDeveloper 11g R2
Configuring what skin to use in runtime trinidad-config.xml     • Using static name<trinidad-config xmlns="http://myfaces....
Agenda•   ADF Opportunities for Reusability                       <Insert Picture Here>•   Resource catalogs and ADF Libra...
Characteristics of Bounded Task Flows• Bounded task flows:  • Are modular blocks of task flow functionality for reuse, wit...
Characteristics of Bounded Task Flows• Bounded task flows consist of :       • Activities (View, Router, Method Call, etc....
Modular "UI Services"
Use It in Another Flow
Using a Bounded Task Flow• Using a bounded task flowin a region on a page
Task Flow Templates• Reusable task flow definition   • Reuse by reference or as a copy• Can contain common functionality a...
Deciding Which to Use• You can use a page template when you want:  • Similar page layout to be used on multiple pages  • S...
Agenda•   ADF Opportunities for Reusability                       <Insert Picture Here>•   Resource catalogs and ADF Libra...
Bringing it all together                                      Master Workspace                                            ...
Agenda•   ADF Opportunities for Reusability                       <Insert Picture Here>•   Resource catalogs and ADF Libra...
Getting more information• Oracle ADF Insider - recorded sessions that will help you  get up to speed with Oracle ADF:  htt...
Getting more information• Quick Start Guide to Oracle Fusion Development• Oracle JDeveloper 11g Handbook• Oracle Fusion De...
Getting more informationSten E. VesterliOracle ADF Enterprise Application  Development — Made Simple
QuestionsDmitry NefedkinOracle ISV Migration Center FMW ConsultantDmitry.Nefedkin@oracle.comISV Migration Center blog: htt...
Upcoming SlideShare
Loading in...5
×

Reusability in the Oracle ADF Development

4,295

Published on

Reusability in the Oracle ADF Development

Published in: Lifestyle, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,295
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
235
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Reusability in the Oracle ADF Development"

  1. 1. <Insert Picture Here>Reusability in Oracle ADF developmentDmitry NefedkinOracle ISV Migration Center FMW ConsultantDmitry.Nefedkin@oracle.com
  2. 2. ISV Migration Center Team• Who we Are ISV Migration Center Team is a team of senior technical consultants based in Eastern and Central Europe and represents Oracles technical investment for partners.• Mission Statement Enable partners to rapidly and successfully adopt and implement Oracle latest technology• What do we Offer Whether you are selling Oracle technology, building business solutions, including hosted Internet solutions or providing system integration and implementation services for Oracle technology, IMC Team can help you succeed.• How can we assist We offer a wide range of free services for partners such as one2one assistance, webinars, seminars and hands-on workshops. ISV Migration Center blog: http://blogs.oracle.com/imcContacts:Ruxandra Radulescu, ISV Migration Center Manager, EE&CISruxandra.radulescu@oracle.com 2
  3. 3. Agenda• ADF Opportunities for Reusability <Insert Picture Here>• Resource catalogs and ADF Libraries• Business logic reusability: ADF BC extension classes• UI reusability: page templates, declarative components, skins• Controller reusability: ADF Task Flows and templates• Bringing it all together• Getting more information
  4. 4. Benefits of Reusability• Designing code to be reused has the following benefits: • Increased developer productivity • Fewer bugs – debug once • Consistency • In functionality • In look and feel • Easier maintainability • Rapid adaptability
  5. 5. Oracle ADF - The Bigger Picture Desktop Browser-Based ADF Swing Office Mobile JSF ADF Faces JSP ViewMetadata Services (MDS) JSF ADF Controller Struts Controller ADF Model (DataControls & Bindings) (DataControls Model Java EJB ADFbc BAM Web Services BPEL BI Portlets Business Services Data Services Database Web Services Legacy Systems Apps Unlimited
  6. 6. ADF Has a lot of Opportunities for Reusability, But First…• Don’t forget the obvious thing • Java is an Object Orientated language with inheritance • Use it! • If using ADF • Refactor common code into Framework superclasses • Create common utility classes • Use advanced features like polymorphic entities
  7. 7. Agenda• ADF Opportunities for Reusability <Insert Picture Here>• Resource catalogs and ADF Libraries• Business logic reusability: ADF BC extension classes• UI reusability: page templates, declarative components, skins• Controller reusability: ADF Task Flows and templates• Bringing it all together• Getting more information
  8. 8. The Resource Catalog• Enables application developers to find and incorporate shared resources created by other members of the team• Provides a federated view of the resources from one or more otherwise unrelated repositories in a unified search and browse UI• Enables you to store libraries comprising a common repository that can be used by the developers building any client application• Ensures that all application developers use the same business model without any discrepancies
  9. 9. Working with the Resource Catalog Adding to a CatalogCreating a catalog
  10. 10. Reusing Components with Libraries• ADF Library enables you to reuse components: • Package them into ADF Library JAR files • Add them to a reusable component repository • Add the library to a project to use its components• Basically a standard JAR with a bit of extra metadata
  11. 11. Building ADF Libraries• ADF supports reusing the following types of components in ADF Libraries • Data controls • Application modules • Business components • Task flows • Task flow templates • Page templates • Declarative components
  12. 12. Building ADF Libraries• Guidelines: • Use naming conventions • Avoid naming conflicts • Facilitate identifying component functionality • Standardize storage by agreeing on: • Type of repository needed • Storage and organization • Access methods
  13. 13. Creating an ADF Library 1 2 3 4
  14. 14. Adding an ADF Library to a Project 1 2 4 3
  15. 15. Removing an ADF Library from a Project• Remove by: • Using Resource • Using Project Properties Palette
  16. 16. Restricting BC Visibility in Libraries• Set Library Private propertyfor a business component totrue if you don’t want consumersto see the object in the library JAR.
  17. 17. Agenda• ADF Opportunities for Reusability <Insert Picture Here>• Resource catalogs and ADF Libraries• Business logic reusability: ADF BC extension classes• UI reusability: page templates, declarative components, skins• Controller reusability: ADF Task Flows and templates• Bringing it all together• Getting more information
  18. 18. Create ADF BC extension classesCreate subclasses for ADF BC framework base classes
  19. 19. Register your extension classes• Tools->Preferences -> ADF Business Components -> Base Classes• These settings will be inherited by the new Model projects.• Can be overridden on the project level 19 Oracle Restricted and Confidential
  20. 20. Basing an ADF Component on an ExtensionClass 20 Oracle Restricted and Confidential
  21. 21. Agenda• ADF Opportunities for Reusability <Insert Picture Here>• Resource catalogs and ADF Libraries• Business logic reusability: ADF BC extension classes• UI reusability: page templates, declarative components, skins• Controller reusability: ADF Task Flows and templates• Bringing it all together• Getting more information
  22. 22. Page Templates• Provides layout and behavior• Layout • Uses default ADF Faces layout managers • Can have custom facets for content stamping • Template is referenced, not compiled: easy to change at design time and run time• Behavior • Can have bindings • Can have attributes
  23. 23. Creating a Page Template
  24. 24. Creating a Page Template Header (with Title) AMenu Regions Named Facets B News Portlet
  25. 25. Editing a Page TemplateHeader (with Title) Header (with Title) A A Must continue to use the same named B B facets Footer Original Template Modified Template
  26. 26. Applying a Page Template to a Page
  27. 27. UI Shell – page template used by Fusion AppsUI Shell goals:• Accelerate the ADF learning curve for teams new to ADF• Provide a best practice layout based on a given UI design• Provide high-level, best practice behavior out-of-the-box• Make it easier to follow an Oracle UI design
  28. 28. Anatomy of ADF UI ShellBest practice use of stretching & flowing layout
  29. 29. Anatomy of ADF UI ShellRuntime example UI Shell tutorial and demo application: http://www.oracle.com/technetwork/developer-tools/adf/uishell-093084.html
  30. 30. Declarative Components• Characteristics of Declarative Components: • Are component definitions that are reusable across applications • When changed, affect all pages that use them • Are made up of any number of other components • Do not have data binding in their definition • Can be made available for reuse in the Component Palette • Are defined only at design time in: • One .jspx file for each component • One declarativecomp-metadata.xml file for all components in a project
  31. 31. Creating a Declarative Component• The JSF DeclarativeComponent dialog box: • Is invoked with New > Web Tier > JSF > JSF Declarative Component • Creates <af:componentDef> tag in .jspx file • Creates metadata
  32. 32. Using a Declarative Component on a Page• To use a declarative component on a page: • Deploy the component’s project as an ADF library JAR file. • Add the ADF library to your current project. • Select the ADF library from the Component Palette drop-down list. • Select the declarative component and drag it to your page, providing values for any attributes.
  33. 33. Declarative Components – Use Cases• Create layout fragments • Use in addition to page templates for consistent look and feel • Oracle Forms-like toolbar• Wrap components to add functionality • For example, provide table shell that applies keyboard functionality • Create panel that allows you to export table content to Excel in binary format• Create complex components that operate on iterator or bindings that are passed in as arguments
  34. 34. ADF Skinning• This allows you to customize the look and feel of an application • Without affecting functionality • Without editing individual pages• A skin is a style sheet based on the CSS 3.0 syntax that is specified in one place for an entire application• ADF delivers default skins for ADF Faces components • The minimal look and feel is the ―simple‖ skin. It has very little styling • The ―fusion‖ skin extends simple and provides a very rich styling of our components. This is the default• Developers can change the styles, icons, properties, and text of ADF Faces components by creating a new skin
  35. 35. Skinning Examples• Icons• Change messages, text, tooltips etc.af_messages.TIP_FATAL "What were you thinking"af_messages.TIP_ERROR "You bozo, that is so wrong"af_messages.TIP_CONFIRMATION "I got it!"af_messages.TIP_INFO― "FYI Dude"• Splash Screen• Colors, styles• Tabs
  36. 36. Creating a skin• When creating a skin, one extends a delivered skin• You can create multiple skins to serve different purposes• Skins can be dynamically applied at runtime• A skin consists of the following artifacts: • An ADF Skin file (.css) that defines the actual look of the components • A configuration file - ―trinidad-skins.xml‖ - that lists all skins available for the application • An entry in the ADF Faces configuration file - ―trinidad-config.xml‖ • Any other resources needed to create the actual look of the components - additional CSS files, Images
  37. 37. Creating a skin
  38. 38. Skin development in JDeveloper 11g R1• Code editing support• ADF Faces Skin Extension • Tool > Preferences >CSS Editor • Check ADF Faces Extension • Syntax Help Syntax Help • Image selection • Code Completion • E.g. type "af|inputr" then press ctrl+Enter • Code Folding • Collapses CSS style definitions • Mouse-over code info
  39. 39. Skin development in JDeveloper 11g R2
  40. 40. Configuring what skin to use in runtime trinidad-config.xml • Using static name<trinidad-config xmlns="http://myfaces.apache.org/trinidad/config"> <skin-family>MYSKIN</skin-family></trinidad-config> • Using Expression<trinidad-config xmlns="http://myfaces.apache.org/trinidad/config"> <skin-family> #{facesContext.viewRoot.locale.language ==de ?MYSKIN_DE :MYSKIN} </skin-family></trinidad-config>
  41. 41. Agenda• ADF Opportunities for Reusability <Insert Picture Here>• Resource catalogs and ADF Libraries• Business logic reusability: ADF BC extension classes• UI reusability: page templates, declarative components, skins• Controller reusability: ADF Task Flows and templates• Bringing it all together• Getting more information
  42. 42. Characteristics of Bounded Task Flows• Bounded task flows: • Are modular blocks of task flow functionality for reuse, with the following characteristics: • Single point of entry • Well-defined boundary • pageFlow Memory scope • Declarative transaction management • Declarative Back button support
  43. 43. Characteristics of Bounded Task Flows• Bounded task flows consist of : • Activities (View, Router, Method Call, etc..) • Control flows between activities• Ability to accept input parameters and to return values• On-demand metadata loading• Fragment reuse through task flow templates• Addressable
  44. 44. Modular "UI Services"
  45. 45. Use It in Another Flow
  46. 46. Using a Bounded Task Flow• Using a bounded task flowin a region on a page
  47. 47. Task Flow Templates• Reusable task flow definition • Reuse by reference or as a copy• Can contain common functionality and settings • Exception handlers • Task flow activity navigation outline • Use of initializers and finalizers • Visibility settings • URL accessible • Visible in ADF Library • Behavior settings • Train • Task flow reentry • Critical • Data Control sharing• Pre-defined input and output parameters
  48. 48. Deciding Which to Use• You can use a page template when you want: • Similar page layout to be used on multiple pages • Similar look on multiple pages• You can use a declarative component when you want to: • Use a similar grouping of components on multiple pages or applications • Select the component from the Component Palette• You can use a bounded task flow when you want to: • Reuse a set of activities and control flows • Use multiple page fragments in a region on a page
  49. 49. Agenda• ADF Opportunities for Reusability <Insert Picture Here>• Resource catalogs and ADF Libraries• Business logic reusability: ADF BC extension classes• UI reusability: page templates, declarative components, skins• Controller reusability: ADF Task Flows and templates• Bringing it all together• Getting more information
  50. 50. Bringing it all together Master Workspace •Page(s) with the regions/dynamic regions,• This sample shows maybe based on UIShell templatehow you can structurethe artifacts of your Sybsystem WorkspacesADF application • View objects and view linksbetween JDeveloper •Application Module(s) •Bounded Task Flows with fragmentsworkspaces Common Model Workspace Common UI Workspace•Arrows show ADF •Page Templateslibrary dependencies • Entity Objects and Associations •Shared View objects for LOVs •Declarative Components •Default VOs and AM for testing •Task Flow templates•Master workspace •Skinsproduce EAR file as Common Code Workspacethe build output • ADF BC extension classes • Utility classes
  51. 51. Agenda• ADF Opportunities for Reusability <Insert Picture Here>• Resource catalogs and ADF Libraries• Business logic reusability: ADF BC extension classes• UI reusability: page templates, declarative components, skins• Controller reusability: ADF Task Flows and templates• Bringing it all together• Getting more information
  52. 52. Getting more information• Oracle ADF Insider - recorded sessions that will help you get up to speed with Oracle ADF: http://www.oracle.com/technetwork/developer- tools/adf/learnmore/adfinsider-093342.html• Oracle ADF Code corner - hints, tips and coding examples for ADF developer: http://www.oracle.com/technetwork/developer- tools/adf/learnmore/index-101235.html• Useful links for the ADF Developer: http://blogs.oracle.com/imc/entry/useful_links_for_the_adf
  53. 53. Getting more information• Quick Start Guide to Oracle Fusion Development• Oracle JDeveloper 11g Handbook• Oracle Fusion Developer Guide
  54. 54. Getting more informationSten E. VesterliOracle ADF Enterprise Application Development — Made Simple
  55. 55. QuestionsDmitry NefedkinOracle ISV Migration Center FMW ConsultantDmitry.Nefedkin@oracle.comISV Migration Center blog: http://blogs.oracle.com/imc ©2011 Oracle Corporation
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×