Introduction to ADF in JDeveloper 10g - PowerPoint PPT Presentation

About This Presentation
Title:

Introduction to ADF in JDeveloper 10g

Description:

More than 3 years? 4. On the Positive Side... If we do not find ... Oracle submitted to Java Community. Process (JCP) as Java Specification. Request (JSR) 227 ... – PowerPoint PPT presentation

Number of Views:1863
Avg rating:3.0/5.0
Slides: 43
Provided by: PeterKo8
Learn more at: http://www.nocoug.org
Category:

less

Transcript and Presenter's Notes

Title: Introduction to ADF in JDeveloper 10g


1
Introduction to ADF in JDeveloper 10g Is it
Oracle Forms Developer Yet?
  • Peter Koletzke
  • Technical Director Principal Instructor

2
Moi
3
Vous
  • Forms development
  • 1-2 years?
  • 3-9 years?
  • More than 9 years?
  • Java development
  • 1-2 years?
  • 3-9 years?
  • More than 9 years?
  • JDeveloper
  • 1-3 years?
  • More than 3 years?

4
On the Positive Side
If we do not find anything pleasant, at least
we shall find something new. Voltaire
(1694-1778), Candide
Si nous ne trouvons pas des choses agréables,
nous trouverons du moins des choses nouvelles.
5
Agenda
  • What is a framework?
  • What is ADF?
  • Is it Forms?

Rumor There is a really good book about
JDeveloper 10g coming out soon.
6
J2EE Problem 1 - Design
  • J2EE offers design flexibility
  • Multiple architectures (various tiers)
  • Multiple languages
  • Multiple data layers
  • Choosing the technology combination is difficult
  • EJBs or BC4J (ADF BC)?
  • Struts or MVC controller?
  • JSP pages or UIX or Java Swing?
  • Database code or web services?

7
J2EE Problem 2 - Development
  • J2EE code is primarily 3GL
  • Lots of lines of code, repeats for each app
  • Notepad and vi are limited development
    environments
  • Need help creating code
  • Generate the standard stuff
  • Hand code the app-specific stuff
  • Need to reuse proven methods
  • Code libraries that handle the internals

8
J2EE Problem 3 Deployment
  • J2EE deployment is complex
  • Java applications have many files
  • Not less than a thousand
  • Need to install application files in the right
    places on the server
  • Need to configure the server
  • Lots of required files
  • web.xml, server.xml, J2EE config files
  • Need to connect the layers
  • Requires more than simple client todatabase
    server connection

9
The Solutions
  • Problem 1 (many design options)
  • Ask your J2EE expert
  • Read success stories
  • Use frameworks they provide a specific path
  • Problem 2 (lots of repetitive, required code)
  • Java tools (like JDeveloper)
  • Frameworks in the tools
  • Problem 3 (deployment complexity)
  • Java tools help
  • Ask your J2EE expert
  • Not as important as with problem 1

Tools cant help here, yet.
10
What is a Framework?
  • An extension of good reusable code strategies
  • Solve a problem once, use the code again in
    multiple projects
  • The code must be generically written but still
    functional
  • Provides a key service
  • For example, Struts framework provides control of
    page flow in a web application
  • Think API
  • Application Programming Interface
  • Code libraries you can use for extra functions

11
Benefits of a Framework
  • Promises increased productivity through code
    reuse
  • Prebuilt code supplies functionality you would
    have to build yourself
  • For example, connection layer to the database
    through JDBC
  • You write less 3GL code
  • Simplifies complexity of a high-level
    architecture
  • Complexity is hidden in the prebuilt code
  • Handles infrastructure and communication between
    layers
  • You just hook into it
  • Provides structure to the myriad number of
    technology combinations
  • The path to a particular goal is predefined

12
Components of a Framework
  • Code libraries
  • Provide the basic functionality
  • App-specific customizations usually appear in XML
    files
  • Extendable
  • Write your own code to supplement or replace the
    basic functionality
  • Documented method
  • You cannot be productive unless you know how to
    use the libraries
  • Tools
  • Optional but useful part
  • Without tools, youre on your own with the
    framework code

13
An Example
  • ADF Business Components (ADF BC)
  • Formerly BC4J
  • Java code layer that connects application to the
    database
  • Contains base libraries that provide the
    connection capabilities
  • You can extend the libraries to replace or
    supplement the functions (Java files)
  • You define XML files that supply
    application-specific customization
  • For example, the definition of a table
  • JDeveloper contains ADF BC editors
  • Edit the XML files
  • Create Java files

14
ADF BC Code
ADF BC Libraries
JDBC
EntityImpl.java
ViewObjectImpl.java
Application Specific Files
Countries.xml lt?xml version'1.0'
encoding'windows-1252' ?gt lt!DOCTYPE Entity
SYSTEM "jbo_03_01.dtd"gt ltEntity
Name"Countries" DBObjectType"table"
DBObjectName"COUNTRIES" AliasName"Countries"
BindingStyle"Oracle" UseGlueCode"false"
RowClass"location.model.CountriesImpl" gt
ltDesignTimegt ltAttr Name"_isCodegen"
Value"true" /gt ltAttr Name"_version"
Value"9.0.5.16.0" /gt ltAttr
Name"_codeGenFlag2" Value"Access" /gt
ltAttrArray Name"_publishEvents"gt
lt/AttrArraygt lt/DesignTimegt ltAttribute
Name"CountryId" IsNotNull"true"
Precision"2" ColumnName"COUNTRY_ID"
Type"java.lang.String" ColumnType"CHAR"
SQLType"CHAR" TableName"COUNTRIES"
PrimaryKey"true" RetrievedOnUpdate"true
" RetrievedOnInsert"true" gt
ltDesignTimegt ltAttr Name"_DisplaySize"
Value"2" /gt lt/DesignTimegt lt/Attributegt
CountriesImpl.java public class CountriesImpl
extends EntityImpl public static final int
COUNTRYID 0 public static final int
COUNTRYNAME 1 public static final int
REGIONID 2 public static final int LOCATIONS
3 public CountriesImpl() public
String getCountryId() return
(String)getAttributeInternal(COUNTRYID)
public void setCountryId(String value)
setAttributeInternal(COUNTRYID, value)
public String getCountryName() return
(String)getAttributeInternal(COUNTRYNAME)
public void setCountryName(String value)
setAttributeInternal(COUNTRYNAME, value)
CountriesView.xml lt?xml version'1.0'
encoding'windows-1252' ?gt lt!DOCTYPE Entity
SYSTEM "jbo_03_01.dtd"gt ltViewObject
Name"CountriesView" SelectList"Countries.COUN
TRY_ID, Countries.COUNTRY_NAME,
Countries.REGION_ID" FromList"COUNTRIES
Countries" BindingStyle"Oracle"
CustomQuery"false" ComponentClass"location.mo
del.CountriesViewImpl" MsgBundleClass"oracle.j
bo.common.JboResourceBundle"
UseGlueCode"false" gt ltDesignTimegt ltAttr
Name"_version" Value"9.0.5.16.0" /gt ltAttr
Name"_codeGenFlag2" Value"AccessColl" /gt
ltAttr Name"_isExpertMode" Value"false" /gt
lt/DesignTimegt ltEntityUsage
Name"Countries" Entity"location.model.Coun
tries" gt
CountriesViewImpl.java public class
CountriesViewImpl extends ViewObjectImpl
public CountriesViewImpl() public void
executeQuery() super.executeQuery()
public void setWhereClause(String
whereClause) super.setWhereClause(whereCla
use)
15
Challenges of Frameworks
  • Learning the method
  • Tools help
  • Without tools, you spend more time developing
  • Using the out-of-the-box functionality
  • If you can live with this, you will save lots of
    time
  • If you customize, you might spend more time than
    you would spend if you build your own
  • Use the normal framework definitions to build
    app-specific code (often XML files)
  • Getting assistance
  • Vendor support, online user forums, books

16
Agenda
  • What is a framework?
  • What is ADF?
  • Is it Forms?

17
Aiming High
Your scheme must be the framework of the
universeall other schemes will soon be
ruins.Henry David Thoreau (18171862), A Week
on the Concord and Merrimack Rivers
18
Sounds Like a Job for a Tool!
  • JDeveloper 10g
  • J2EE IDE
  • Code organizer
  • Code generator
  • Application DevelopmentFramework
  • Available only inJDeveloper 10g

19
Oracle Application Development Framework (ADF)
  • Attempt to meet the J2EE challenges
  • Feature available only in JDeveloper 10g
  • A wrapper for other frameworks
  • ADF BC (formerly BC4J)
  • ADF UIX (formerly UIX)
  • ADF JClient (formerly JClient)
  • Struts (non-Oracle, Jakarta Project open source)
  • An architecture
  • Implies a method and a tool
  • Based on MVC

20
Model-View-Controller (MVC)
  • SmallTalk strategy for application components
  • Now a J2EE design pattern
  • The MVC separation in layers allows you to plug
    in different front-end clients
  • Provides ability to separate layers for
    development
  • E.g., Can develop and test the model layer
    separately

ADF splits the Model layer in two.
Code to access data
What happens when user interacts with UI page
flow
User interface code
21
ADF Architecture
View
Swing visual aspect
Swing model
Swing event handlers
ADF UIX
JSP
ADF JClient
Controller
Struts
Model
ADF Bindings
ADF Data Controls
Business Services
ADF Business Components
EJB Session Beans
Web Services
Java Classes
22
Business Services
ADF Business Components
EJB Session Beans
Java Classes
Web Services
  • Code layer for accessing data sources such as a
    database
  • Responsibilities
  • Persistence
  • Data storage after the program ends
  • Object-relational (OR) mapping
  • Translating database objects to object-oriented
    structures
  • Use this layer to code business logic
  • The J2EE Business Tier

23
Business Services Technologies
  • Enterprise JavaBeans (EJBs)
  • Standard, popular, pure Java, J2EE code layer
  • Uses a runtime container process
  • Web services
  • Functions and resources written by a web provider
  • Can be incorporated into your application as
    remote calls
  • ADF Business Components
  • Formerly BC4J
  • Full framework for accessing Oracle databases
  • Easy to develop, powerful, has data caching
  • Java classes
  • Plain Old Java Objects (POJOs) supply data
  • TopLink in JDev used for OR mapping

24
Model
ADF Bindings
ADF Data Controls
  • This is the main innovation of ADF!
  • Connects Business Services to the View layer
  • Java local clients (heavy client)
  • Delivers data from Business Services to the View
    layer
  • View layer then updates the display
  • Web clients (light client)
  • Receives instructions from the Controller layer
    as requests for data retrieval and updates
  • Requests update of View layer

25
Model Layer ADF Data Controls
  • Common code layer for multiple business services
  • Appears as list of components available for a
    specific business service
  • Component list changes based on selected data
    element
  • Selecting a component automatically binds it

26
Model Layer ADF Bindings
  • Declares which data is connected to a user
    interface component
  • For example, LocationId text item is bound by
    code to the LOCATIONS.LOCATION_ID column
  • Works with the data controls to supply data model
    link from view components to business services
  • Data Control Palette in JDeveloper automatically
    binds the controls
  • You can also code this manually

27
  • For web clients only
  • Defines what page is displayed next
  • Can apply conditional logic
  • Can interact with data to prepare next page
  • Model 2 JSP (code logic not page links)
  • In JDev 10g (9.0.5), Struts is the default
    controller
  • Jakarta Project open source effort
  • Defines pages and actions that display the pages

28
View
Java Local Client
Web Client
Swing visual aspect
Swing model
Swing event handlers
ADF UIX
JSP
ADF JClient
  • User interface technologies
  • Java local client
  • Java runtime on the client
  • Part of J2SE (standard edition)
  • Uses JClient framework to communicate with model
    layer
  • Swing contains its own MVC components (Swing
    Model, event handlers for Controller, and visual
    aspects for View)
  • Web client
  • JavaServer Pages (JSP) technology
  • J2EE standard, light-client, tag-based interface
  • ADF UIX
  • Oracle-specific, XML-based interface used by
    E-Business Suite applications

29
ADF Does Not Help You Decide
  • No single, predefined technology path
  • ADF supports many technologies
  • Productivity with Choice
  • Similar in that way to Designer supporting
    various life cycle models
  • Traditional waterfall, RAD, Start-in-the-middle
  • Still need to make the design choices
  • However, some choices are better supported
  • For example, Struts is the default Controller

30
Other ADF Components
  • Code libraries
  • Mostly those of the individual frameworks (BC4J,
    Struts, JSP tags, JClient)
  • Common ADF runtime libraries
  • For data binding and model support
  • Documentation (online Help), OTN forums
  • Tools
  • JDeveloper utilities and work areas
  • Development method
  • Very loose set of steps
  • Uses JDeveloper tools to bind data

31
The Development Method
  • Create application workspace
  • Create Business Services and Model layers
  • Create View and Controller layers
  • Test and debug
  • Use the same tools for development regardless of
    technology choices

Demo
32
Agenda
  • What is a framework?
  • What is ADF?
  • Is it Forms?

33
Nothing Like a Good Drill
Man is a tool-using animal. ...Without tools he
is nothing, with tools he is all.Thomas
Carlyle (17511881), Sartor Resartus
34
Whats Good About Forms?
  • Nothing better for highly-responsive UIs
  • Best thing around for rapid data entry
  • GUI controls are unmatched in pure HTML web
    applications
  • Java applications (with Swing controls) deployed
    on the Web have similar controls
  • Nothing better for RAD
  • Really fast prototypes
  • You dont need to learn Javato do Forms
  • Still used by Oracle Applications

Its betterif youknow Java.
35
Whats Bad About Forms?
  • Its a 4GL and has limitations
  • Legacy technology
  • Proprietary not industry standard
  • Needs Oracle AS to deploy
  • Functionally stable (IBM term?)
  • Oracle is focusing on J2EE
  • Development tools
  • Application server
  • Database

36
Whats Good About JDeveloper and ADF?
  • Oracle is focusing on J2EE
  • JDeveloper is a J2EE tool
  • Supports any style of J2EE code
  • Heavy client light client
  • Makes J2EE design, development, and deployment
    easier
  • No need to think much about plumbing
  • Supports different development styles
  • You can write 3GL code
  • You can use declarative tools

37
Whats Bad About JDeveloper and ADF?
  • It manages 3GL code
  • 3GL code is hard to create
  • It is not a RAD tool
  • You need to know Java
  • Big learning curve
  • Object-oriented thinking
  • J2EE has challenges
  • Not JDevelopers fault
  • You need to think about frameworks
  • It supports all paths
  • It provides no clear path

38
Is ADF Forms Yet?
  • ADF is really just a wrapper around proven
    (older) frameworks
  • ADF BC, ADF UIX, JClient, Struts
  • Would be an Emperors New Clothes except
  • Data controls and bindings
  • Very nice innovation
  • This does speed up development
  • Oracle submitted to Java Community Process (JCP)
    as Java Specification Request (JSR) 227

39
So, Is ADF Forms Yet?
  • It can help shops that have mostly J2EE experts
  • J2EE experts will be more productive
  • They need to learn the ADF process
  • It can also help shops who have traditional
    non-J2EE Oracle developers
  • Forms and PL/SQL developers will be productive
    with the declarative tools
  • With training, they can write Java extensions
  • Much of the complexity is hidden
  • They need a J2EE expert to guide them and code
    the internal, complex stuff

40
Please Tell Me!
  • Can you achieve the productivity of Forms using
    ADF?
  • ADF is as close to RAD as any current J2EE tool
  • It is state-of-the-art plus
  • Good innovations
  • Very developer-friendly
  • Costlier than alternative J2EE tools
  • In other words, Not yet
  • Stay tuned for 10.1.3

41
Summary
  • Frameworks help development
  • Forms is a framework
  • One way to develop and deploy
  • Not so easy for J2EE applications
  • ADF is a framework and it also helps
  • A big step in the right direction
  • Provides support once you determine the path
  • Room for growth
  • More declarative tools
  • More recommended paths
  • Combining technologies is the remaining challenge

42
  • Books co-authored with Dr. Paul Dorsey
  • Personal web site
  • http//ourworld.compuserve.com/
    homepages/Peter_Koletzke

http//www.quovera.com
  • Founded in 1995 as Millennia Vision Corporation
  • Profitable for 7 years without outside funding
  • Consultants each have 10 years industry
    experience
  • Strong High-Tech industry background
  • 200 clients/300 projects
  • JDeveloper Partner
  • More technical white papers and presentations on
    the web site
Write a Comment
User Comments (0)
About PowerShow.com