Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a...

41
Starting an Enterprise ADF Project <your photo here> Sten Vesterli sten@vesterli com sten@vesterli.com

Transcript of Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a...

Page 1: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Starting an Enterprise ADF Project

<your photo here>

Sten Vesterlisten@vesterli [email protected]

Page 2: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

ADF EMGhttp://groups.google.com/group/adf-methodology

ADF EMG• A place to discuss best practices and

methodologies for JDeveloper ADF enterprise li tiapplications

• Founded mid-2008 by Chris Muir, now 600+ members

• Focus is Fusion Tech Stack (ADF Faces, ADF BC)

• Online forum plus sessions at major Oracle conferences (OOW, ODTUG, UKOUG,

Sten [email protected] www.vesterli.com

<presenter, organisation>

(DOAG…)

Page 3: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

About me

• Developer, consultant, trainerp , ,• 17 years of Oracle experience• Oracle ACE Director• Oracle ACE Director• Author of “Oracle ADF Enterprise

A li ti D l t M d Si l ”Application Development – Made Simple”• Partner in Scott/Tiger

Sten [email protected] www.vesterli.com

Page 4: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

About Scott/TigergScott Tiger

Bruce Scott Bruce’s daughter’s catBruce Scott(Oracle employee no. 4)

Bruce s daughter s cat

Also an Oracle-focused consultancy based in Denmark…

Sten [email protected] www.vesterli.com

Page 5: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Agendag

• Necessary skills and training y g• Structure your code • Efficient use of templates• Efficient use of templates• Using pages and page fragments• Framework extension classes• The hidden power of ADF Librariesp• Securing, packaging and deploying

Sten [email protected] www.vesterli.com

Page 6: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

N Skill d T i iNecessary Skills and Training

Sten [email protected] www.vesterli.com

Page 7: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Skills Requiredq• ADF Framework knowledge• Object-Oriented programming• Java programmingg g• Database programming• XML• Regular expressions• Graphics designp g• Usability

Sten [email protected] www.vesterli.com

Page 8: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Organizing your Teamg g y• Lead Programmer• Regular programmers• Build/Configuration Managerg g• Database administration• Graphics Designersp g• Usability Experts• Users• (Data Modelers)

Sten [email protected] www.vesterli.com

Page 9: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Programmer specializationg p

• Building Business Componentsg p• Building User Interface• Skinning• Skinning• Data Validation• Support Classes• Database stored proceduresp• Nutcracker

Sten [email protected] www.vesterli.com

Page 10: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Initial Trainingg

• Classroom– Oracle University– Other training providersOther training providers

(look for an Oracle ACE/Director) • Self-studySelf study

– Lots of good, free material on OTN– Oracle JDeveloper 11g Handbook Part V– Oracle JDeveloper 11g Handbook, Part V

Sten [email protected] www.vesterli.com

Page 11: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Training Complete!

Sten [email protected] www.vesterli.com

Page 12: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

StartingStarting an

E iEnterprise ADFADF

Project

Sten [email protected] www.vesterli.com

Page 13: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Ongoing ADF Educationg g

• Work on a small project first monthp j– with “customer” (internal is OK)– with access to a mentorwith access to a mentor

• Participate in enterprise projectcount first two months as junior programmer– count first two months as junior programmer

– fully productive after 3 months totalM k h t ADF• Make sure you have access to ADF expertise

Sten [email protected] www.vesterli.com

Page 14: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

St t Y C dStructure Your Code

Sten [email protected] www.vesterli.com

Page 15: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Workspacesp

• Common Code• Common User Interface• Common Model• Common Model• (Database)• Subsystem workspaces• Master workspacep

Sten [email protected] www.vesterli.com

Page 16: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

WorkspacespMaster Workspace

Subsystem WorkspacesSubsystem WorkspacesS b W k

Subsystem WorkspacesSubsystem Workspaces

Common UI WorkspaceCommon Model Workspace

Common Code Workspace

Sten [email protected] www.vesterli.com

Page 17: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

ADF Task Flows

• One unbounded task flow• Any number of bounded task flows• A bounded task flow is a complete• A bounded task flow is a complete,

re-usable componentR d ti Y h l li ti• Recommendation: Your whole application should consist of bounded task flows

Sten [email protected] www.vesterli.com

Page 18: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Effi i t U f T l tEfficient Use of Templates

Sten [email protected] www.vesterli.com

Page 19: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Page Flow Templatesg p

• A common exception handling pagep g p g• Common help or about pages• Initializer and finalizer code• Initializer and finalizer code

Sten [email protected] www.vesterli.com

Page 20: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Page Templatesg p

• From scratch or from Quick Start• Define facets• Define attributes• Define attributes

– For page-specific information in template areasin template areas

– For different layouts based on the same templatethe same template

Sten [email protected] www.vesterli.com

Page 21: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Demo: Page Templateg p

Sten [email protected] www.vesterli.com

Page 22: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Using Pages andUsing Pages and Page Fragments

Sten [email protected] www.vesterli.com

Page 23: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Pages and Page Fragmentsg g g

• Pageg– uses whole browser window– can run on its owncan run on its own

• Page Fragmentruns inside a region– runs inside a region

– can be replaced at runtime in a dynamic regionin a dynamic region

Sten [email protected] www.vesterli.com

Page 24: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Recommendation: Page Fragmentsg g

• Build your application using page y pp g p gfragments

• Use few pages (possibly only one)Use few pages (possibly only one)• Use dynamic region

to swap page fragmentsto swap page fragments– this makes your application feel like a desktop

application not a web applicationapplication, not a web application

Sten [email protected] www.vesterli.com

Page 25: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

F k E t i ClFramework Extension Classes

Sten [email protected] www.vesterli.com

Page 26: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

The ADF BC Classes

• If you don’t generate Java, the ADF BC y g ,classes are silently used

• If you do generate Java your Java classIf you do generate Java, your Java class will extend the ADF BC classes

Sten [email protected] www.vesterli.com

Page 27: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Insert Your Own Classes

• Oracle delivers the ADF BC Base classesin the oracle.jbo.server package

• You can insert your own classes betweenYou can insert your own classes between your business components and the base classesclasses

Sten [email protected] www.vesterli.com

Page 28: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Insert Your Own Classes

Sten [email protected] www.vesterli.com

Page 29: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

The 8 ADF BC Classes• Extend

– EntityImpl – ViewObjectImpl – ViewRowImplViewRowImpl – ApplicationModuleImpl

• Don’t mess with– EntityCache – EntityDefImpl

ViewDefImpl– ViewDefImpl – ApplicationModuleDefImpl

Sten [email protected] www.vesterli.com

Page 30: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Demo: Framework Extension

Sten [email protected] www.vesterli.com

Page 31: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

The Hidden PowerThe Hidden Power of ADF Libraries

Sten [email protected] www.vesterli.com

Page 32: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

ADF Libraries

• Package the output of a project into an ADF g p p jLibrary

• Place finished ADF Library under versionPlace finished ADF Library under version control

• Other workspaces can use the ADF Library• Other workspaces can use the ADF Library• Build/Configuration manager decides on

ll t f i f lib irollout of new versions of libraries

Sten [email protected] www.vesterli.com

Page 33: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Demo: ADF Libraries

Sten [email protected] www.vesterli.com

Page 34: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Securing, PackagingSecuring, Packaging and Deploying

Sten [email protected] www.vesterli.com

Page 35: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

ADF Securityy

• Authentication– Identifying a user– Container-managedContainer managed

• AuthorizationWhat a user can do– What a user can do

– Application defines application rolesApplication roles are mapped to ser gro ps– Application roles are mapped to user groups on deployment

Sten [email protected] www.vesterli.com

Page 36: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

ADF Securityy

• Wizard for applying default security to your pp y g y yapplication

• Security at page page flow and entity levelSecurity at page, page flow and entity level

Sten [email protected] www.vesterli.com

Page 37: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Mapping Application Rolespp g pp

Manager Jack

Application Enterprise

Administratorg

DBAJoe

Super UserDBA

Analyst Jill

Normal UserEmployee

y

John

Application Roles Groups/Enterprise roles Users

Employee

Sten [email protected] www.vesterli.com

Page 38: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Data Sources

• Your application should use a named ppdatasource

• When deploying only include connectionWhen deploying, only include connection name

• Your application server administrator will• Your application server administrator will define the data source on the application serverserver

Sten [email protected] www.vesterli.com

Page 39: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

The ojdeploy Toolj p y

• Don’t hand-deploy from JDeveloper to build p y pyour production code

• JDeveloper includes ojdeployJDeveloper includes ojdeploy– a command-line tool that can do all deployment

• Example of use:• Example of use:– Add Ant to project technology and create

Buildfile from ProjectBuildfile from Project

Sten [email protected] www.vesterli.com

Page 40: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

References

• ADF Enterprise Methodology GroupADF Enterprise Methodology Grouphttp://groups.google.com/group/adf-methodology

• My book: Oracle ADF yEnterprise Application Development (www.packtpub.com)

• My blog: www.vesterli.com• Twitter: stenvesterli

Sten [email protected] www.vesterli.com

Page 41: Starting an Enterprise ADF Project - Oracle · ADF Libraries • Packaggppje the output of a project into an ADF Library • Place finished ADF Library under versionPlace finished

Thank you for listening!y g

Q ti ?Questions?

Sten [email protected] www.vesterli.com