Discuss this tutorial. Printable version (PDF).
Go to Contents page. Go to previous page. Go up a level. Go to next page.

 

 

Concepts

For Java client development, JDeveloper provides JClient, a client framework for building Java applications and applets for business components. JClient uses the model-view-controller (MVC) design pattern to allow you to bind standard Swing controls or any third party model-based controls to BC4J data sources. This approach is multi-tiered and modular; the MVC design pattern identifies three entities, each operating in a different logical layer within the application space:

  • Model: A back-end representation of enterprise data and business logic, the model also maintains data about the state of the application. In many cases, the model is a logical representation of a real-world process.

  • View: The front-end presentation layer that renders the model for end-users. Views also provide user interfaces for accessing the enterprise data represented by the model.

  • Controller: The middle tier of the MVC pattern. The controller defines application behavior, selecting views for presentation and capturing a user's interactions with views and routing them as commands to the model.

The MVC design pattern defines a clear separation of application logic, presentation details, business rules and data. As a result, multiple clients, displays, and devices can use the same application and business rules to work with the same data. The following figure shows how model, view, and controller interact.

JClient provides model objects for Swing controls that are responsible for marshalling interaction between the Swing controls and the business component datasource's rowset iterator. The JClient implementation of Swing models are known as control bindings.

The UI components in the JClient application bind directly to view objects in the BC4J tier. For example, a JClient databound panel, might have a text field (JTextField) for the First name and Last name that allows the user to view and modify business component attribute values.

The type of control binding used for a given Swing control depends on the actions performed by the control. In some cases, controls work with multiple control bindings that define different interactions.

JClient also provides a number of composite controls, making it easy to design Java clients with richer functionality than the standard Swing controls provide. Using JClient's design-time wizards you can quickly generate data-aware forms, which you can then customize with JDeveloper's user interface design tools.

For example, a JCheckBox is a Swing component which has a defined Model, View, and Controller. When the user interacts with the controller by clicking the checkbox, the controller notifies the model that it should change its state (from false to true or the reverse). The view, which is listening for changes in the state of the model, can then update itself (for example, by making the checkbox appear selected). An important point about this architecture is that the model is not aware of the view or views displaying it, nor of the controller(s) being used to update it.

BC4J makes it easy to bind JSP, Java Swing, wireless, and other XML clients to business components. The tier-independent programming model ensures that the same application can be bound to different user interfaces without changing any code in the business logic tier. For JSP/Servlet applications, JDeveloper provides the BC4J Data Tag Library, a set of JSP 1.1 compliant tags for binding JSP pages to Business Components data sources. The BC4J data tags make it easy to design and build JSP database applications with complete control of both the HTML design and the database access operations.

When using the data tags, you don't have to write large amounts of Java code to interact with BC4J data or customize the user interface. The client JSP application can mostly be comprised of HTML and JSP tags, giving JSP you the flexibility to use your favorite visual HTML editors in conjunction with JDeveloper to design the exact appearance of your JSP application.


Discuss this tutorial. Printable version (PDF).
Go to Contents page. Go to previous page. Go up a level. Go to next page.
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy