developer.com
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See the Winners!


Developer Jobs

Be a Commerce Partner
Prepaid Phone Card
Laptops
Imprinted Gifts
Best Price
Baby Photo Contest
Computer Deals
Imprinted Promotions
Auto Insurance Quote
Corporate Awards
Promotional Products
Compare Prices
Build a Server Rack
Dental Insurance
Promos and Premiums

 

Click Here
Download these IBM resources today!
e-Kit: IBM Rational Systems Development Solution
With systems teams under so much pressure to develop products faster, reduce production costs, and react to changing business needs quickly, communication and collaboration seem to get lost. Now, theres a way to improve product quality and communication.

Webcast: Asset Reuse Strategies for Success--Innovate Don't Duplicate!
Searching for, identifying, updating, using and deploying software assets can be a difficult challenge.

eKit: Rational Build Forge Express
Access valuable resources to help you increase staff productivity, compress development cycles and deliver better software, fast.

Download: IBM Data Studio v1.1
Effectively design, develop, deploy and manage your data, databases, and database applications throughout the data management life.

eKit: Rational Asset Manager
Learn how to do more with your reusable assets, learn how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse.
Developer News -
SaaS Tool Offers Custom Database Development    May 9, 2008
Microsoft’s Automated Agent: Can We Talk?    May 7, 2008
Borland Finally Sells CodeGear    May 7, 2008
Red Hat Heads For The JON 2.0    May 7, 2008
Free Tech Newsletter -

Project Management Guide: Developing a Web Site. Best Practices, Tips and Strategies. Download Exclusive eBook Now.

Rapid J2EE Development with Oracle ADF
By Michael Klaene

Go to page: 1  2  3  Next  

In a push toward simplified J2EE, vendors have been unveiling rapid application development (RAD) tools at a furious pace. Today, for example, most integrated development environments (IDEs) provide wizards to generate the mundane and repetitive framework code necessary when building Model-View-Controller (MVC) applications. A good framework provides an easy, consistent (and preferably declarative) way to configure application components together. That framework should also enforce a 'clean seperation of concerns' that will enable you to switch the implementation for an individual layer without affecting the rest of the application. The Oracle Application Development Framework (ADF) is based upon J2EE design patterns, features from other proven frameworks such as Struts, and concepts borrowed from its own previous framework, Business Components for Java (BC4J). The goal of ADF is to conceal the complexities of J2EE, enabling developers to focus on business logic.

This article demonstrates how the ADF framework can be utilized to design a Web-based application. You will use the JDeveloper 10g IDE from Oracle. You can download a free version of it here. I'm also using the popular, open-source MySQL database that can be downloaded here. If you prefer to use Oracle's own database, the adjustments that you will need to make should be trivial.

Overview of ADF

In an effort to keep things simple, I want to avoid a detailed discussion of ADF. There are a number of existing demos and articles at the JDeveloper site. However, a high-level explanation of ADF components, and how they fit into the MVC architecture, is in order.

Model

Entities

An ADF Entity object represents a business entity. This usually translates to a row of data in a table, and each Entity attribute represents a column in that table.

In ADF, an Entity handles other tasks, such as business validation and format masking. In most cases, the model is the most logical place to address these concerns because it will enable maximum reuse. Validations, predicated by business requirements, are likely to be relevant no matter how the model is used. For example, verifying that an employee is always assigned to one and only one department will not change if the application were converted from a Web application to a Swing application. ADF will propagate these validations and formats to the controller and view, alleviating the need for you to address these issues elsewhere.

Views

An ADF View object exposes an Entity object to users of the application. An Entity may be accessed in numerous places, but the context in which it is used will vary. Filtering, sorting, and object relationships can be established by a view object, ensuring that the model is represented in a way that makes the most sense.

Application Module

The ADF Application Module bundles together View components, while providing access to your business services layer, which might use technologies such as EJB to manage your database. The Application Module provides ADF Views with transaction support, and other important data-centric services.

View and Controller

Nothing in your model should dictate a particular view technology. An Application Module can serve as the foundation for a Swing or Struts Web application. If developing a thick client application, Swing components might communicate directly with the application module. When developing a Web-based application, your application will use a clearly defined controller to manage model-view interaction.

Controller

In previous releases, ADF provided its own controller. That controller has since been replaced in favor of Struts. Struts uses an XML file, called struts-config.xml, to handle application requests and dispatch them to designated request handlers. Experienced Struts developers will appreciate the ability to leverage this existing knowledge.

View

JDeveloper makes it easy to visually design pages using JSP and JSTL. ADF also provides its own view framework, called UIX, that offers a set of HTML widgets for generating quick and consistent-looking view pages. You will be using UIX in this demonstration. UIX components will become the foundation for Oracle's JSF (JavaServer Faces) standard implementation in future releases.

Building a Sample Application

The application you will build allows employees to reserve conference rooms for work-related meetings. As I mentioned earlier, a MySQL database is used to create two tables, conference_rooms and room_reservations. The DDL to create these tables is listed below.

DROP TABLE IF EXISTS conference_rooms;

CREATE TABLE conference_rooms
(
   room_id           INTEGER NOT NULL AUTO_INCREMENT,
   room_name         VARCHAR(32),
   number_of_seats   INTEGER,
PRIMARY KEY (room_id)
);

DROP TABLE IF EXISTS room_reservations;

CREATE TABLE room_reservations
(
   reservation_id    INTEGER NOT NULL AUTO_INCREMENT,
   room_id           INTEGER NOT NULL,
   reservation_start DATETIME,
   reservation_end   DATETIME,
   reservation_team  VARCHAR(50),
PRIMARY KEY (reservation_id)
);

Start JDeveloper if you have not already done so. On the left, you will see the Applications-Navigator. Click the Connections tab to establish a connection to your MySQL database. Before doing this, however, it is necessary to make the MySQL JDBC driver available to JDeveloper and the embedded OC4J server you will use to run the application. You can do this by dropping the driver .jar file into the j2ee\home\applib directory of your JDeveloper home (ex. C:\jdev\j2ee\home\applib). Once complete, perform the following steps in the Applications-Navigator:

  • Select Database. Right-click, and choose New Database Connection... Click Next.
  • Enter 'MySQL' for Connection Name and select 'Third Party JDBC Driver' for Connection Type. Click Next.
  • The authentication page appears. Enter the username and password for your MySQL database. Check the Deploy Password checkbox, and then click Next.
  • Next, select the Driver Class 'com.mysql.jdbc.Driver' and enter a URL of 'jdbc:mysql://localhost/{database name}'. Click Next.
  • Click the Test Connection button. If connected, you will see 'Success'. Click Finish.

Go to page: 1  2  3  Next  


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Database Archives

Work With InterSystems. Not Separate Systems. Rapidly develop and deploy connectable applications.
Learn about expanding business opportunities for the reseller channel. Visit IT Channel Planet.
Whitepaper: Embeddable Content Platform for OEM's
Five Trends for Application Development & Program Management. Download Complimentary Report Now.
Data Sheet: IBM Information Server Blade



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES