Skip Headers
Oracle® Application Server TopLink Application Developer's Guide
10g Release 2 (10.1.2)
Part No. B15901-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Five Key Architectures

This section summarizes the five basic OracleAS TopLink architectures. These patterns are not mutually exclusive; instead, they are extensions of each other, based on the same core technology. This section introduces:

Entity Bean Versus Non-Entity Bean Architectures

Two of the architectures presented in this chapter (EJB Entity Beans Using BMP Architecture, and EJB Entity Beans Using CMP Architecture) use EJB entity beans. EJB entity bean architectures are slightly different from the other architectures, because the EJB entity bean interfaces hide OracleAS TopLink functionality completely from the client application developer.

You can use entity beans in almost any J2EE application. From an OracleAS TopLink perspective, how the application uses the entity beans is not important; how each entity bean is mapped and implemented is important to OracleAS TopLink.

Three-Tier Architecture

The three-tier application is a common architecture in which OracleAS TopLink resides within a Java server (either a J2EE server or a custom server). In this architecture, the server session provides clients with shared access to JDBC connections and a shared object cache. Because it resides on a single JVM, this architecture is simple and easily scalable. The OracleAS TopLink persistent entities in this architecture are usually Java objects.

This architecture often supports Web-based applications in which the client application is a Web client, a Java client, or a server component.

Figure 2-1 Three-Tier Architecture

Description of 3tierov.gif follows
Description of the illustration 3tierov.gif

Not all three-tier applications are Web-based; however, the three-tier application is ideally suited to distributed Web applications. In addition, although it is also common to use EJBs in a Web application, this OracleAS TopLink architecture does not do so.

For more information, see "Three-Tier Architecture Features".

EJB Session Bean Facade Architecture

This architecture is an extension of the three-tier pattern, with the addition of EJB Session Beans wrapping the access to the application tier. The EJB Session Beans provide public API access to application operations, enabling you to separate the presentation tier from the application tier. The architecture also enables you to leverage the EJB session beans within a J2EE container.

This type of architecture usually includes JTA integration, and serialization of data to the client.

Figure 2-2 Three-Tier Architecture Using Session Beans and Java Objects

Description of sessbnov.gif follows
Description of the illustration sessbnov.gif

For more information, see "EJB Session Bean Facade Architecture Features".

EJB Entity Beans Using CMP Architecture

OracleAS TopLink enables you to leverage EJB entity beans within a J2EE application, using OracleAS TopLink CMP support. This support, which enables OracleAS TopLink to participate in container-managed transactions, requires a tight integration between the J2EE container and the persistence manager.

This architecture is an extension of the three-tier architecture, in which a J2EE container manages OracleAS TopLink mapping, querying, and other calls automatically.

Figure 2-3 Three-Tier CMP Architecture

Description of entcmpov.gif follows
Description of the illustration entcmpov.gif

For more information, see "EJB Entity Beans with CMP Architecture Features".

EJB Entity Beans Using BMP Architecture

OracleAS TopLink BMP support enables you to use EJB Entity beans on all application servers that comply with J2EE. This architecture is an extension of the three-tier architecture, in which the persistent data is bean-managed within an entity bean. The client code accesses the data through the entity bean interface.

The BMP architecture enables you to leverage a J2EE application server. The resulting application is portable—not tied to a particular J2EE application server. However, the BMP architecture is not common because:

  • It offers functionality similar to a CMP solution, but BMP is not as transparent or efficient as CMP.

  • OracleAS TopLink-only Java Object applications offer the same degree of independence from the application server.

  • You must create the persistence mechanisms in the bean code.

Figure 2-4 Three-Tier BMP Architecture

Description of entbnov.gif follows
Description of the illustration entbnov.gif

For more information, see "EJB Entity Beans with BMP Architecture Features".

Two-Tier

A two-tier application usually includes a Java client that connects directly to the database through OracleAS TopLink. The two-tier architecture is most common in complex user interfaces with limited deployment. The database session provides OracleAS TopLink support for two-tier applications.

For more information, see "Database Session" .

Figure 2-5 Two-Tier Architecture

Description of dsessov.gif follows
Description of the illustration dsessov.gif

Although the two-tier architecture is the simplest OracleAS TopLink application pattern, it is also the most restrictive, because each client application requires its own session. As a result, two-tier applications do not scale as easily as other architectures.

For more information, see "Two-Tier Architecture Features".