This action might not be possible to undo. Are you sure you want to continue?
By Shaun D. O·Brien, TUSC
JDeveloper 10g is an amazing development environment. With the Oracle Application Developer Framework (ADF), which includes TopLink, BC4J and Struts, you can quickly and easily develop a GUI/HTML-based Web application using this pointand-click, drag-and-drop development tool. This presentation will discuss:
² How ADF allows you to map a database object into an ADF Business Component ² ADF Business Component view objects ² ADF Business Component Application Modules ² The ADF Data Bindings and Control components ² The Struts Controller ² The Java Server Page
In one hour you'll learn how to quickly develop an application using JDeveloper 10g
Topics Covered - Agenda What is JDeveloper? What is ADF? What is Struts? Quick Web Development Tips and Tricks
What is JDeveloper 10g?
´Oracle JDeveloper 10g is a J2EE development environment with end-to-end support for modeling, developing, debugging, and deploying e-business applications and Web services. Oracle JDeveloper 10g allows developers to build J2EE applications and Web services either from scratch or by using a J2EE framework. Whatever implementation is chosen, JDeveloper offers all the productivity tools needed to get the job done.µ
New Features as of 10g
Application Development Framework (ADF)
² Faster Development ² Integrated MVC patterns
² New look and feel ² Code editor improvements ² Better modeling
New J2EE Features
² New wizards ² TopLink integration ² Web Service improvements
² Database modeling ² Editing DB objects
Wireless. and Rich Client interfaces.What is ADF? ´Oracle ADF is a comprehensive productivity layer for J2EE developers. and debug by hand.µ 6 . ADF accelerates development with ready-to-use J2EE Design Pattern implementations and metadatadriven components that you'd otherwise have to code. test. It simplifies building applications as a set of business services with Web.
ADF Technical Stack 7 .
JavaBeans. Struts encourages application architectures based on the Model 2 approach. as well as various Jakarta Commons packages. ResourceBundles. a variation of the classic Model-View-Controller (MVC) design paradigm.What is Struts? ´The core of the Struts framework is a flexible control layer based on standard technologies like Java Servlets.µ 8 . and XML.
Put Simply« Struts provides the controller component and default request dispatcher for your web application. it provides components that can be utilized by a struts enabled application to manage integration with data access and delivery to the presentation layer. 9 . In addition.
Quick Web Development From table to HTML with navigation in no time Full MVC / Struts implementation ² Model ² Business components ² View ² JSP ² Controller Struts 10 .
8 Steps to Success Create a ² 1 .Create a Page Flow ² View 7.New Workspace ² 2 .Model (Business Components) Diagram 3 .View Object 5 .Application Module ² Controller 6 .Create a JSP Page 8 .Persistent Business Object 4 .Run the Application 11 .
Create a New Workspace Step 1 Right click on Applications in Navigator Click on ´New Application Workspace«µ 12 .
Name the Workspace Name the workspace whatever you wish Use the default application template (Web application) Click OK Application workspace is then created 13 .
Model and ViewController 2 new projects are automatically created under the application ² Model ² ViewController 14 .
Create a Diagram of Business Components Step 2 Right click on Model Click New 15 .
New Business Components Diagram From the gallery. choose ² Business Components under Category ² Business Components Diagram Click OK 16 .
Name Your Diagram Name your Business Components Diagram as you wish You·re now finished setting up your environment It·s time to build your application 17 .
Create a Persistent Business Object Step 3 These are entity objects Implement the Data Access Object design pattern Responsible for persisting. caching and validating data Created by dragging a table object and dropping in the diagram 18 .
Connecting to the DB First you must be able to connect to the database In Navigator ² Select ´Connectionsµ at the bottom tab ² Right click on ´Databaseµ ² Select ´New Database Connectionµ 19 .
Database Connection Wizard 4 Steps ² Name the connection ² Specify a username and password to connect to ² Specify the connection parameters (i. the database and machine to connect to) ² Test the Connection 20 .e.
Drag and Drop the Table In the Navigator. drill into the new connection·s tables Drag and drop a table into the Business Components Diagram 21 .
Editing the Object You can edit the Persistent Business Object by doubleclicking it Edit. add or delete attributes Turn on batch updates Establish validation and authentication rules Publish and subscribe events This is a BC4J or EJB object that encapsulates all of the business rules for the object 22 .
Referential Integrity If you add objects that have referential integrity established. JDeveloper automatically picks up on these relationships 23 .
e. join tables) 24 .Create a View Object Step 4 This object gathers and filters the data stored in the entity object Uses a SQL Query to form a collection of data Can be comprised of multiple entity objects (i.
EmpView) Have an empty view (i. no entities to pull yet) 25 .e.e.Create the View Object In Business Components Diagram ² Click ´View Objectµ ² Click in Business Components to place ² Name the view (i.
all rows) Adding related tables will automatically create the join statement 26 .e. Emp and Dept) into the View Object (i. all columns.e.Place the Entity Objects Drag and drop the Entity Object(s) (i. EmpView) Creates a 1:1 mapping from the entity object by default (i.e.
query hints.Editing the View Object You can edit the view object Add additional entity objects into the view (or use the drag and drop) Add or remove attributes from the entities selected Edit the query (manually). add a where and/or order by clause Set fetch sizes. 27 . etc.
e.Create an Application Module Step 5 The Application Module is a service object that coordinates view objects for a specific task (i. a form to display the employee data) 28 .
e.e. no views to pull yet) Drag and drop the view (i. EmpView) into the Module 29 .e. EmpModule) Have an empty module (i.Building the Application Module In Business Components Diagram ² Click ´Application Moduleµ ² Click in Business Components to place ² Name the module (i.
Editing the Application Module You can edit the attributes of the application module by double-clicking it. Corba. just like the other objects These objects can be deployed as EJB. or Web Service objects 30 .
µ then ² ´Generate default Data Model Componentsµ Skips Steps 4 and 5!!! 31 .JDeveloper Wizard The ´Quickµ method / wizard can be used to create the View and Application objects Right-click on Entity Object ² Select ´Generate.
Business Services are Complete All of our business components have now been created ² Entity Object ² View Object ² Application Module It·s time to create the GUI application 32 .
Struts) separates the visual representation of web pages (view) from their flow and actions 33 .Diagram a Page Flow (Controller) Step 6 This is our ViewController section of the MVC The controller (i.e.
xml in the navigator Then click ´Page Forwardµ in the Component Palette Then click in the StrutsPageFlow window to place the Page Change the name from ´Page1µ (don·t remove the forward slash) 34 .Creating the Forward Action Double-click struts-config.
Designing the JSP Page ² View Step 7 Create JSP page that automatically binds to a Struts action 35 .
Creating the Page Double-click the Struts/forward action icon on the page flow diagram Name the Java Server Page (JSP) 36 .
e. Graph. Input Form. select the view object (i. etc.Dropping Business Components Utilizing the business service you created in the model. we·ll create the JSP In the ´Data Control Paletteµ. HTML table.e. Dynamic Table. Read-only form. EmpView) Select how you wish to drop the object into the page (i.) Drag and drop it onto the page 37 .
The Default JSP Page By dragging and dropping the EmpView object as an ´Input Formµ each column from the table(s) is displayed Note that no navigation buttons exist (only submit) by default 38 .
µ under the view and under ´Operationsµ you will find navigation operations.Adding Navigation In the ´Data Control Palette. These can be dragged and dropped onto the page 39 .
Running the Application Step 8 Back to the StrutsPageFlow diagram Notice that the DataAction element was added Right-click on the DataAction element and choose Run 40 .
The Application The form is complete and fully functional!!! ² Insert. query ² HTML-based Easy to deploy using the oneclick deployment How easy is that? 41 . delete. update.
Adding a List of Values Delete the DeptNo input field Find the DeptNo in the Data Control Palette Select Drop As List of Values Drop field in form 42 .
Associate LOV Need to Associate LOV to this field Will receive a strange BEAN error message if you don·t Select the UI model icon 43 .
Create the LOV Edit the UI Model·s DeptNo object Create the LOV ² Choose the LOV source (DeptView) ² Choose the Target (EmpView) Click Add Associate DeptNo to DeptNo for join 44 .
Display Attributes Choose your LOV display attributes Whatever fields you want to show in the LOV dropdown list 45 .
Try it Again More functionality exists now Also deleted EmpNo field and dropped as a value (rather than an input value) 46 .
Adding Additional Pages Is EASY! Add a new page forward to the struts-config diagram and name it. naming the forward with the event we wish to use. 47 . Link emp action to our new action with a forward link.
48 . This time lets create it as a read only table for simple display purposes.Create Page Follow the same steps as before to create the page dragging DeptView as our data object.
49 .Edit the Emp jsp Drag a submit button to the page from the component palette. Finally edit the buttons properties to set the name equal to the event we set in our strutsconfig diagram prefixing the event with ´event_µ (event_listall).
this time click on our new button and you will navigate to the newly created summary page! 50 .Try it out! Run the emp jsp again.
html Create a Workspace for each application Create a project for each piece of application Set up an independent Application Server Putting too much source in JSP is dangerous/bad Jdeveloper Log4J (Log for Java) ² Jakarta Project Error Messages not always clear.Tips and Tricks and Pitfalls http://otn. but they are getting better with each release 51 .oracle.com/prod ucts/jdev/howtos/content.
Conclusion Powerful product! Some great new features Enhancements to visual creating and editing Application Developer Framework is key Decreases development time Reduced learning curve TUSC·s Vision Passionate about the Technology Oracle Best in the World Economic engine 52 .
Questions and Answers 53 .
oracle.oracle.com technet.tusc.com jakarta.com metalink.oracle.apache.com otn.Where to Get More Information firstname.lastname@example.org JDeveloper Help ² Tutorials are great 54 .org www.
Please report errors to TUSC. TUSC © 2004. or the author warrant that this document is error-free. Brown for his guidance and head start on this presentation.Special Thanks To« Bradley D. 55 . Neither TUSC. This document may not be copied or reproduced without the express written consent of TUSC.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.