Database Reference
In-Depth Information
11.2.3.2.4 Distributed Java Components
Java Naming and Directory Interface (JNDI) enables naming and distribution of Java compo-
nents within the reference architecture. JNDI can be used to store and retrieve any Java object.
However, JNDI is usually used to look up for component (home or remote) interfaces to enterprise
beans. The client uses JNDI to look up the corresponding EJB Home interface, which enables
creation, access, or removal of instances of Session and Entity Beans. In case of local Entity Bean,
a method invocation is proxied directly to the bean's implementation. While in case of remote
Entity Beans, the Home interface is used to obtain access to the remote interface to invoke the
exposed methods using Remote Method Invocation (RMI). The remote interface takes the local
method call, serializes the objects that will be passed as arguments, and invokes the corresponding
remote method on the distributed object. These serialized objects are converted back into normal
objects to invoke the method to return the resulting value upon which the process is reversed to
revert the value back to the remote interface client.
11.2.3.2.5 J2EE Access to the EIS Tier
J2EE provides a number of interfaces and APIs to access resources in the EIS tier. The use of Java
Database Connectivity (JDBC) API is encapsulated primarily in the data access layer or within
the CMP classes of the Entity Bean. Data sources that map to a database are defined in JDBC,
which can be looked up by a client searching for a resource using the JNDI. This enables the J2EE
application server to provide connection pooling to different data resources, which should appro-
priately be closed as soon as the task is over to prevent bottlenecks.
The various J2EE interfaces and APIs available are as follows:
Java Connector Architecture (JCA/JTS) provides a standard way to build adapters to access
existing enterprise applications.
JavaMail API provides a standard way to access mail server applications.
Java Message Service (JMS) provides a standard interface to enterprise messaging systems. JMS
enables reliable asynchronous communication with other distributed components. JMS is used
by Message-Driven Beans (MDB) to perform asynchronous or parallel processing of messages.
11.2.3.3 Model-View-Controller (MVC) Architecture
The Model 2 architecture is based on the model-view-controller (MVC) design pattern. A generic
MVC implementation is a vital element of the reference architecture as it provides a flexible and
reusable foundation for very rapid web-based application development.
The components of the MVC architecture are as follows:
View deals with the display on the screens presented to the user.
Controller deals with the flow and processing of user actions.
Model deals with the business logic.
MVC architecture modularizes and isolates screen logic, control logic, and business logic in order
to achieve greater flexibility and opportunity for reuse. A critical isolation point is between the
presentation objects and the application back-end objects that manage the business logic and data.
This enables the user interface to affect major changes on the display screens without impacting
the business logic and data components.
Search WWH ::




Custom Search