You are on page 1of 48

Using Java in the

Oracle Frameworks

Lance Reedy
Java Architect

Release 11i Workshops


Dallas, TX • Santa Clara, CA
Cincinnati, OH • Denver, CO • Atlanta, GA
Detroit, MI • Las Vegas, NV
www.solutionbeacon.com
Are you an OAUG Member?

Global Users. Global Solutions.


Member Benefits include:
u Advocacy opportunities to influence Oracle on product enhancements, usability,
new features, Oracle support, pricing and quality
u Knowledge that showcases the latest trends and techniques used by industry
leaders through our national and regional events and our publications, such as
OAUG Insight magazine
u Communication with other OAUG members worldwide through participation in
OAUG committees, leadership positions, interaction with Oracle Corporation's
user initiatives, frequent member surveys, and Oracle management briefings
u Education through the hundreds of career-enhancing presentations in our
conference paper database archive, as well as discounts to conferences and
Oracle education
u Networking with Oracle customers, industry experts, third-party software firms,
and other Oracle Applications specialists through our Member Database and
Online Vendor Directory

© 2007 Solution Beacon, LLC. All Rights Reserved.


2
Agenda

uExplore the use of - (($SSOLFDWLRQ6HUYHU

Java technologies in
l OAF
l ADF 6HUYOHW
l OC4J - 6(

uWrap-up

© 2007 Solution Beacon, LLC. All Rights Reserved.


3
Relevant History

uThe move from native clients to web clients


l With the rise of the web browser, the vast majority of
“code” can reside on the server, and only the user
interface can exist on the client
uThe development of the Java 2 platform
l A common language that can run on most flavors of
UNIX as well as Win32
uThe development of new device platforms able to
run web browsers
l Cell phone, PDA, bar code scanners, …

© 2007 Solution Beacon, LLC. All Rights Reserved.


4
Early Standards

uServer side languages included


l CGI-BIN programming – first generation
l Servlets – first generation of Java
l JSP – second generation, complementary to Servlets
uHTML and JavaScript on the client

© 2007 Solution Beacon, LLC. All Rights Reserved.


5
Java Editions

uJava 2 Standard Edition (J2SE)


l What we typically think of as Java on a server
uJava Plug-in
l The J2SE environment that is designed specifically to
run inside a web browser
l Not feature limited, but very ability limited
uJava 2 Enterprise Edition (J2EE)
l Designed to be a cross platform application server
l Sun provides the API specifications, and a reference
implementation of them

© 2007 Solution Beacon, LLC. All Rights Reserved.


6
Java Editions…cont’d

uJDK
l Java developers Kit – specifically the core Java
language (J2SE) developers kit
uJ2EE SDK
l The API libraries, compiler, and documentation needed
to write a J2EE application
l Includes the reference application server

© 2007 Solution Beacon, LLC. All Rights Reserved.


7
Adding Java

u As a language Java has the flexibility of running on both


sides of the client / server model
u Uses different programming models for each platform

© 2007 Solution Beacon, LLC. All Rights Reserved.


8
JInitiator – New Client

uIs Oracle’s licensed JVM


uUsed on client platform to provide a consistent
environment
uExecutes within the client’s web browser to run
things like Forms based modules in E-Business
Suite 11i

© 2007 Solution Beacon, LLC. All Rights Reserved.


9
What is OAF

uBased on early web standards and technologies


uAn attempt to introduce abstraction into application
design
l Separation of components into layers
l Connections only between adjoining layers
uBy separating the display from the business logic
change becomes easier
uMechanism for personalization, design pattern for
extension

© 2007 Solution Beacon, LLC. All Rights Reserved.


10
Abstraction

uThe idea of breaking an algorithm into discrete


layers, each of which is opaque
uCommon in Object Oriented programming
uSimplifies code while complicating solutions?!

© 2007 Solution Beacon, LLC. All Rights Reserved.


11
HTML User Interface

uTags and properties <body>


used can become too <p>Exampl e table</p>
complex and <table cell
spacing=1 …
interdependent to <caption>Tabl e
manage easily 1</caption>
<tr>
uDependent upon the
<td>Homer</td>
browser’s
<td>cel l
2</td>
interpretation of the
</tr>
HTML language
</table>
</body>
© 2007 Solution Beacon, LLC. All Rights Reserved.
12
JSP

<body><p>
uA way to create HTML
A tabl e drawn via a JSP page.
with programmatic </p><p>
content. <tabl e cel l
spacing=1 …
uEmbeds Java doe <caption>Tabl e 1</caption>
(scriptlets) into HTML <tr>
<td>
<% = vi sitor.getName()% >
</td>
<td>cel l2</td></tr>
</table>
</body>

© 2007 Solution Beacon, LLC. All Rights Reserved.


13
Servlet

uJava code that produces HTML as it’s output


uDistributed as compiled Class files

publicclass_test1 … {
publicvoid _j
spService(… {
response.setContentType…
__ojsp_s_out.write(“<body>…”);
__ojsp_s_out.write(vi
sitor.
getname());

© 2007 Solution Beacon, LLC. All Rights Reserved.


14
MVC Design Pattern
The Model contains the
business logic for the
application and the data
that it acts on.

The Controller
provides
The View creates application
the UI that is workflow and
presented to the coordinates what
end user. the user sees.
© 2007 Solution Beacon, LLC. All Rights Reserved.
15
MVC Technologies
•Each component
uses programming JavaBeans, EJB
concepts and
models best suited
for it’s demands

JavaServer Pages Servlet(s)

© 2007 Solution Beacon, LLC. All Rights Reserved.


16
MVC Declarative Programming
Model

Controller

View

© 2007 Solution Beacon, LLC. All Rights Reserved.


17
Model Details
uA Java class (commonly a
JavaBean) is used to
represent a business
entity that the application
acts on

© 2007 Solution Beacon, LLC. All Rights Reserved.


18
Controller Details

uA XML config file


is used to control
behavior of the
application Controller
uA group of Java
Classes
implement the
controller’s API

© 2007 Solution Beacon, LLC. All Rights Reserved.


19
MVC Declarative Programming

uCustom tags are used


in the JSP page to
reference data
presented by, or sent
to, the Model.
View

© 2007 Solution Beacon, LLC. All Rights Reserved.


20
Personalizations

uChanges to page layout or content visibility


uCan be done by administrators or by end users
uThe personalizations are applied between the
HTML page being generated and it being sent to
the client
uPersonalizations are stored via data, not code
changes

© 2007 Solution Beacon, LLC. All Rights Reserved.


21
OAF Page Rendering
uA hierarchy of operations, many of which are
driven purely by data

© 2007 Solution Beacon, LLC. All Rights Reserved.


22
What is ADF

uThe next generation after OAF


uBuilds on OAF, adds
l More dynamic page refreshing
l Data Binding
l Ability to build content for limited devices
l JavaServer Faces
uMoves further into the J2EE architecture

© 2007 Solution Beacon, LLC. All Rights Reserved.


23
Standards Used by ADF

uMVC
uJSP, Servlets
uJavaBeans
uEnterprise JavaBeans
uJavaServer Faces

© 2007 Solution Beacon, LLC. All Rights Reserved.


24
Oracle Technologies Used

uADF Faces
l UIX widgets
uTopLink
l Data persistence
uOC4J
l J2EE application server

© 2007 Solution Beacon, LLC. All Rights Reserved.


25
JavaBeans and EJB

uJavaBeans conform to particular coding rules


l Beans have data fields, each field must be accessed
via a Get or a Set method
l They can be loaded dynamically
uThey are used to store data that needs to be
used programmatically

© 2007 Solution Beacon, LLC. All Rights Reserved.


26
Enterprise JavaBeans

uEJB expands the idea of the basic JavaBean


l Persistence in a database
l Remote access
uJava carries the C/UNIX idea of Remote
Procedure Call forward in the form of Remote
Method Invocation
l An EJB container must facilitate the use RMI to
allow remote client’s to access Enterprise
JavaBeans

© 2007 Solution Beacon, LLC. All Rights Reserved.


27
Java / SQL

uA query
mechanism must
exist to allow
objects to be
retrieved from the
DB as needed
uDatatypes must be
mapped between
languages:
l String vs varchar
l Address vs a table

© 2007 Solution Beacon, LLC. All Rights Reserved.


28
Object Persistence
uThe desire in a J2EE
environment is to prevent
application code from - (($SS6HUYHU 9LHZ
interacting directly with the
%XVLQHVV/RJLF %XVLQHVV'DWD
DB
7RS/LQN - (('%6HUYLFHV
uThis is achieved by
4XHULHV &RQQHFWLRQ3RRO
allowing the J2EE
&DFKH 7UDQVDFWLRQ0JU
container to access to
3HUVLVWHQFH
common DB services
'DWDEDVH

64/

© 2007 Solution Beacon, LLC. All Rights Reserved.


29
EJB 3.0 Persistence

u Based on annotation
u Uses a tool to
generate the code’s
skeleton and
annotations
u Uses other tools at
compile and runtime
to turn the annotations
into actual code

© 2007 Solution Beacon, LLC. All Rights Reserved.


30
TopLink versus EJB 3.0

uTopLink is an established Oracle standard


uEJB 3.0’s Java Persistence API is an emerging
industry wide standard…
l … Java Persistence API was added in latest J2EE spec
l Can be used outside of EJB, by J2SE apps
l Based on ideas submitted by various J2EE vendors
including Oracle

© 2007 Solution Beacon, LLC. All Rights Reserved.


31
JSF and ADF Faces

uJavaServer faces simplifies the design of


HTML UI
l By providing tags to represent common data
elements
l By providing components which can help to
validate data as it’s being entered
uADF brings tags representing common
Oracle UI elements

© 2007 Solution Beacon, LLC. All Rights Reserved.


32
ADF Faces – Declarative UI

uExtends the
JSP concept to
expose Oracle’s
own UIX
widgets
uReplaces even
simple HTML
tags with
abstract
elements

© 2007 Solution Beacon, LLC. All Rights Reserved.


33
OC4J – J2EE Server

uJ2EE defines a specification for the applications


server
uDefines clear interfaces and mechanisms for
interacting with other infrastructure, such as
Identity Management (LDAP)
uIndividual vendors then select portions of the spec
that they will implement
uFocuses on server side technologies

© 2007 Solution Beacon, LLC. All Rights Reserved.


34
J2EE Technologies

uA rich suite of APIs


built on a common
core

© 2007 Solution Beacon, LLC. All Rights Reserved.


35
Development in J2EE

uJava is rich with OpenSource solutions


l J2EE app servers: JBoss, Tomcat, GlassFish
l Developer tools: Eclipse, NetBeans
l Frameworks: Struts, Tapestry, Turbine
l Persistence: Hibernate, OJB
uSome of these are sold as commercial applications
with vendor support and consulting
uNone of the developers tools offer tight integration
into proprietary application servers
uFew of them offer a complete development solution

© 2007 Solution Beacon, LLC. All Rights Reserved.


36
JDeveloper

uOracle’s full featured developer’s toolkit


uVery feature rich for plain Java, J2EE, and Oracle
specific development
uSupports design, coding, testing, packaging, and
deployment

© 2007 Solution Beacon, LLC. All Rights Reserved.


37
© 2007 Solution Beacon, LLC. All Rights Reserved.
38
J2EE Application Deployment

uJ2EE applications are composed of a number of


components
l Classes, Servlets
l HTML, JSP, and images
l XML configuration files
uLogical groups of Classes become Jar files
uAll content is organized into a specific directory
structure
uResults are combined into a special Jar file

© 2007 Solution Beacon, LLC. All Rights Reserved.


39
Packed Contents

/
/META-INF application.xml
application.war the actual application!

© 2007 Solution Beacon, LLC. All Rights Reserved.


40
War File Contents

/
/META-INF
/css (custom) style sheets
/images (custom) static images
/html (custom) static HTML pages
/WEB-INF web.xml, struts.xml
/WEB-INF/classes individual Class files
/WEB-INF/lib Jar files of Classes

© 2007 Solution Beacon, LLC. All Rights Reserved.


41
The Future

uDriven by industry standards


l Release of the Java EE 5 spec drives the use of EJB
l J2EE is driving towards web services and SOA
uFusion makes the move to a SOA based
environment
l Same Java syntax, new programming models
l Event driven processing
l Focus on business modeling and processes
l Distributed applications communicating via Enterprise
Service Bus and Web Services

© 2007 Solution Beacon, LLC. All Rights Reserved.


42
Past Environment
uComponents used in OAF

© 2007 Solution Beacon, LLC. All Rights Reserved.


43
Present Environment
uComponents used in ADF

© 2007 Solution Beacon, LLC. All Rights Reserved.


44
Future State
uComponents needed for SOA and web services

© 2007 Solution Beacon, LLC. All Rights Reserved.


45
J2EE in the Architecture

© 2007 Solution Beacon, LLC. All Rights Reserved.


46
Questions and Answers

Thankyou!
<Presenter(s)Name(s)>
email
@ soluti
onbeacon.com

www.
sol
uti
onbeacon.
com

RealSol
uti
onsfortheRealWorl
d.â

Vi
sitOurBooth #339
to Regi
sterfora
W orld Class
W eekend Tri p!

© 2007 Solution Beacon, LLC. All Rights Reserved.


47
GotOracle?
Getthe Book!
Instal
li
ng,Upgradi ng and
Mai ntai
ning
Oracle E-Busi
nessSui te
Appli
cations11.5.10+

It’
savailablein the OUAG
Bookstore oronline!

Sign up forthe
Sol
uti
on Beacon Newsl etter
www. sol
utionbeacon.com

Release 11i Workshops


Dallas, TX • Santa Clara, CA
Cincinnati, OH • Denver, CO • Atlanta, GA
Detroit, MI • Las Vegas, NV
www.solutionbeacon.com

You might also like