SlideShare ist ein Scribd-Unternehmen logo
1 von 29
1
Chapter 8Chapter 8
Introducing ADF BusinessIntroducing ADF Business
ComponentsComponents
2
Introducing ADF Business ComponentsIntroducing ADF Business Components
ADF BCADF BC is a Java and XML based framework for developing:is a Java and XML based framework for developing:
• Business logic, including validation and default logicBusiness logic, including validation and default logic
• QueriesQueries
• Transaction handlingTransaction handling
• Data accessData access
It does not create a user interface, but is a pure encapsulation of businessIt does not create a user interface, but is a pure encapsulation of business
logic that communicates with a separate client application, which handleslogic that communicates with a separate client application, which handles
user interaction.user interaction.
Using ADF BC is the simplest way to design data-aware applicationsUsing ADF BC is the simplest way to design data-aware applications
with JDeveloper. This chapter presents an overview of ADF BC bywith JDeveloper. This chapter presents an overview of ADF BC by
describing its components and uses.describing its components and uses.
3
Why Use ADF BC?Why Use ADF BC?
The advantage of ADF BC over UI-enforced business logic is reusability.The advantage of ADF BC over UI-enforced business logic is reusability.
For example, a single ADF BC layer can provide the business logic for allFor example, a single ADF BC layer can provide the business logic for all
a company's needs. The business components can be used again anda company's needs. The business components can be used again and
again, with multiple interfaces (a time saver).again, with multiple interfaces (a time saver).
4
Advantages of ADF BCAdvantages of ADF BC
By maintaining a cache of data in memory, ADF BC reduces the numberBy maintaining a cache of data in memory, ADF BC reduces the number
of database trips required by an application resulting in improvedof database trips required by an application resulting in improved
performance and scalability.performance and scalability.
ADF BC allows the business logic to be written in Java, which saves theADF BC allows the business logic to be written in Java, which saves the
trouble of integrating a Java GUI or JSP application with business logictrouble of integrating a Java GUI or JSP application with business logic
written in PL/SQL code.written in PL/SQL code.
Removing the business logic out of the database keeps the database fromRemoving the business logic out of the database keeps the database from
handling anything but data, which increases an application's modularityhandling anything but data, which increases an application's modularity
and efficiency.and efficiency.
5
Advantages of ADF BCAdvantages of ADF BC (continued)(continued)
There are also advantages to implementing some business logic directlyThere are also advantages to implementing some business logic directly
in the database (more robust) since it will be enforced even in ain the database (more robust) since it will be enforced even in a
SQL*Plus session. Business logic implemented in the ADF BC layer isSQL*Plus session. Business logic implemented in the ADF BC layer is
only enforced in applications using that layer, but increases performance.only enforced in applications using that layer, but increases performance.
There is a trade-off between robustness and performance.There is a trade-off between robustness and performance.
Therefore, the most critical business logic should be implemented in theTherefore, the most critical business logic should be implemented in the
database or redundantly in both the database and a ADF BC layer. Thedatabase or redundantly in both the database and a ADF BC layer. The
remainder of the business logic can be implemented in the ADF BCremainder of the business logic can be implemented in the ADF BC
layer.layer.
6
Advantages of ADF BCAdvantages of ADF BC (continued)(continued)
ADF BC provides four ready-made architectures for businessADF BC provides four ready-made architectures for business
component clients:component clients:
• JClientJClient, an architecture for creating Java GUIs (useful for intensive, an architecture for creating Java GUIs (useful for intensive
data-entry applications requiring high interactivity).data-entry applications requiring high interactivity).
• Thin JSP clientsThin JSP clients are useful for web-based applications where aare useful for web-based applications where a
thin client is more important than very high interactivity, such asthin client is more important than very high interactivity, such as
self-service and e-commerce applications.self-service and e-commerce applications.
• XSQL clientsXSQL clients, which generate XML for either flexible display with, which generate XML for either flexible display with
a style sheet or loose coupling between applications.a style sheet or loose coupling between applications.
• UIXUIX, a framework-based architecture for developing web, a framework-based architecture for developing web
applications.applications.
7
Advantages of ADF BCAdvantages of ADF BC (continued)(continued)
ADF BC also has the advantage of being "deployment-configurationADF BC also has the advantage of being "deployment-configuration
independent". A single ADF BC layer can be deployed as local Javaindependent". A single ADF BC layer can be deployed as local Java
classes or as an Enterprise JavaBean (EJB), with no rewriting of codeclasses or as an Enterprise JavaBean (EJB), with no rewriting of code
necessary. You can concentrate on the business logic of your applicationnecessary. You can concentrate on the business logic of your application
instead of its deployment requirements.instead of its deployment requirements.
ADF BC components (whether deployed to a J2EE web module withADF BC components (whether deployed to a J2EE web module with
JSP pages or as an EJB) are fully J2EE-compliant. The ADF BCJSP pages or as an EJB) are fully J2EE-compliant. The ADF BC
framework automatically implements the J2EE BluePrints designframework automatically implements the J2EE BluePrints design
patterns suggested by Sun Microsystems so you do not need to worrypatterns suggested by Sun Microsystems so you do not need to worry
about them.about them.
8
Business Components, Java, and XMLBusiness Components, Java, and XML
Entity objects, view objects, and application modules each have twoEntity objects, view objects, and application modules each have two
parts: a Java class file and an XML file. The files have different purposes.parts: a Java class file and an XML file. The files have different purposes.
ADF BC is a framework, this means that much of its functionality isADF BC is a framework, this means that much of its functionality is
contained in a set of libraries. ADF BC classes extend (subclass) the basecontained in a set of libraries. ADF BC classes extend (subclass) the base
classes provided by these libraries to provide complex business logic,classes provided by these libraries to provide complex business logic,
which requires the procedural power of Java to implement. This allowswhich requires the procedural power of Java to implement. This allows
you (if needed) to:you (if needed) to:
• Easily write code to implement complex business rules inside yourEasily write code to implement complex business rules inside your
entity object Java classesentity object Java classes
• Code complex query logic in your view object classesCode complex query logic in your view object classes
• Code complex transaction handling in your application moduleCode complex transaction handling in your application module
classes.classes.
9
Business Components, Java, and XMLBusiness Components, Java, and XML
The base classes in the ADF BC framework are programmed to workThe base classes in the ADF BC framework are programmed to work
with XML files. Some business logic is common and simple and can bewith XML files. Some business logic is common and simple and can be
handled with a line or two of declarative XML. Instead of writing ahandled with a line or two of declarative XML. Instead of writing a
procedure to implement this sort of business logic, you can just declareprocedure to implement this sort of business logic, you can just declare
that an entity attribute, for example, must obey a particular validationthat an entity attribute, for example, must obey a particular validation
rule. The base entity object class (and by inheritance, your custom Javarule. The base entity object class (and by inheritance, your custom Java
class) can automatically read the XML file to enforce the rule.class) can automatically read the XML file to enforce the rule.
JDeveloper has wizards that write and edit the XML files for you.JDeveloper has wizards that write and edit the XML files for you.
The ADF BC framework uses XML files to store static definitions suchThe ADF BC framework uses XML files to store static definitions such
as the structure of a database table or query. Its base classes can obtainas the structure of a database table or query. Its base classes can obtain
the structure of particular business components by parsing the XML.the structure of particular business components by parsing the XML.
This can have performance advantages. For example, an entity objectThis can have performance advantages. For example, an entity object
dose not need to query the database at runtime for structural informationdose not need to query the database at runtime for structural information
about the table it represents.about the table it represents.
10
ADF Business Component GroupsADF Business Component Groups
ADF BC components are divided into two groups:ADF BC components are divided into two groups:
• Business domain componentsBusiness domain components
• Data model componentsData model components
11
Business Domain ComponentsBusiness Domain Components
These components represent features of the database: tables and views,These components represent features of the database: tables and views,
constraints, and relationships. They are the most reusable businessconstraints, and relationships. They are the most reusable business
components because they can be used by any application that needs tocomponents because they can be used by any application that needs to
access the same data.access the same data.
There are three kinds of business domain components:There are three kinds of business domain components:
• Entity Object definitionsEntity Object definitions
• AssociationsAssociations
• DomainsDomains
12
Entity Object DefinitionsEntity Object Definitions
An entity object definition usually represents a database table or databaseAn entity object definition usually represents a database table or database
view, but it can also be used to represent EJB entity beans. It acts as aview, but it can also be used to represent EJB entity beans. It acts as a
representation of the table or database and handles all of the businessrepresentation of the table or database and handles all of the business
rules for that table or view including validation, defaulting, and anythingrules for that table or view including validation, defaulting, and anything
else that happens when a row is created, deleted, or changed.else that happens when a row is created, deleted, or changed.
The power of ADF BC is its interface with the database used by anThe power of ADF BC is its interface with the database used by an
application.application.
The ADF BC layer represents the database table as an entity object. AnThe ADF BC layer represents the database table as an entity object. An
entity object hasentity object has entity attributesentity attributes that represent the table columnsthat represent the table columns
(mapping may not always be one-to-one).(mapping may not always be one-to-one).
The types of the properties are Java classes that correspond to the SQLThe types of the properties are Java classes that correspond to the SQL
types of the columns.types of the columns.
13
Entity Object DefinitionsEntity Object Definitions
Example:Example: DEPARTMENTSDEPARTMENTS tabletable
Entity objects for the above table may have the followingEntity objects for the above table may have the following
entity attributes:entity attributes:
14
Entity Object DefinitionsEntity Object Definitions
Java does not directly support SQL datatypes, but each SQL datatype canJava does not directly support SQL datatypes, but each SQL datatype can
be mapped to a Java type. Some Java types are classes inbe mapped to a Java type. Some Java types are classes in java.langjava.lang andand
others in the packageothers in the package oracle.jbo.domainoracle.jbo.domain (discussed later).(discussed later).
Entity objects have two parts:Entity objects have two parts:
1.1. AA Java classJava class (like DepartmentsImpl.java) – This contains the(like DepartmentsImpl.java) – This contains the
procedural code to implement the entity object.procedural code to implement the entity object.
2.2. AnAn XML fileXML file (like Departments.xml) – This includes metadata(like Departments.xml) – This includes metadata
describing the entity object, its attributes, and the table upondescribing the entity object, its attributes, and the table upon
which it is based, as well as declarative code.which it is based, as well as declarative code.
15
ADF BC Relationships (page 228)ADF BC Relationships (page 228)
16
AssociationsAssociations
Like tables, entity objects are often related to one another. TheLike tables, entity objects are often related to one another. The
relationships between entity objects are calledrelationships between entity objects are called associationsassociations. An. An
association matches one or more attributes of a "source" entity objectassociation matches one or more attributes of a "source" entity object
with one or more attributes of a "destination" entity object.with one or more attributes of a "destination" entity object.
This is like a foreign key constraint that matches one or more columnsThis is like a foreign key constraint that matches one or more columns
of a child table with one or more columns of a parent table.of a child table with one or more columns of a parent table.
Associations are stored in an XML file.Associations are stored in an XML file.
17
DomainsDomains
DomainsDomains are special java types used by ADF BC as the types for many entity objectare special java types used by ADF BC as the types for many entity object
and view object attributes. In the coverage of entity objects earlier, a class thatand view object attributes. In the coverage of entity objects earlier, a class that
implements theimplements the DepartmentsDepartments entity object has some entity attributes of typeentity object has some entity attributes of type
oracle.jbo.domain.Numberoracle.jbo.domain.Number. The entity attributes of an entity object Java class are. The entity attributes of an entity object Java class are
objects, not primitive Java types such asobjects, not primitive Java types such as intint..
Database columns of SQL datatype VARCHAR2 have the Java classDatabase columns of SQL datatype VARCHAR2 have the Java class
java.lang.Stringjava.lang.String. For other SQL types (NUMBER, etc.), ADF BC provides. For other SQL types (NUMBER, etc.), ADF BC provides domainsdomains
to wrap the SQL datatype. Domains liketo wrap the SQL datatype. Domains like oracle.jbo.domain.Numberoracle.jbo.domain.Number are basicallyare basically
object wrappers for scalar types.object wrappers for scalar types.
JDeveloper will automatically create aJDeveloper will automatically create a domaindomain if you base an entity object on a tableif you base an entity object on a table
with an Oracle object type column in it. Thiswith an Oracle object type column in it. This domaindomain represents the Oracle objectrepresents the Oracle object
type, giving you Java wrappers for each of the object type's fields and methods.type, giving you Java wrappers for each of the object type's fields and methods.
You can also create your ownYou can also create your own domainsdomains..
18
Data Model ComponentsData Model Components
They are business components that collect data and present it to theThey are business components that collect data and present it to the
view and controller through the ADF model layer. They are notview and controller through the ADF model layer. They are not
reusable as business domain components because their design is basedreusable as business domain components because their design is based
on the data needs of a particular client application.on the data needs of a particular client application.
They are still independent of a user interface.They are still independent of a user interface.
There are three kinds of data model components:There are three kinds of data model components:
• View object definitionsView object definitions
• View link definitionsView link definitions
• Application module definitionsApplication module definitions
19
View Object DefinitionsView Object Definitions
Generally you should not present all of the information stored in aGenerally you should not present all of the information stored in a
database object (entity object) in one application. You may alsodatabase object (entity object) in one application. You may also
want/need data taken from more than one database object.want/need data taken from more than one database object.
SQL provides the queries necessary to select exactly the data you needSQL provides the queries necessary to select exactly the data you need
from one or more tables. This is why ADF BC hasfrom one or more tables. This is why ADF BC has view objectview object
definitionsdefinitions, which correspond to SQL queries. A view object, which correspond to SQL queries. A view object
definition actually stores a SQL query.definition actually stores a SQL query.
20
View Object DefinitionsView Object Definitions (continued)(continued)
A view object definition hasA view object definition has view attributesview attributes (like entity objects have(like entity objects have
entity attributes) that correspond the columns of a query result. Forentity attributes) that correspond the columns of a query result. For
example, consider the view object for the following query:example, consider the view object for the following query:
SELECT Departments.DEPARTMENT_ID,
Departments.DEPARTMENT_NAME,
Employees.EMPLOYEE_ID,
Employees.FIRST_NAME,
Employees.LAST_NAME
FROM DEPARTMENTS Departments, EMPLOYEES Employees
WHERE Departments.MANAGER_ID=Employees.EMPLOYEE_ID;
This view object would have the following view attributes:
21
View Object DefinitionsView Object Definitions (continued)(continued)
The above view attributes may be (but not required to be) associatedThe above view attributes may be (but not required to be) associated
with attributes from entity objects.with attributes from entity objects.
View objects have two parts:View objects have two parts:
1.1. AA Java classJava class (like ManagerViewImpl.java) – This class handles(like ManagerViewImpl.java) – This class handles
the complex logic or the queries, controlling the client's access tothe complex logic or the queries, controlling the client's access to
the data.the data.
2.2. AnAn XML fileXML file (like ManagerView.xml) – This stores information(like ManagerView.xml) – This stores information
about the query and its relationships to entity objects.about the query and its relationships to entity objects.
22
View Link DefinitionsView Link Definitions
AA View linkView link represents a relationship between the query result sets ofrepresents a relationship between the query result sets of
two view objects. It associates one or more attributes of one viewtwo view objects. It associates one or more attributes of one view
object with one or more attributes of another.object with one or more attributes of another.
23
View Link DefinitionsView Link Definitions (continued)(continued)
For example:For example:
A view object,A view object, DepartmentsViewDepartmentsView, containing the following query:, containing the following query:
Another view object,Another view object, EmployeesViewEmployeesView, containing the following query:, containing the following query:
A view link,A view link, DeptEmpFkLink,DeptEmpFkLink, that associated thethat associated the DepartmentIdDepartmentId attribute ofattribute of
EmployeesViewEmployeesView with thewith the DepartmentIdDepartmentId attribute ofattribute of DepartmentsViewDepartmentsView..
SELECT Departments.DEPARTMENT_ID,
Departments.DEPARTMENT_NAME
FROM DEPARTMENTS Departments
SELECT Employees.EMPLOYEE_ID,
Employees.FIRST_NAME,
Employees.LAST_NAME,
Employees.DEPARTMENT_ID,
FROM EMPLOYEES Employees
24
View Link DefinitionsView Link Definitions (continued)(continued)
DeptEmpFkLinkDeptEmpFkLink represents a master-detail relationship between therepresents a master-detail relationship between the
query result sets ofquery result sets of DepartmentsViewDepartmentsView andand EmployeesViewEmployeesView..
View links between view objects can be (but do not have to be) basedView links between view objects can be (but do not have to be) based
on associations between underlying entity objects. A view link ison associations between underlying entity objects. A view link is
represented in an XML file (more on this in later chapters).represented in an XML file (more on this in later chapters).
25
Application Module DefinitionsApplication Module Definitions
AnAn application moduleapplication module is a container foris a container for view usagesview usages (instances of(instances of
view objectsview objects). It lists all of the view usages your application requires). It lists all of the view usages your application requires
and specifies how they are related by view links. These relationshipsand specifies how they are related by view links. These relationships
can be represented by a tree (application module'scan be represented by a tree (application module's data modeldata model).).
For example, an application module might contain usage ofFor example, an application module might contain usage of
DepartmentsViewDepartmentsView, called, called AllDepartmentsAllDepartments, and a usage of, and a usage of
EmployeesViewEmployeesView, called, called DepartmentEmployeesDepartmentEmployees, linked by an, linked by an
instance ofinstance of EmpDeptFkLinkEmpDeptFkLink, called, called DepartmentToEmployeesDepartmentToEmployees..
26
Application Module DefinitionsApplication Module Definitions (continued)(continued)
This uses the following data model:This uses the following data model:
Using this model, the two view usages are tied together by a link representing a
master-detail relationship between them (EmpDeptFkLink). Using this application
module, your client application could select a row in AllDepartments, and the ADF
BC framework would immediately synchronize DepartmentEmployees so that it
would only return employees from the selected department.
27
Application Module DefinitionsApplication Module Definitions (continued)(continued)
Your application module could contain a usage ofYour application module could contain a usage of DepartmentsViewDepartmentsView
and a usage ofand a usage of EmployeesViewEmployeesView without usingwithout using EmpDeptFkLinkEmpDeptFkLink, as, as
in the following data model:in the following data model:
This module provides usages of the same two view objects, but the view
usages are linked. Your client application could select rows in
AllDepartments and Allmployees usages independently.
28
Application Module DefinitionsApplication Module Definitions (continued)(continued)
You can even include two instances ofYou can even include two instances of EmployeesViewEmployeesView in an applicationin an application module:module:
one a detail of an instance ofone a detail of an instance of DepartmentsViewDepartmentsView and one independent as in the dataand one independent as in the data
model below:model below:
With this application module, a client application could select rows in
DepartmentEmployees and have them automatically synchronized with
AllDepartments and could also select rows in AllEmployees independently.
29
Application Module DefinitionsApplication Module Definitions (continued)(continued)
An application module definition is a template forAn application module definition is a template for application moduleapplication module
instancesinstances, which are individual copies of the data model used by, which are individual copies of the data model used by
particular instances of the application. Each instance represents anparticular instances of the application. Each instance represents an
individual database transaction.individual database transaction.

Weitere ähnliche Inhalte

Was ist angesagt?

New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
InSync2011
 
ADF Introduction By Sandeep Sharda
ADF Introduction By Sandeep ShardaADF Introduction By Sandeep Sharda
ADF Introduction By Sandeep Sharda
Er. Sndp Srda
 
Fusion app integration_con8685_pdf_8685_0001
Fusion app integration_con8685_pdf_8685_0001Fusion app integration_con8685_pdf_8685_0001
Fusion app integration_con8685_pdf_8685_0001
jucaab
 
Oracle fusion applications preparation
Oracle fusion applications preparationOracle fusion applications preparation
Oracle fusion applications preparation
Manikantan Iyer
 
[S lide] java_sig-spring-framework
[S lide] java_sig-spring-framework[S lide] java_sig-spring-framework
[S lide] java_sig-spring-framework
ptlong96
 
Jee design patterns- Marek Strejczek - Rule Financial
Jee design patterns- Marek Strejczek - Rule FinancialJee design patterns- Marek Strejczek - Rule Financial
Jee design patterns- Marek Strejczek - Rule Financial
Rule_Financial
 
Enabling End User And Ad Hoc Reporting With M S S Q L Server 2005 R...
Enabling  End  User And  Ad  Hoc  Reporting  With  M S  S Q L  Server 2005  R...Enabling  End  User And  Ad  Hoc  Reporting  With  M S  S Q L  Server 2005  R...
Enabling End User And Ad Hoc Reporting With M S S Q L Server 2005 R...
Joseph Lopez
 
Integrating oracle cloud and existing applications final sg
Integrating oracle cloud and existing applications  final sgIntegrating oracle cloud and existing applications  final sg
Integrating oracle cloud and existing applications final sg
Ken Ng
 
Fusion app customization_con8719_pdf_8719_0001
Fusion app customization_con8719_pdf_8719_0001Fusion app customization_con8719_pdf_8719_0001
Fusion app customization_con8719_pdf_8719_0001
jucaab
 
Aras PLM Software Solutions
Aras PLM Software SolutionsAras PLM Software Solutions
Aras PLM Software Solutions
Aras
 
Dan Vulpe - JavaFX 2 - Developing RIA with Java
Dan Vulpe - JavaFX 2 - Developing RIA with JavaDan Vulpe - JavaFX 2 - Developing RIA with Java
Dan Vulpe - JavaFX 2 - Developing RIA with Java
Codecamp Romania
 
J2 EEE SIDES
J2 EEE  SIDESJ2 EEE  SIDES
J2 EEE SIDES
bputhal
 
JHeadstart Forms2ADF Generator – Migrating from Oracle Forms to a Best-Practi...
JHeadstart Forms2ADF Generator – Migrating from Oracle Forms to a Best-Practi...JHeadstart Forms2ADF Generator – Migrating from Oracle Forms to a Best-Practi...
JHeadstart Forms2ADF Generator – Migrating from Oracle Forms to a Best-Practi...
Steven Davelaar
 

Was ist angesagt? (20)

New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
 
ADF Introduction By Sandeep Sharda
ADF Introduction By Sandeep ShardaADF Introduction By Sandeep Sharda
ADF Introduction By Sandeep Sharda
 
Fusion app integration_con8685_pdf_8685_0001
Fusion app integration_con8685_pdf_8685_0001Fusion app integration_con8685_pdf_8685_0001
Fusion app integration_con8685_pdf_8685_0001
 
As 400
As 400As 400
As 400
 
Oracle fusion applications preparation
Oracle fusion applications preparationOracle fusion applications preparation
Oracle fusion applications preparation
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for Beginners
 
[S lide] java_sig-spring-framework
[S lide] java_sig-spring-framework[S lide] java_sig-spring-framework
[S lide] java_sig-spring-framework
 
Oracle Fusion applications 101 [2010 OAUG Collaborate]
Oracle Fusion applications 101 [2010 OAUG Collaborate]Oracle Fusion applications 101 [2010 OAUG Collaborate]
Oracle Fusion applications 101 [2010 OAUG Collaborate]
 
Jee design patterns- Marek Strejczek - Rule Financial
Jee design patterns- Marek Strejczek - Rule FinancialJee design patterns- Marek Strejczek - Rule Financial
Jee design patterns- Marek Strejczek - Rule Financial
 
Oracle Fusion Development, May 2009
Oracle Fusion Development, May 2009Oracle Fusion Development, May 2009
Oracle Fusion Development, May 2009
 
Enabling End User And Ad Hoc Reporting With M S S Q L Server 2005 R...
Enabling  End  User And  Ad  Hoc  Reporting  With  M S  S Q L  Server 2005  R...Enabling  End  User And  Ad  Hoc  Reporting  With  M S  S Q L  Server 2005  R...
Enabling End User And Ad Hoc Reporting With M S S Q L Server 2005 R...
 
Integrating oracle cloud and existing applications final sg
Integrating oracle cloud and existing applications  final sgIntegrating oracle cloud and existing applications  final sg
Integrating oracle cloud and existing applications final sg
 
Oracle Fusion Applications Security - Designing Roles
Oracle Fusion Applications Security - Designing RolesOracle Fusion Applications Security - Designing Roles
Oracle Fusion Applications Security - Designing Roles
 
Fusion app customization_con8719_pdf_8719_0001
Fusion app customization_con8719_pdf_8719_0001Fusion app customization_con8719_pdf_8719_0001
Fusion app customization_con8719_pdf_8719_0001
 
Aras PLM Software Solutions
Aras PLM Software SolutionsAras PLM Software Solutions
Aras PLM Software Solutions
 
Dan Vulpe - JavaFX 2 - Developing RIA with Java
Dan Vulpe - JavaFX 2 - Developing RIA with JavaDan Vulpe - JavaFX 2 - Developing RIA with Java
Dan Vulpe - JavaFX 2 - Developing RIA with Java
 
J2 EEE SIDES
J2 EEE  SIDESJ2 EEE  SIDES
J2 EEE SIDES
 
Obiee
ObieeObiee
Obiee
 
JHeadstart Forms2ADF Generator – Migrating from Oracle Forms to a Best-Practi...
JHeadstart Forms2ADF Generator – Migrating from Oracle Forms to a Best-Practi...JHeadstart Forms2ADF Generator – Migrating from Oracle Forms to a Best-Practi...
JHeadstart Forms2ADF Generator – Migrating from Oracle Forms to a Best-Practi...
 
OBIEE11g Architecture & Internals : Collaborate'11, Orlando 2011
OBIEE11g Architecture & Internals : Collaborate'11, Orlando 2011OBIEE11g Architecture & Internals : Collaborate'11, Orlando 2011
OBIEE11g Architecture & Internals : Collaborate'11, Orlando 2011
 

Andere mochten auch

Andere mochten auch (20)

Soa
SoaSoa
Soa
 
Buissness model analysis
Buissness model analysisBuissness model analysis
Buissness model analysis
 
Presentation of Tax
Presentation of Tax Presentation of Tax
Presentation of Tax
 
Jsp
JspJsp
Jsp
 
Multiplatform
MultiplatformMultiplatform
Multiplatform
 
Mule esb
Mule esbMule esb
Mule esb
 
Seo
SeoSeo
Seo
 
Bpm
BpmBpm
Bpm
 
Rest
RestRest
Rest
 
Soap
SoapSoap
Soap
 
Soap service
Soap serviceSoap service
Soap service
 
Mule esb
Mule esbMule esb
Mule esb
 
Oracle real application_cluster
Oracle real application_clusterOracle real application_cluster
Oracle real application_cluster
 
Restful api modeling language
Restful api modeling languageRestful api modeling language
Restful api modeling language
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
 
Mule anypoint platform
Mule anypoint platformMule anypoint platform
Mule anypoint platform
 
EXtensible Markup Language
EXtensible Markup LanguageEXtensible Markup Language
EXtensible Markup Language
 
Api desgin
Api desginApi desgin
Api desgin
 
Leadership today
Leadership todayLeadership today
Leadership today
 
Health triangle
Health triangleHealth triangle
Health triangle
 

Ähnlich wie Introducing adf business components

TheSpringFramework
TheSpringFrameworkTheSpringFramework
TheSpringFramework
Shankar Nair
 

Ähnlich wie Introducing adf business components (20)

Ajp notes-chapter-05
Ajp notes-chapter-05Ajp notes-chapter-05
Ajp notes-chapter-05
 
Ajp notes-chapter-05
Ajp notes-chapter-05Ajp notes-chapter-05
Ajp notes-chapter-05
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch Processing
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
Java database programming with jdbc
Java database programming with jdbcJava database programming with jdbc
Java database programming with jdbc
 
Ra framework 0.1
Ra framework 0.1Ra framework 0.1
Ra framework 0.1
 
J developer, oracle adf introduction
J developer, oracle adf   introductionJ developer, oracle adf   introduction
J developer, oracle adf introduction
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for women
 
Spring ppt
Spring pptSpring ppt
Spring ppt
 
What is Hibernate Framework?
What is Hibernate Framework?What is Hibernate Framework?
What is Hibernate Framework?
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
 
TheSpringFramework
TheSpringFrameworkTheSpringFramework
TheSpringFramework
 
How Spring Framework Really Works?
How Spring Framework Really Works?How Spring Framework Really Works?
How Spring Framework Really Works?
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Adf 11
Adf 11Adf 11
Adf 11
 
application-template-deployment-guide.pdf
application-template-deployment-guide.pdfapplication-template-deployment-guide.pdf
application-template-deployment-guide.pdf
 
Ejb course in-mumbai
Ejb course in-mumbaiEjb course in-mumbai
Ejb course in-mumbai
 
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial  | VirtualNuggetsFree Hibernate Tutorial  | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggets
 
Java J2EE
Java J2EEJava J2EE
Java J2EE
 

Mehr von Prabhat gangwar

Mehr von Prabhat gangwar (20)

Middleware
MiddlewareMiddleware
Middleware
 
Pseudolocalization
PseudolocalizationPseudolocalization
Pseudolocalization
 
Mule anypoint studio
Mule anypoint studioMule anypoint studio
Mule anypoint studio
 
What is cluster analysis
What is cluster analysisWhat is cluster analysis
What is cluster analysis
 
clustering and load balancing
clustering and load balancingclustering and load balancing
clustering and load balancing
 
Middleware systems overview and introduction
Middleware systems overview and introductionMiddleware systems overview and introduction
Middleware systems overview and introduction
 
Mule fundamentals
Mule fundamentalsMule fundamentals
Mule fundamentals
 
Gsm architecture
Gsm architectureGsm architecture
Gsm architecture
 
Oracle vs-mulesoft-api-manager-features
Oracle vs-mulesoft-api-manager-featuresOracle vs-mulesoft-api-manager-features
Oracle vs-mulesoft-api-manager-features
 
File transfer methods
File transfer methodsFile transfer methods
File transfer methods
 
Ftp tftp
Ftp tftpFtp tftp
Ftp tftp
 
Global warming
Global warmingGlobal warming
Global warming
 
Vedic mathmetics
Vedic mathmeticsVedic mathmetics
Vedic mathmetics
 
Trends
TrendsTrends
Trends
 
E commerce buissness-model
E commerce buissness-modelE commerce buissness-model
E commerce buissness-model
 
Effective communication skills
Effective communication skillsEffective communication skills
Effective communication skills
 
Office politics
Office politicsOffice politics
Office politics
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
Add to the path on mac os x
Add to the path on mac os xAdd to the path on mac os x
Add to the path on mac os x
 
Cross platform mobile application devlopment
Cross platform mobile application devlopmentCross platform mobile application devlopment
Cross platform mobile application devlopment
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
 

Kürzlich hochgeladen (20)

social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

Introducing adf business components

  • 1. 1 Chapter 8Chapter 8 Introducing ADF BusinessIntroducing ADF Business ComponentsComponents
  • 2. 2 Introducing ADF Business ComponentsIntroducing ADF Business Components ADF BCADF BC is a Java and XML based framework for developing:is a Java and XML based framework for developing: • Business logic, including validation and default logicBusiness logic, including validation and default logic • QueriesQueries • Transaction handlingTransaction handling • Data accessData access It does not create a user interface, but is a pure encapsulation of businessIt does not create a user interface, but is a pure encapsulation of business logic that communicates with a separate client application, which handleslogic that communicates with a separate client application, which handles user interaction.user interaction. Using ADF BC is the simplest way to design data-aware applicationsUsing ADF BC is the simplest way to design data-aware applications with JDeveloper. This chapter presents an overview of ADF BC bywith JDeveloper. This chapter presents an overview of ADF BC by describing its components and uses.describing its components and uses.
  • 3. 3 Why Use ADF BC?Why Use ADF BC? The advantage of ADF BC over UI-enforced business logic is reusability.The advantage of ADF BC over UI-enforced business logic is reusability. For example, a single ADF BC layer can provide the business logic for allFor example, a single ADF BC layer can provide the business logic for all a company's needs. The business components can be used again anda company's needs. The business components can be used again and again, with multiple interfaces (a time saver).again, with multiple interfaces (a time saver).
  • 4. 4 Advantages of ADF BCAdvantages of ADF BC By maintaining a cache of data in memory, ADF BC reduces the numberBy maintaining a cache of data in memory, ADF BC reduces the number of database trips required by an application resulting in improvedof database trips required by an application resulting in improved performance and scalability.performance and scalability. ADF BC allows the business logic to be written in Java, which saves theADF BC allows the business logic to be written in Java, which saves the trouble of integrating a Java GUI or JSP application with business logictrouble of integrating a Java GUI or JSP application with business logic written in PL/SQL code.written in PL/SQL code. Removing the business logic out of the database keeps the database fromRemoving the business logic out of the database keeps the database from handling anything but data, which increases an application's modularityhandling anything but data, which increases an application's modularity and efficiency.and efficiency.
  • 5. 5 Advantages of ADF BCAdvantages of ADF BC (continued)(continued) There are also advantages to implementing some business logic directlyThere are also advantages to implementing some business logic directly in the database (more robust) since it will be enforced even in ain the database (more robust) since it will be enforced even in a SQL*Plus session. Business logic implemented in the ADF BC layer isSQL*Plus session. Business logic implemented in the ADF BC layer is only enforced in applications using that layer, but increases performance.only enforced in applications using that layer, but increases performance. There is a trade-off between robustness and performance.There is a trade-off between robustness and performance. Therefore, the most critical business logic should be implemented in theTherefore, the most critical business logic should be implemented in the database or redundantly in both the database and a ADF BC layer. Thedatabase or redundantly in both the database and a ADF BC layer. The remainder of the business logic can be implemented in the ADF BCremainder of the business logic can be implemented in the ADF BC layer.layer.
  • 6. 6 Advantages of ADF BCAdvantages of ADF BC (continued)(continued) ADF BC provides four ready-made architectures for businessADF BC provides four ready-made architectures for business component clients:component clients: • JClientJClient, an architecture for creating Java GUIs (useful for intensive, an architecture for creating Java GUIs (useful for intensive data-entry applications requiring high interactivity).data-entry applications requiring high interactivity). • Thin JSP clientsThin JSP clients are useful for web-based applications where aare useful for web-based applications where a thin client is more important than very high interactivity, such asthin client is more important than very high interactivity, such as self-service and e-commerce applications.self-service and e-commerce applications. • XSQL clientsXSQL clients, which generate XML for either flexible display with, which generate XML for either flexible display with a style sheet or loose coupling between applications.a style sheet or loose coupling between applications. • UIXUIX, a framework-based architecture for developing web, a framework-based architecture for developing web applications.applications.
  • 7. 7 Advantages of ADF BCAdvantages of ADF BC (continued)(continued) ADF BC also has the advantage of being "deployment-configurationADF BC also has the advantage of being "deployment-configuration independent". A single ADF BC layer can be deployed as local Javaindependent". A single ADF BC layer can be deployed as local Java classes or as an Enterprise JavaBean (EJB), with no rewriting of codeclasses or as an Enterprise JavaBean (EJB), with no rewriting of code necessary. You can concentrate on the business logic of your applicationnecessary. You can concentrate on the business logic of your application instead of its deployment requirements.instead of its deployment requirements. ADF BC components (whether deployed to a J2EE web module withADF BC components (whether deployed to a J2EE web module with JSP pages or as an EJB) are fully J2EE-compliant. The ADF BCJSP pages or as an EJB) are fully J2EE-compliant. The ADF BC framework automatically implements the J2EE BluePrints designframework automatically implements the J2EE BluePrints design patterns suggested by Sun Microsystems so you do not need to worrypatterns suggested by Sun Microsystems so you do not need to worry about them.about them.
  • 8. 8 Business Components, Java, and XMLBusiness Components, Java, and XML Entity objects, view objects, and application modules each have twoEntity objects, view objects, and application modules each have two parts: a Java class file and an XML file. The files have different purposes.parts: a Java class file and an XML file. The files have different purposes. ADF BC is a framework, this means that much of its functionality isADF BC is a framework, this means that much of its functionality is contained in a set of libraries. ADF BC classes extend (subclass) the basecontained in a set of libraries. ADF BC classes extend (subclass) the base classes provided by these libraries to provide complex business logic,classes provided by these libraries to provide complex business logic, which requires the procedural power of Java to implement. This allowswhich requires the procedural power of Java to implement. This allows you (if needed) to:you (if needed) to: • Easily write code to implement complex business rules inside yourEasily write code to implement complex business rules inside your entity object Java classesentity object Java classes • Code complex query logic in your view object classesCode complex query logic in your view object classes • Code complex transaction handling in your application moduleCode complex transaction handling in your application module classes.classes.
  • 9. 9 Business Components, Java, and XMLBusiness Components, Java, and XML The base classes in the ADF BC framework are programmed to workThe base classes in the ADF BC framework are programmed to work with XML files. Some business logic is common and simple and can bewith XML files. Some business logic is common and simple and can be handled with a line or two of declarative XML. Instead of writing ahandled with a line or two of declarative XML. Instead of writing a procedure to implement this sort of business logic, you can just declareprocedure to implement this sort of business logic, you can just declare that an entity attribute, for example, must obey a particular validationthat an entity attribute, for example, must obey a particular validation rule. The base entity object class (and by inheritance, your custom Javarule. The base entity object class (and by inheritance, your custom Java class) can automatically read the XML file to enforce the rule.class) can automatically read the XML file to enforce the rule. JDeveloper has wizards that write and edit the XML files for you.JDeveloper has wizards that write and edit the XML files for you. The ADF BC framework uses XML files to store static definitions suchThe ADF BC framework uses XML files to store static definitions such as the structure of a database table or query. Its base classes can obtainas the structure of a database table or query. Its base classes can obtain the structure of particular business components by parsing the XML.the structure of particular business components by parsing the XML. This can have performance advantages. For example, an entity objectThis can have performance advantages. For example, an entity object dose not need to query the database at runtime for structural informationdose not need to query the database at runtime for structural information about the table it represents.about the table it represents.
  • 10. 10 ADF Business Component GroupsADF Business Component Groups ADF BC components are divided into two groups:ADF BC components are divided into two groups: • Business domain componentsBusiness domain components • Data model componentsData model components
  • 11. 11 Business Domain ComponentsBusiness Domain Components These components represent features of the database: tables and views,These components represent features of the database: tables and views, constraints, and relationships. They are the most reusable businessconstraints, and relationships. They are the most reusable business components because they can be used by any application that needs tocomponents because they can be used by any application that needs to access the same data.access the same data. There are three kinds of business domain components:There are three kinds of business domain components: • Entity Object definitionsEntity Object definitions • AssociationsAssociations • DomainsDomains
  • 12. 12 Entity Object DefinitionsEntity Object Definitions An entity object definition usually represents a database table or databaseAn entity object definition usually represents a database table or database view, but it can also be used to represent EJB entity beans. It acts as aview, but it can also be used to represent EJB entity beans. It acts as a representation of the table or database and handles all of the businessrepresentation of the table or database and handles all of the business rules for that table or view including validation, defaulting, and anythingrules for that table or view including validation, defaulting, and anything else that happens when a row is created, deleted, or changed.else that happens when a row is created, deleted, or changed. The power of ADF BC is its interface with the database used by anThe power of ADF BC is its interface with the database used by an application.application. The ADF BC layer represents the database table as an entity object. AnThe ADF BC layer represents the database table as an entity object. An entity object hasentity object has entity attributesentity attributes that represent the table columnsthat represent the table columns (mapping may not always be one-to-one).(mapping may not always be one-to-one). The types of the properties are Java classes that correspond to the SQLThe types of the properties are Java classes that correspond to the SQL types of the columns.types of the columns.
  • 13. 13 Entity Object DefinitionsEntity Object Definitions Example:Example: DEPARTMENTSDEPARTMENTS tabletable Entity objects for the above table may have the followingEntity objects for the above table may have the following entity attributes:entity attributes:
  • 14. 14 Entity Object DefinitionsEntity Object Definitions Java does not directly support SQL datatypes, but each SQL datatype canJava does not directly support SQL datatypes, but each SQL datatype can be mapped to a Java type. Some Java types are classes inbe mapped to a Java type. Some Java types are classes in java.langjava.lang andand others in the packageothers in the package oracle.jbo.domainoracle.jbo.domain (discussed later).(discussed later). Entity objects have two parts:Entity objects have two parts: 1.1. AA Java classJava class (like DepartmentsImpl.java) – This contains the(like DepartmentsImpl.java) – This contains the procedural code to implement the entity object.procedural code to implement the entity object. 2.2. AnAn XML fileXML file (like Departments.xml) – This includes metadata(like Departments.xml) – This includes metadata describing the entity object, its attributes, and the table upondescribing the entity object, its attributes, and the table upon which it is based, as well as declarative code.which it is based, as well as declarative code.
  • 15. 15 ADF BC Relationships (page 228)ADF BC Relationships (page 228)
  • 16. 16 AssociationsAssociations Like tables, entity objects are often related to one another. TheLike tables, entity objects are often related to one another. The relationships between entity objects are calledrelationships between entity objects are called associationsassociations. An. An association matches one or more attributes of a "source" entity objectassociation matches one or more attributes of a "source" entity object with one or more attributes of a "destination" entity object.with one or more attributes of a "destination" entity object. This is like a foreign key constraint that matches one or more columnsThis is like a foreign key constraint that matches one or more columns of a child table with one or more columns of a parent table.of a child table with one or more columns of a parent table. Associations are stored in an XML file.Associations are stored in an XML file.
  • 17. 17 DomainsDomains DomainsDomains are special java types used by ADF BC as the types for many entity objectare special java types used by ADF BC as the types for many entity object and view object attributes. In the coverage of entity objects earlier, a class thatand view object attributes. In the coverage of entity objects earlier, a class that implements theimplements the DepartmentsDepartments entity object has some entity attributes of typeentity object has some entity attributes of type oracle.jbo.domain.Numberoracle.jbo.domain.Number. The entity attributes of an entity object Java class are. The entity attributes of an entity object Java class are objects, not primitive Java types such asobjects, not primitive Java types such as intint.. Database columns of SQL datatype VARCHAR2 have the Java classDatabase columns of SQL datatype VARCHAR2 have the Java class java.lang.Stringjava.lang.String. For other SQL types (NUMBER, etc.), ADF BC provides. For other SQL types (NUMBER, etc.), ADF BC provides domainsdomains to wrap the SQL datatype. Domains liketo wrap the SQL datatype. Domains like oracle.jbo.domain.Numberoracle.jbo.domain.Number are basicallyare basically object wrappers for scalar types.object wrappers for scalar types. JDeveloper will automatically create aJDeveloper will automatically create a domaindomain if you base an entity object on a tableif you base an entity object on a table with an Oracle object type column in it. Thiswith an Oracle object type column in it. This domaindomain represents the Oracle objectrepresents the Oracle object type, giving you Java wrappers for each of the object type's fields and methods.type, giving you Java wrappers for each of the object type's fields and methods. You can also create your ownYou can also create your own domainsdomains..
  • 18. 18 Data Model ComponentsData Model Components They are business components that collect data and present it to theThey are business components that collect data and present it to the view and controller through the ADF model layer. They are notview and controller through the ADF model layer. They are not reusable as business domain components because their design is basedreusable as business domain components because their design is based on the data needs of a particular client application.on the data needs of a particular client application. They are still independent of a user interface.They are still independent of a user interface. There are three kinds of data model components:There are three kinds of data model components: • View object definitionsView object definitions • View link definitionsView link definitions • Application module definitionsApplication module definitions
  • 19. 19 View Object DefinitionsView Object Definitions Generally you should not present all of the information stored in aGenerally you should not present all of the information stored in a database object (entity object) in one application. You may alsodatabase object (entity object) in one application. You may also want/need data taken from more than one database object.want/need data taken from more than one database object. SQL provides the queries necessary to select exactly the data you needSQL provides the queries necessary to select exactly the data you need from one or more tables. This is why ADF BC hasfrom one or more tables. This is why ADF BC has view objectview object definitionsdefinitions, which correspond to SQL queries. A view object, which correspond to SQL queries. A view object definition actually stores a SQL query.definition actually stores a SQL query.
  • 20. 20 View Object DefinitionsView Object Definitions (continued)(continued) A view object definition hasA view object definition has view attributesview attributes (like entity objects have(like entity objects have entity attributes) that correspond the columns of a query result. Forentity attributes) that correspond the columns of a query result. For example, consider the view object for the following query:example, consider the view object for the following query: SELECT Departments.DEPARTMENT_ID, Departments.DEPARTMENT_NAME, Employees.EMPLOYEE_ID, Employees.FIRST_NAME, Employees.LAST_NAME FROM DEPARTMENTS Departments, EMPLOYEES Employees WHERE Departments.MANAGER_ID=Employees.EMPLOYEE_ID; This view object would have the following view attributes:
  • 21. 21 View Object DefinitionsView Object Definitions (continued)(continued) The above view attributes may be (but not required to be) associatedThe above view attributes may be (but not required to be) associated with attributes from entity objects.with attributes from entity objects. View objects have two parts:View objects have two parts: 1.1. AA Java classJava class (like ManagerViewImpl.java) – This class handles(like ManagerViewImpl.java) – This class handles the complex logic or the queries, controlling the client's access tothe complex logic or the queries, controlling the client's access to the data.the data. 2.2. AnAn XML fileXML file (like ManagerView.xml) – This stores information(like ManagerView.xml) – This stores information about the query and its relationships to entity objects.about the query and its relationships to entity objects.
  • 22. 22 View Link DefinitionsView Link Definitions AA View linkView link represents a relationship between the query result sets ofrepresents a relationship between the query result sets of two view objects. It associates one or more attributes of one viewtwo view objects. It associates one or more attributes of one view object with one or more attributes of another.object with one or more attributes of another.
  • 23. 23 View Link DefinitionsView Link Definitions (continued)(continued) For example:For example: A view object,A view object, DepartmentsViewDepartmentsView, containing the following query:, containing the following query: Another view object,Another view object, EmployeesViewEmployeesView, containing the following query:, containing the following query: A view link,A view link, DeptEmpFkLink,DeptEmpFkLink, that associated thethat associated the DepartmentIdDepartmentId attribute ofattribute of EmployeesViewEmployeesView with thewith the DepartmentIdDepartmentId attribute ofattribute of DepartmentsViewDepartmentsView.. SELECT Departments.DEPARTMENT_ID, Departments.DEPARTMENT_NAME FROM DEPARTMENTS Departments SELECT Employees.EMPLOYEE_ID, Employees.FIRST_NAME, Employees.LAST_NAME, Employees.DEPARTMENT_ID, FROM EMPLOYEES Employees
  • 24. 24 View Link DefinitionsView Link Definitions (continued)(continued) DeptEmpFkLinkDeptEmpFkLink represents a master-detail relationship between therepresents a master-detail relationship between the query result sets ofquery result sets of DepartmentsViewDepartmentsView andand EmployeesViewEmployeesView.. View links between view objects can be (but do not have to be) basedView links between view objects can be (but do not have to be) based on associations between underlying entity objects. A view link ison associations between underlying entity objects. A view link is represented in an XML file (more on this in later chapters).represented in an XML file (more on this in later chapters).
  • 25. 25 Application Module DefinitionsApplication Module Definitions AnAn application moduleapplication module is a container foris a container for view usagesview usages (instances of(instances of view objectsview objects). It lists all of the view usages your application requires). It lists all of the view usages your application requires and specifies how they are related by view links. These relationshipsand specifies how they are related by view links. These relationships can be represented by a tree (application module'scan be represented by a tree (application module's data modeldata model).). For example, an application module might contain usage ofFor example, an application module might contain usage of DepartmentsViewDepartmentsView, called, called AllDepartmentsAllDepartments, and a usage of, and a usage of EmployeesViewEmployeesView, called, called DepartmentEmployeesDepartmentEmployees, linked by an, linked by an instance ofinstance of EmpDeptFkLinkEmpDeptFkLink, called, called DepartmentToEmployeesDepartmentToEmployees..
  • 26. 26 Application Module DefinitionsApplication Module Definitions (continued)(continued) This uses the following data model:This uses the following data model: Using this model, the two view usages are tied together by a link representing a master-detail relationship between them (EmpDeptFkLink). Using this application module, your client application could select a row in AllDepartments, and the ADF BC framework would immediately synchronize DepartmentEmployees so that it would only return employees from the selected department.
  • 27. 27 Application Module DefinitionsApplication Module Definitions (continued)(continued) Your application module could contain a usage ofYour application module could contain a usage of DepartmentsViewDepartmentsView and a usage ofand a usage of EmployeesViewEmployeesView without usingwithout using EmpDeptFkLinkEmpDeptFkLink, as, as in the following data model:in the following data model: This module provides usages of the same two view objects, but the view usages are linked. Your client application could select rows in AllDepartments and Allmployees usages independently.
  • 28. 28 Application Module DefinitionsApplication Module Definitions (continued)(continued) You can even include two instances ofYou can even include two instances of EmployeesViewEmployeesView in an applicationin an application module:module: one a detail of an instance ofone a detail of an instance of DepartmentsViewDepartmentsView and one independent as in the dataand one independent as in the data model below:model below: With this application module, a client application could select rows in DepartmentEmployees and have them automatically synchronized with AllDepartments and could also select rows in AllEmployees independently.
  • 29. 29 Application Module DefinitionsApplication Module Definitions (continued)(continued) An application module definition is a template forAn application module definition is a template for application moduleapplication module instancesinstances, which are individual copies of the data model used by, which are individual copies of the data model used by particular instances of the application. Each instance represents anparticular instances of the application. Each instance represents an individual database transaction.individual database transaction.