This article outlines Enterprise JavaBeans (EJB) technology designed to give readers a quick understanding of basic concepts. The 1th part describes the history and some goals, benefits and techniques of EJB technology. For simplicity and clarity, there are some key elements of the EJB technology that are selectively described. Note that while EJB components rely on some basic Java services (such as the Java Transaction Service), using EJB components and understanding the benefits of these components does not require knowledge of these relevant technologies.
Enterprise JavaBeans Technology has been well received since its inception in March 1998. The following passage is an example:
"Since the advent of more than two years ago, Enterprise Javabeanstm Technology has also maintained unprecedented momentum in the development teams of platform suppliers and enterprises." This is because the EJBTM server-side component model simplifies the development of middleware components that are transactional, scalable, and portable. The Enterprise JavaBeans server reduces the complexity of developing middleware by providing automatic support for middleware services such as transaction processing, security, database connectivity, and other. "(Sun Microsystems website)
Enterprise JavaBeans This name leverages the prestige of Java bean-, a portable, reusable Java software component. Enterprise JavaBeans Technology extends the concept of Java components from the client domain to the server domain: This is a significant step in the growth of Java technology, enabling Java technology to evolve into a robust, scalable environment that supports mission-critical enterprise information systems.
Java applications on the server
One reason the Java programming language was first praised by web developers is that it supports downloadable Java programs called applets. Support for applets is built into the 1.0 version of Java Development Kit (JDK) in the form of an applet class. In the 1.0 version of the time frame, Java development is centered on applets and applications. Java readings based on JDK version 1.0 are described in Java programming from the perspective of applets and applications:
"Java programs consist of more than one of the class definitions, each of which has been compiled into a. class file of its own Java virtual machine object code. One of these classes must define a method called Main (), which is how the program starts. To invoke a Java program, you need to run Java interpreter Java and specify the name of the class that contains the main () method. Note that the Java applet is not an application-it is a Java class that has been loaded and run by a Java application that is already running, such as a Web browser or applet viewer. "(see Flanagan Java in a nutshell)
Java applications can run on the server, but neither in the client-server environment nor in the web-based environment does the JDK provide interfaces or packages that allow Java applications to be dedicated to the server machine. Recognizing the potential of Java as a server language in a WEB environment, Sun Microsystems has written the Java Servlet specification. The servlet is similar to applets in many ways, and is designed for Java programs that run on a WEB server machine:
The servlet is a container-managed Web component that produces dynamic content. A servlet is a small, platform-independent Java class that is compiled into an architecture-neutral byte code that can be dynamically loaded onto a Web server and run by this Web server. The servlet interacts with a WEB client through a request-response model implemented by the Servlet container. This request-response model is based on Hypertext Transfer Protocol (HTTP) behavior. "(See JavaSoft" Java Servlet API Specification ")
It is not new to run several small user programs on multiple servers under the control of a Web server-a Common Gateway Interface (CGI) program (commonly known as a CGI script) has been playing this role for some time and has driven the popularity of the web. However, the Java servlet can achieve this with greater efficiency and portability, and is expected to eventually replace the CGI program. Software that provides a run-time environment for the servlet, often referred to as the servlet engine, can be added to an existing WEB server that does not natively support Java executables.
The advent of the Java Servlet opens up new avenues for application programmers to create WEB applications using Java. However, only a servlet can not provide a complete model for real enterprise computing. The CGI application itself is often not a complete application, and CGI is only an intermediate step in the entire process of processing a request for information received from a user on a Web browser. For example, a common use for CGI applications is to access the database. When used in this task, the CGI program provides a way to connect the user's data request to the enterprise database that satisfies the request. CGI programs often act as an intermediary software that receives requests from a Web browser, determines which computing resources must be invoked to satisfy those requests, and sends a response back to the browser. Like CGI programs, the Java servlet is best suited to serve as a middle-tier component that connects front-end WEB requests and back-end data resources.
Three-tier architecture
The evolution of WEB programming to server-side Java applications has also led to the evolution of the architecture, leaving it out of the conventional client-server two-tier model and developing to a three-tier approach. The two-tier model was once innovative because it unloaded some computing tasks from the master processor to the smart client. A typical lan-based database application is an example where the Database Manager server Software resides on a dedicated server machine, and the user accesses the database through client code on their workstation. As the client-server model grows to work, there is concern about server scalability and the size and complexity of client code. A three-tier architecture was proposed to avoid weaknesses perceived in the two-tier model, making the Web a computing platform:
"Many people ... Asserts that the traditional client/server two-tier architecture is not scalable because the number of user connections and data access is unpredictable, and there are problems with some system management. To handle the constraints of the two-tier architecture, many development groups are turning to a three-tier architecture. This architecture can be broadly defined as the presentation layer on the client layer, the intermediate server, and some kind of database at the back end. The idea is to ease code bloat on a client or database server, centralize business logic, and use the database more flexibly than using stored procedures and triggers. "(see Kim's" Looking for a 3-tier App Builder?) )
A three-tier structure model is often imagined as having a Web browser as a customer tier. The Web browser has the potential to become a true general-purpose client, which replaces the two-tier "fat client" concept. If the browser is recognized as a standard thin client of the WEB application architecture, what about the functionality of a FAT client that resides in a two-tier model? The application-specific functionality is now not ported back to the server (such as Database Manager), but is intended to reside on a new middle tier. The middle tier supports application Server software, a form of middleware that is located between the minimal functionality of thin clients on the first tier and the rich functionality of server-side business systems on the third tier. Because the three-tier architecture is closely related to the web processing model, a middle-tier application server is often considered a functional extension of a Web server. Existing Web applications that use CGI programs to transfer user requests from Web browsers to non-web-based business systems and return responses to browsers are an implementation of the three-tier model. The gradual transfer of these applications to the servlet technology demonstrates that the three-tier model is being enhanced.