J2EE comprehensive profile

xiaoxiao2021-03-06  14

This paper has been more comprehensive in J2EE from five aspects. From the concept of J2EE, to its advantage, to the J2EE typical four-layer model, and its framework structure, the final is a profile for J2EE thirteen core technology. This document has made a more detailed introduction to the service, components, hierarchies, containers and APIs in J2EE. I believe that readers will have a clearer understanding of J2EE.

I. J2EE concept At present, the Java 2 platform has 3 versions, and they are applicable to small devices and smart cards, Java 2 platform, Java 2 Platform Micro Edition, Java 2, Java2 Platform Standard Edition for desktop systems (Java 2 Platform Standard Edition, J2SE, suitable for creating server applications and services, Java2 Platform EnterpriseEdition, J2EE). J2EE is an architecture using Java 2 platform to simplify the development, deployment, and management of business solutions. The basis of J2EE technology is the standard version of the core Java platform or Java2 platform. J2EE not only consolidates many of the advantages in the standard version, such as "writing once, run everywhere", which is easy to access the JDBC API, CORBA technology, and can The security mode of the protection data in the Internet application, etc., and also provides comprehensive support for EJB (Enterprise JavaBeans, Java Server Pages), and XML technology. The ultimate goal is to be an architecture that enables enterprise developers to significantly shorten the market time. The J2EE architecture provides an intermediate-level integrated framework to meet the needs of applications that do not require too much cost and require high availability, high reliability, and scalability. By providing a unified development platform, J2EE reduces the cost and complexity of developing multi-layer applications, while providing strong support for existing applications, fully supporting Enterprise JavaBeans, with good guidance support packaging and deployment applications, add directory support , Enhance the safety mechanism and improve performance.

II. J2EE's advantage J2EE provides a good mechanism for building a commercial system with scalability, flexibility, and easy maintenance:

Retaining existing IT assets: Since companies must adapt to new business needs, using existing corporate information systems investments, rather than re-establishing a total plan is important. Thus, a server-side platform mechanism established on an existing system in a progressive (rather than radical, all) is the company's needs. The J2EE architecture makes full use of the original investment, such as the BEA Tuxedo, IBM CICS, IBM Encina, Inprise Visibroker, and Netscape Application Server used by some companies. This has become possible because J2EE has a wide range of industry support and some important 'enterprise calculation' domain suppliers' participation. Every vendor provides an existing customer's upgrade route for existing investments and enters the portable J2EE field. Since products based on J2EE platforms can almost operate on any operating system and hardware configuration, existing operating systems and hardware can be reserved.

Efficient development: J2EE allows companies to hand over some general, cumbersome server tasks to middleware suppliers. This developers can concentrate on how to create business logic, reduce development time accordingly. Advanced Middleware Suppliers offer the following complex middleware services: Status Management Services - Let developers write less code, do not care about how to manage status, this can be done faster. Continuous Services - Let developers can write applications without encoding data access logic, can generate more lightweight, unrelated to the database, which is easier to develop and maintain. Distributed Shared Data Objects Cache Services - Make developers to prepare high-performance systems, greatly improve overall deployment of scalability. Support heterogeneous environments: J2EE can develop portable procedures deployed in heterogeneous environments. J2EE-based applications do not rely on any particular operating system, middleware, hardware. Therefore, a reasonable J2EE-based program is designed to be deployed to a variety of platforms. This is critical in a typical heterogeneous enterprise computing environment. The J2EE standard also allows customers to order off-the-shelf components compatible with J2EE, deploy them into the heterogeneous environment, saving the costs required by themselves.

Scalability: Enterprises must choose a server-side platform that provides excellent scalability to meet a large number of new customers who make business operations on their system. Applications based on J2EE platforms can be deployed on a variety of operating systems. For example, it can be deployed to high-end UNIX and mainframe systems, which can support 64 to 256 processors. (This is the supplier of the NT server) J2EE field provides a wider load balancing strategy. Can eliminate bottlenecks in the system to allow multiple servers integrated deployment. This deployment can reach thousands of processors, achieving highly scalable systems to meet future business applications.

Stable availability: A server-side platform must be able to operate all-day to meet the needs of company customers, partners. Because Internet is global, there is everywhere, even if it is downtown at night, it may cause serious loss. If it is unexpected, there will be catastrophic consequences. J2EE deploys to a reliable operating environment that they support long-term availability. Some J2EE deployed in a Windows environment, customers can also choose a robust performance, such as Sun Solaris, IBM OS / 390. The most robust operating system can reach 99.999% availability or only 5 minutes a year. This is an ideal choice for real-time business systems.

III. J2EE's four-layer model J2EE uses multi-layered distributed application models, application logic is divided into components, and each application component is distributed in different machines based on their layers. In fact, the original intention of Sun Design J2EE is to solve the drawback of two layers (Client / Server), in traditional mode, the client acts as a large role and looks bloated, in this mode, the first deployment It is relatively easy, but it is difficult to upgrade or improve, stretchability is not ideal, and often based on some proprietary protocol - usually a database protocol. It makes it difficult to reuse business logic and interface logic. Now J2EE's multi-layer enterprise application model cuts different levels in the two-layer model into many layers. A multi-layer application can provide a separate layer for each of the services, the following is a Typical four-layer structure of J2EE: the client layer component running on the client machine is running on the J2EE server WEB component running in J2EE server The Enterprise Information System (Enterprise Information System) layer software J2EE application component J2EE application is composed of components. J2ee component is a software unit with independent features, which are related to software units. And file assembled into J2EE applications and interact with other components.

The following J2EE components are defined in the J2EE manual: Applications client programs and Applets are customer layer components. Java servlet and javaServer Pages (JSP) are Web layer components .Enterprise JavaBeans (EJB) is a business layer component. Customer layer component J2EE application It can be based on a web-based, or may be based on a traditional way .Web layer component J2EE Web layer component can be a JSP page or servlets. Follow the J2EE specification, static HTML pages and Applets are not a web layer component. As the client layer shown below, the web layer may contain some JavaBean objects to handle user input, and send input to Enterprise Beans running on the business layer. The logic of the business layer component business layer code is used to meet the needs of special business sectors such as banks, retail, and finance. The following image shows how an Enterprise bean receives data from the client program. For processing (if necessary), and send it to the EIS layer, this process can also be reverse. There are three enterprise-class beans: Session Beans, entity (Entity) Beans, and messaging-driven) Beans. Session beans represent temporary interactions with client programs. When the client program is executed, the session bean And related data will disappear. In contrast, entity bean represents a permanent record in the table of the database. When the client program is aborted or the server is closed, there will be potential service to ensure that the entity bean's data is saved. Message driver bean combines The characteristics of the message listener of the session bean and JMS allow a business layer component to receive JMS messages asynchronously. Enterprise information system level enterprise information system layer processing enterprise information system software includes enterprise infrastructure, such as enterprise resource plan (ERP), mainframe Processing, database system, and other legacy information systems. For example, the J2EE application component may access the enterprise information system four. J2EE's structure of the J2EE, the J2EE structure with platform-independent makes the J2EE program is very simple. Because the business logic is encapsulated into a reused component, and the J2EE server provides background service in the form of a container. Because you don't have to develop this service yourself, you can concentrate on solve your hand's business problem.

The container and service container settings are customized for the J2EE server, including security, transaction management, Java Naming and Directory Interface Addressing, Remote Connections, etc. The most important services are listed below: J2EE Security ( The security) model allows you to configure web components or Enterprise Beans, so that only authorized users can access system resources. Each customer belongs to a special role, while each role only allows an activation of a particular method. You should declare roles and activation methods in the Arrangement description of Enterprise Beans. Due to this declarative approach, you don't have to write rules that strengthen security. J2EE Transaction Management Model allows you to specify a relationship between all methods in a transaction, such a transaction is used as a single unit. When the client activates the method in an Enterprise Bean, the container is involved in one management Transaction. Due to container management transactions, you don't have to encode the boundaries of your transaction in Enterprise Beans. The code that requires controlling distributed transactions will be very complicated. You only need to declare the transaction attribute of Enterprise Bean in the arrangement description file without writing and debugging complex code. The container will read this file and handle this Enterprise Bean's transaction. JNDI Addressing provides a unified interface to multiple names and directory services within the enterprise, so application components can access names and directory services. J2ee Remote Connections (Remote Client Connectivity) model management client and Enterprise Bean Low-level interaction. When an Enterprise bean is created, a client can call it. It is like it and the client is on the same virtual machine. Life cycle management model manages Enterprise Bean creation and removal An Enterprise Bean will have several states in its survival cycle. The container creates Enterprise Beans and moves him in the available instance pool and the active state, and eventually removes it from the container. Even if you can call Enterprise Bean's Create and REMOVE methods, the container will also perform these tasks in the background. Database Connection Pooling model is a valuable resource. Getting a database connection is a time consuming, and the number of connections is very limited. The container is alleviated by managing the connection pool. Enterprise Beans can quickly get connected from the pool. The connection is used for other beans in the bean release. ]

Container Type J2EE Applications You can install deployment to the following containers: EJB containers Manage all J2EE applications in the J2EE application. Enterprise bean and their containers are running on the J2EE server. WEB container manages all J2EE applications The execution of the JSP page and the servlet component. Web components and their containers are running on the J2EE server. Applications client containers Manage all J2EE applications execution. Applications clients and their containers run in J2EE On the server .Applet container is a combination of web browsers and Java plugins running on the client machine. 5. J2EE's core API and component J2EE platform consists of a set of services, applications interface (APIs), and protocols. It provides functional support for the development of web-based multi-layer applications. The following is a simple description of 13 technical specifications in J2EE (limited to space, here you can only perform simple descriptions): JDBC API To access different databases, it provides a unified way. Like ODBC, JDBC blocks some detail issues to developers. In addition, JDCB access to the database has a platform-independent. JNDI (Java Name and Directory Interface): JNDI API is used to perform names and directory services. It provides a consistent model to access and operate enterprise resources such as DNS and LDAP, local file systems, or objects in the application server.

EJB (Enterprise Javabean): J2EE technology Wins one of the reasons why some extensive attention is EJB. They provide a framework to develop and implement distributed business logic, which significantly simplifies the development of enterprise applications with scalability and highly complex. The EJB specification defines how EJB components interact with their containers. The container is responsible for providing public services, such as directory services, transaction management, security, resource buffer pools, and fault tolerance. But here is worth noting that EJB is not the only way to implement J2EE. It is because of the openness of J2EE, so that some vendors can achieve the same purpose in a way and EJB. RMI (Remote Method Invoke): As indicated by its name, the RMI protocol calls the remote object method. It uses a serialized manner to pass data on the client and server. RMI is a more underlying protocol used by EJB. Java IDL / CORBA: With the support of Java IDL, developers can integrate Java and Corba. They can create Java objects and make it expanded in Corba ORB, or they can also create Java classes and customers who are expanded with other ORBs. The latter approach provides another way, through which Java can be used to integrate your new application and old system. JSP (Java Server Pages): The JSP page consists of HTML code and embedded Java code. The server is processed after the page is requested by the client, and then returns the generated 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, starting when the request is performed, which is similar to the CGI Perl script. Most of the functionality provided by servlet is similar to JSP, but the implementation is different. JSP is usually embedded in a small amount of Java code in most HTML code, while servlets are written by Java and generate HTML. XML (Extensible Markup Language): XML is a language that can be used to define other tag language. It is used to share data in different business processes. The development of XML and Java are independent of each other, but it is the same objective as Java 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 a message-oriented middleware. It supports the domain of point-to-point, with domains that support publish / subscribe / subside types, and provide support for the following types: approved messaging, transaction messages, consistent messages, and subscriptions with persistence Support. JMS also provides another way to integrate your application with the old background system. JTA (Java Transaction Architecture): JTA defines a standard API, which can be accessed by various transaction monitoring. JTS (Java Transaction Service): JTS is the basic implementation of CORBA OTS transaction monitoring. JTS specifies the implementation of the transaction manager. This transaction manager is a Java Transaction API (JTA) specification in the high-level, and implements the Java image of OMG OTS Specification at a lower layer. JTS Transaction Manager provides transactional services for application servers, resource manager, independent app, and communication resource manager. JavaMail: JavaMail is an API for accessing a mail server, which provides an abstract class of a mail server. Not only supports SMTP servers, but also supports IMAP servers. JTA (JavaBeans Activation Framework): JavaMail uses JAF to handle MIME encoded mail attachments. MIME's byte stream can be converted into a Java object, or

Reference: "Develop n-tier application using J2EE" - Steven Gould "The Business Benefits of EJB and J2EE Technologies over COM and Windows DNA" "The J2EE Tutorial" chapter overview - Monica Pawlan herein Image by "The J2EE Tutorial" in English picture modification

J2EE beginners need to understand questions 1. J2EE proposed background 1, the needs of enterprise application frameworks are in many enterprise applications, such as database connections, mail services, transaction, etc. are some universal business demand modules, if each module is If the development personnel are completed by developers, it will result in problems such as long and code reliability of development cycle and code. So many big companies have developed their universal module services. These servic software series are intermediate. 2, in order to make specifications, it is necessary to make a norm, otherwise it is not possible to achieve the above demand, many companies have developed their own middleware, but they have different communication with users, causing users to unable to different companies. The middleware is assembled in a piece for yourself. Thereby generating bottlenecks. So the concept of standard. In fact, J2EE is a series of standards based on Java technology. Note: Intermediates interpret the middleware between operating systems and higher first-class applications. The function of him is: isolating the app runs the environment with the operating system, so that application developers do not have to worry about more system issues, but directly pay attention to the ability to solve the problem. The concept of the container that we will say later is one of the middleware. Second, the related noun interpretation container: act as a role of the middleware WEB container: Provides an environment in which the application component (JSP, servlet) is provided, allowing the JSP, Servlet to interact in the environment variable interface in the container, do not have to pay attention to other system problems . There is mainly a web server to achieve. For example: Tomcat, WebLogic, WebSphere, etc. The interface provided by the container strictly abides by the Web Application standard in the J2EE specification. We call the Web Server of the above standards called the web container in J2EE. EJB container: Enterprise Java Bean container. More industry segments. He provides various management functions that run the component EJB. As long as the EJB that satisfies the J2EE specification is placed in this container, it will be managed by the container. And you can obtain system level services through ready-made interfaces. For example, email services, transaction management. The web container and EJB containers are generally the same, and more differences are isolated on the outside environment. Web containers are more in harmony with HTTP-based requests. The EJB container is not. It is more with databases, other services. But they are all interactive interactions with the outside to mitigate the burden on the application. For example, servlet does not have to care about the details of HTTP, directly reference the environment variable session, request, response, EJB does not have to care about database connection speed, various transaction control, and is done directly from the container. RMI / IIOP: Remote Method Calling / Internet Object Request a Intermediary Agreement, which is primarily used for remote call services. For example, remotely running a program, which provides stock analysis services, we can implement them directly on your local computer. Of course, this is to communicate between heterogeneous systems through a certain specification. RMI is unique to Java. JNDI: Java Name Directory Service. The main functionality is: Provide a directory system that allows applications from all over its own index to meet the functionality of fast finding and positioning distributed applications. JMS: Java Message Service. It mainly implements communication between the various applications. Includes point-to-point and broadcast. JavaMail: Java Mail Service. Provides mail storage, transfer features. He is the core of implementing mail function in Java programming. The Exchange development package in MS. JTA: Java transaction service. Provide a variety of distributed transaction services. The application only needs to call the interface provided. JAF: Java Security Authentication Framework. Provide some security control frames. Let developers implement their own personal safety control strategies through a variety of deployment and customization. EAI: Enterprise Application Integration. It is a concept that involves a lot of technology. J2EE technology is a good integration implementation. Third, J2EE's superiority 1, based on Java technology, platform-independent performance highlights 2, open standards, many large companies have implemented application servers supported by this specification. Such as BEA, IBM, Oracle, etc.

转载请注明原文地址:https://www.9cbs.com/read-48853.html

New Post(0)