J2EE Architecture

J2EE applications are structured according to a multiple tier distributed component model. This means that application code can exist on multiple tiers and will have specific functions based on its location. Each tier of the model is used to support a specific component type. Within each tier different types of Java code are written, such as Java Server Pages (JSPs), Servlets, or Enterprise JavaBeans (EJBs). By following the guidelines of placing the right code using the right technology at the most appropriate location, you're able to improve code development, deployment, and performance. In Figure 9-1 you can see the four tiers of J2EE.

image from book
Figure 9-1: J2EE component architecture

In the previous figure, you can see that J2EE applications can have Java code that exists in three physical locations: client machine, J2EE server, and the database server. However, the J2EE model defines this as four tiers, with the J2EE server representing two tiers. They are

  • Client tier. The client machine, typically a PC running a web browser. However, it can be a Java EJB application making remote calls to EJB components on the business tier. This is covered in greater detail in Chapter 14.

  • Web tier. The web tier executes on the J2EE server, but provides presentation logic for the client tier. This is where and how data is processed and massaged before being displayed to the client. The Java code that provides this presentation functionality contains JSPs, Servlets, and applets. This is covered in greater detail in Chapter 10.

  • Business tier. Intensive processing of business logic occurs on the business tier. This processing is often called by other components, sometimes remotely. It's not concerned with the presentation of data; rather it's the processing of business logic. The Java code specifically designated for this type of work contains EJBs and Business Components for Java (BC4J). It should be noted that business logic is sometimes implemented in Servlets. The business tier is covered in Chapter 11.

  • Enterprise Information System (EIS) tier. The EIS is most commonly a database, often an Oracle database, when dealing with OC4J and 10g AS. However, it can be a file-based data source or an enterprise messaging system. Connecting to the database tier is covered in Chapter 5.

Not every application will actively use components for each tier. For example, an application may contain JSPs, Servlets, and access to a database via JDBC, but not use EJBs. However, the J2EE framework specifies writing Java application code with the function identified based on the previous model. Just as with any guideline, you can bend the rules and you can move business logic into the presentation tier, but that's not how the presentation was intended to work.

Note 

When administering the full size 10g AS application server, the web and business tiers are the primary focus. 10g AS is a web application server because it supports both the web listener component (via Oracle HTTP Server or OHS) and the J2EE application server component (via OC4J). It's common to refer to tiers within the 10g AS context as being client, middle or mid tier, meaning web application server, and database server. This three-tier definition is slightly different than the pure J2EE four-tier definition. Details about 10g AS architecture are in Chapter 15.



Oracle Application Server 10g. J2EE Deployment and Administration
Oracle Application Server 10g: J2EE Deployment and Administration
ISBN: 1590592352
EAN: 2147483647
Year: 2004
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net