Reusability in the Oracle ADF Development
Upcoming SlideShare
Loading in...5
×
 

Reusability in the Oracle ADF Development

on

  • 4,234 views

Reusability in the Oracle ADF Development

Reusability in the Oracle ADF Development

Statistics

Views

Total Views
4,234
Views on SlideShare
3,638
Embed Views
596

Actions

Likes
1
Downloads
200
Comments
0

3 Embeds 596

http://blogs.oracle.com 428
https://blogs.oracle.com 167
http://feeds.feedburner.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Reusability in the Oracle ADF Development Reusability in the Oracle ADF Development Presentation Transcript

  • <Insert Picture Here>Reusability in Oracle ADF developmentDmitry NefedkinOracle ISV Migration Center FMW ConsultantDmitry.Nefedkin@oracle.com
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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 • 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
  • 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
  • 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
  • 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 consumersto see the object in the library JAR.
  • 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
  • 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 inherited by the new Model projects.• Can be overridden on the project level 19 Oracle Restricted and Confidential
  • Basing an ADF Component on an ExtensionClass 20 Oracle Restricted and Confidential
  • 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
  • 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
  • Creating a Page Template
  • Creating a Page Template Header (with Title) AMenu Regions Named Facets B News Portlet
  • 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
  • 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• 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
  • 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/developer-tools/adf/uishell-093084.html
  • 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
  • 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
  • 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.
  • 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
  • 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
  • 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
  • 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
  • Creating a skin
  • 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
  • Skin development in JDeveloper 11g R2
  • 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>
  • 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
  • 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
  • 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
  • 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 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • Getting more information• Quick Start Guide to Oracle Fusion Development• Oracle JDeveloper 11g Handbook• Oracle Fusion Developer Guide
  • Getting more informationSten E. VesterliOracle ADF Enterprise Application Development — Made Simple
  • QuestionsDmitry NefedkinOracle ISV Migration Center FMW ConsultantDmitry.Nefedkin@oracle.comISV Migration Center blog: http://blogs.oracle.com/imc ©2011 Oracle Corporation