What is the Java EE (ii)

Source: Internet
Author: User

 今天,我们接着上篇文章,继续介绍J2EE的架构,组件以及API等知识。
4. Four-layer model of the Java EE

The Java EE uses a multi-layered distributed application model, where the application logic is divided into components according to function, and each application component is distributed on different machines depending on the layer in which they reside. In fact, Sun's design of the Java EE was designed to address the drawbacks of the two-tier model (Client/server).
In traditional mode, the client becomes bloated with too many roles, in which the first deployment is easier, but difficult to upgrade or improve, the extensibility is not ideal, and often based on some proprietary protocol, usually some kind of database protocol.
It makes it very difficult to reuse business logic and interface logic. Now, the multi-tier enterprise application model of Java EE divides the different layers of the two-layered model into many tiers. A multi-tiered application can provide a separate layer for each service, and the following is a typical four-layer structure of the Java EE

    • Client tier components running on the client machine
    • Web tier components running on a Java EE server
    • Business Logic layer components running on the Java EE server
    • Enterprise Information System layer software running on the EIS server

5.J2EE Application Components

The Java EE application is composed of components. The Java EE component is a software unit with independent functionality that is assembled into a Java EE application through related classes and files and interacts with other components. The following Java EE components are defined in the Java EE specification:
Application client programs and applets are customer tier components.
Java servlet and JavaServer Pages (JSP) are web-tier components.
Enterprise JavaBeans (EJB) is a business layer component.

    • Customer tier components

The Java EE application can be web-based, or it can be based on a traditional approach.

    • Web Tier Components

The Java EE Web Layer component can be a JSP page or servlets. According to the Java EE specification, static HTML pages and applets are not considered web-tier components.
As shown in the client tier, the Web tier may contain some JavaBean objects to handle user input and send input to enterprise beans running on the business layer for processing.

    • Business Layer Components

      The logic of Business layer code is used to meet the needs of banking, retail, finance and other special business fields, which are handled by enterprise beans running on the business layer.
      Shows how an enterprise bean receives data from a client program, processes it (if necessary), and sends it to the EIS layer for storage, and the process can be reversed. There are three types of enterprise-class beans:
      Session beans, entities (entity) beans, and message-driven (message-driven) beans. The session bean represents a temporary interaction with the client program.
      When the client program finishes executing, the session bean and related data disappears. Instead, an entity bean represents a permanent record of a row in the database's table. When the client program aborts or the server shuts down, there is a potential service to ensure that the entity bean's data is saved.
      The message-driven bean combines the characteristics of the session bean and the JMS message listener, allowing a business-level component to receive the JMS message asynchronously.

    • Enterprise Information System Layer

Enterprise Information System layer processing enterprise Information System software includes enterprise infrastructure system such as enterprise resource Planning (ERP), mainframe transaction processing, database system, and other legacy information systems.
For example, the Java EE Application component may require access to the enterprise information system for database connectivity

6.J2EE's core API and components

The Java EE platform consists of a suite of services, application interfaces (APIs), and protocols that provide functional support for the development of Web-based multi-tier applications, with a simple description of the 13 technical specifications in the Java EE (Space-constrained, simple description only):

JDBC (Java Database Connectivity): The JDBC API provides a unified way to access different databases, like ODBC, where JDBC shields developers of details, and JDCB access to the database is platform agnostic.

Jndi (Java name and directory Interface): The Jndi API is used to perform name and directory services. It provides a consistent model for accessing and manipulating enterprise-class resources such as DNS and LDAP, local file systems, or application server objects.

EJB (Enterprise JavaBean): One of the reasons why the EE technology has won a body's attention is EJB. They provide a framework for developing and implementing distributed business logic, which significantly simplifies the development of scalable and highly complex enterprise-class applications. The EJB specification defines when EJB components interact with their containers. Containers are responsible for providing common services, such as directory services, transaction management, security, resource pooling, and fault tolerance. But it's worth noting that EJB is not the only way to implement Java EE. It is because of the openness of the Java EE that some vendors can achieve the same goal in a parallel way with EJBS.

RMI (Remote method Invoke): The RMI protocol invokes a method on a remote object, as its name indicates. It uses serialization to pass data on the client and server side. RMI is a lower-level protocol that is used by EJBS.

Java Idl/corba: With the support of Java IDL, developers can integrate Java with CORBA. They can create Java objects and make them expandable in the CORBA orb, or they can create Java classes and serve as clients for CORBA objects that are expanded with other orbs. The latter approach provides another way through which Java can be used to integrate your new application with the old system.

JSP (Java Server pages): JSP pages consist of HTML code and embedded Java code. The server processes the Java code after the page is requested by the client, and then returns the resulting HTML page to the client's browser.

Java Servlet:servlet is a small Java program that extends the functionality of the Web server. As a server-side application, it starts executing when requested, and is similar to CGI perl scripts. Servlets provide much more functionality than JSPs, but they are implemented in different ways. JSPs are usually embedded in a small amount of Java code in most HTML code, and Servlets are all written in Java and generate HTML.

XML (extensible Markup Language): XML is a language that can be used to define other markup languages. It is used to share data in different business processes. The development of XML and Java are independent of each other, but it and Java have the same goal is platform independence. By combining Java and XML, you can get a perfect platform-independent solution.

JMS (Java Message Service): MS is an application interface (API) for communicating with each other for message-oriented middleware. It supports both point-to-point domains, domains that support publish/subscribe (Publish/subscribe) types, and provides support for the following types of messages: Approved messaging, transactional message delivery, consistent messaging, and persistent subscriber support. JMS also provides another way to integrate your application with the old backend system.

JTA (Java Transaction Architecture): JTA defines a standard API that enables the application system to access various transaction monitoring.

JTS (Java Transaction Service): JTS is the basic implementation of CORBA OTS transaction monitoring. The JTS specifies how the transaction manager is implemented. The transaction manager is a Java image that supports the Java Transaction API (JTA) specification at the top level and implements the OMG OTS specification in the lower layer. The JTS transaction Manager provides transactional services for application servers, resource managers, stand-alone applications, and communication Explorer.

Javamail:javamail is an API for accessing mail servers, which provides an abstract class of mail servers. Supports not only SMTP servers, but also IMAP servers.

JTA (JavaBeans Activation Framework): JavaMail uses JAF to process MIME-encoded message attachments. The MIME byte stream can be converted to a Java object or converted from a Java object. Most applications do not need to use JAF directly.

7. Summary

Through this study, we know the overall architecture of the Java EE and some of the core components, more understanding of its scalability, flexibility and ease of maintenance, This will be a great help to our future study. Of course, after we have learned these basic concepts, the most important thing is to experience in the actual use, to summarize, and then return to see these things, we will have a great harvest. This is a learning process, refueling.

What is the Java EE (ii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.