You are on page 1of 42

Oracle Application Development Framework

Document No.

Version 1.0

Date

17-DEC-2007

Oracle Application Development Framework Introduction

Page 2

Common Architecture: Fusion Middleware

JDeveloper Enterprise Manager Portal Integration ADF OC4J Wireless

no s uF sse n s u B E i / i -

Metadata Services (MDS)

Page 3

Oracle Application Development Framework


End-to-end J2EE framework Utilizes and adds value to the J2EE platform Enables developers to focus on the application, not the configuration Creates reusable and maintainable code Implements J2EE best practices and design patterns, including MVC

Page 4

Model-View-Controller (MVC)

notifies

View

sees

Model

navigates

manipulates

Controller

uses

User

Page 5

MVC: The Model


The model represents the enterprise data and business rules, handling access and updates. E-Business/Fusion stack uses ADF Model to implement the model:
Abstracts business service implementation details from clients Loose coupling between services and application Metadata driven Drag-and-drop data binding Declarative validation rules

Page 6

MVC: The View


The view focuses on presentation and is responsible for maintaining consistency between data presentation and model changes. It enables:
Presentation to be changed without altering programming logic Development by Web page authors with no knowledge of the underlying implementation

E-Business/Fusion stack uses JSF with the ADF Faces component set for the view.

Page 7

MVC: The Controller


The controller provides interaction with the client, serving as a glue between the model and the view. The controller:
Interprets user requests, and controls business objects to fulfill these requests Removes navigation coding from the view

E-Business/Fusion uses JSF Navigation for controller functionality

Page 8

Fusion and ADF: The Big Picture

Rich Client ADF Swing JSP

Web and Wireless JSF/ADF Faces JSF View Controller Model (JSR 227)

Struts ADF Model

EJB TopLink

Java Classes

ADF Business Components

Web Services

XML

Business Services

Data Source

Relational Data

XML Data

Legacy Data
Page 9

Packaged Apps

ADF Business Components


Incorporates reusable business logic Handles database transactions Separates business logic from data presentation Is a component-based architecture Supplies most of the code that you need in your application Uses SQL-based data views Is user interface agnostic Is independent of the deployment target

Page 10

Benefits of ADF Business Components


ADF business components increase productivity.
Reusable components Reentrant wizard-driven creation of objects Simple O/R mapping

They provide application logic infrastructure.


Ready-to-use data functions No need to hand-code standard data access routines You only code exceptions to standard behavior. Simplified data access Enforced domain validation and business logic Support for complex UI applications

Page 11

ADF/JSF Faces

Page 12

What Is JavaServer Faces?


A standard J2EE framework for generating thin client user interfaces
Not just HTML pages

Defined through the Java Community Process Standard support as part of Java EE 5 In J2EE 1.4, implemented as a servlet
Multiple implementations

Page 13

What ADF Faces Brings to JSF


Much larger component set: more than 100 components Far more advanced and interesting components (for example, shuttle, tree navigation) Partial-page rendering Rich feature set for customizing applications Uses the same expression language (EL) as the ADF model Accessibility and internationalization support across the board Framework features, such as dialog framework and support for processes

Page 14

Navigation

Page 15

JSF Navigation: Example

firstPage Button success

myNewPage

firstPage.jsp

myNewPage.jsp

JSF Navigation Rules

Page 16

JSF Navigation Rules


Navigation rules are stored in faces-config.xml. Navigation rules can be defined using:
The faces-config console The Pageflow diagrammer The faces-config.xml file directly

Page 17

JSF, Page, and Pageflow Control

JSF technology manages both:


Web page content Page navigation

Page 18

Business Components

Page 19

Business Components: The Big Three


Entity objects Control persistence caching business logic In general, one-to-one mapping to database tables View objects Collections that control what you want displayed on a page In general, uses SQL query Application module Facade and transaction management Exposes what you want the client to see

Page 20

Entity Object

Page 21

Entity Object
Represents a database table or other data source Handles database caching Contains attributes representing the database columns Encapsulates attribute-level and entity-level validation logic Can contain custom business methods

Page 22

View Object

Page 23

View Objects
Present a view or slice of business data Are used for joining, filtering, projecting, and sorting your business data Can be based on any number of entity objects Can also be constructed from a SQL statement

Page 24

Read-Only SQL-Based View Objects


A read-only SQL-based view object:
Is not based on any entity object Cannot be used for insert, update, or delete

Use SQL-based view objects for query-only views, which do not need the functionality of entity objects.

Page 25

Interaction Between Views and Entities: Retrieving Data


The view object queries the database directly. Data retrieved by the query is saved to the entity objects cache. Nonpersistent attributes are stored and retrieved from the view objects cache. Interaction Between Views and Entities: Updating Data The view object updates the entity objects cache. The entity object commits to the database.

Page 26

View Links
A view link is an active link between view objects. You can create view links by providing the following: Source and destination views Source and destination attributes

Page 27

Application Module

Page 28

View Objects in the Application Module


Consists of the set of views and view links in the application Can contain unrestricted (master) views and restricted (detail) views

Page 29

Data Binding

Page 30

JSF and Data Binding


Declarative data binding JSR 227 with drag-and-drop data binding support

Page 31

About ADF Model (ADF Databinding)


ADF Model:
Provides a wrapper and abstraction for business services Enables you to work the same way with any UI and any business service Decouples UI from back-end business services Provides drag-and-drop Databinding

Page 32

ADF Model Layer Components


Data controls describe the public interface of a business service. Bindings connect UI components to data or actions. Data controls and bindings are defined using XML metadata.

Bindings

Bindings

Data Control Business service

Page 33

Default Data Control Functionality

Data control type ADF BC TopLink EJB JavaBean Web service URL

Supports transactions Yes Yes No No No No

Supports sorting Yes Yes Yes Yes No Yes

Supports updates Yes Yes Yes No No No

Page 34

Generated Files in the Data Model Project

Structure definition file for each EO


Products.xml Describes the attributes of each bean or component <AppModule>.xml Describes the properties of all data controls in the project

Data control description file


Page 35

Generated Files in the View Project


When data bindings are created, two files are generated in the UI project: Binding context definition file DataBindings.cpx Maps pages to page definitions, declares data control usages. Page definition file xxxPageDef.xml Defines all the bindings for a page Created automatically when you add a data-bound component to a page. Replaces the UI model file in previous versions.

Page 36

ADF Binding: Summary

DataControls.dcx <view name>.xml <application module>.xml

Model Project

DataBindings.cpx <pagename>PageDef.xml

View Project
web.xml faces-config.xml adf-faces-config.xml adf-faces-skins.xml

Page 37

Deployment

Page 38

Deployment Modes
Java client local: ADF-BC components and Java clients share a JVM. Is deployed as a simple archive Web client Web module : most common for deployment ADF-BC components and Java clients share a JVM. Runs in an application server Java client remote mode : most common for deployment Separate JVMs for Java client and ADF-BC components Is deployed with a remoteable interface Web client remote mode: Both run on Application Server. ADF-BC runs in an EJB container.

Page 39

Supported Application Servers


Supported application servers include:
OC4J 10.1.3 (requires ADF Runtime classes) Oracle AS 10.1.3 Oracle AS 10.1.2.0.2 WebLogic 8.1 sp4 WebLogic 9.0 Tomcat 5.5.9 JBoss 4.0.2

Page 40

Q&A

Page 41

Thank You

Page 42

You might also like