Information Technology Reference
In-Depth Information
to display to the user. In this manner, the controller can be perceived as a
specialized view that can display dynamic views.
According to the MVC model, the controller is typically performed by the
controller Servlet. This Servlet takes the request from the user and invokes
the appropriate model component(s). Once the request has been processed,
the controller Servlet selects the appropriate HTML or JSP to display to the
user. As mentioned earlier, JSP is translated into Servlet when it is run; JSP
and Servlet usually work together. Therefore, the controller Servlet does not
render the view per se; it sends the request to one or more objects to render
the view to the user. As per the MVC model, EJB is an ideal candidate to
serve that role.
Thus, in a typical flow, a request could be generated by the user from the
Web browser. The controller Servlet takes the request and invokes the appro-
priate EJB component interface. When the result of the EJB component call
has been received, the controller Servlet assembles the view to display to the
user; the view is then rendered by JSP.
3.2.2.3.1 How RMI Works
Effectively, RMI uses Java language extensions to extend the Java Virtual
Machine (JVM) address space so that it appears to include other virtual
machines independent of where they might actually be hosted. RMI is
effectively a JVM-to-JVM communication protocol allowing objects to be
passed . Unlike IDL-based distributed models, RMI requires no mapping to
common interface definition languages (IDLs). The syntax of RMI is such
that it appears almost identical to that used for local invocations. Because
the interobject communication relies on the JVM executable, objects can
be distributed dynamically, thereby removing the requirement to provide
installation on the client prior to implementation. This, of course, greatly
eases the burden of distribution and maintenance. In addition, RMI ben-
efits from the built-in security features of the JVM, thereby guaranteeing a
secure distributed object environment.
JavaBean is effectively a technique and an instantiation of a soft-
ware component model for Java. The JavaBean technique relies
on the serialization of an object provided by the JVM and lan-
guage constructs. Serialization allows the state of an object (and
any objects it refers to) to be written to an output stream. Later, the
serialized object can be recreated by reading from an input stream.
This technique is used to transfer objects between a client and a server
for RMI. Many Beans are provided not as class files but rather as preini-
tialized, serialized objects. JavaBean was designed for visual manipu-
lation in a builder tool, much like an ActiveX component. JavaBeans are
not an architecture for distributed computing but rather a technique
 
Search WWH ::




Custom Search