EE system standard (Java EE5)

xiaoxiao2021-04-06  274

Recently, the Folks at sunh will rename J2EE 1.5 to Java EE 5. Of course, the J2EE version is still called J2EE, the reason is to let everyone know that J2EE is just a Java corporate application, use my words. J2EE is the application of Java in the database server (see

The beginners have developed a high quality J2EE system).

It seems that most people now tend to be more prominent Java, J2EE is easy to make beginners misunderstand the technical solution independent of Java.

From a deeper level, Java has been born in the past ten years, and many business components nearly ten years ago can still be used, and software applications no longer have destroyed strikes due to the revolution of the language.

However, as the concept of Web and EJB container birth, the software application industry begins to worry about whether Sun's partners continue to introduce refurbished standard frameworks on the Java platform, resulting in an uncomfortable software application business core component architecture, from always need This is illustrated in the discussion sound of EJB.

The author has pointed out in the 2004 China Software Technology General Assembly IOC Microelator (which is the implementation principle of the JDON framework): We need a micro-capacity across J2SE / Web / EJB to protect our business core components (middleware), Continue its vitality, not dependent on the J2SE / J2EE version, as shown below:

The J2EE is renamed Java EE, and it actually reflects this common voice of the industry.

Let's take a look at the new features or regulations for Java EE 5, we can download Java EE 5 norms from the Sun website. Its architecture is as follows:

In the figure, the gray grinding part is a new feature of Java EE 5. We see that the Web layer has mainly joined the new performance layer framework, and our daily development relationship is close to the new Java Persistence standard, this The standard is developed by the EJB 3.0 expert group.

It is worth pointing out that this Java persistence standard can also be embedded in the web layer call, so it will not be subordinate to EJB standards, so that all Java persistence layers such as: JDBC / JDO / Hibernate / Entity Bean will be possible Unify, reducing the user's architecture choice pain.

As can be seen from the architecture, regardless of the web structure or EJB structure, the function of providing achievements is much different, so our business core components can be deployed in Web or EJB as needed without relying on specific Java EE containers. The goal of the previous chapter diagram can be implemented in Java EE 5.

Of course, Java EE 5 is important to change: Java EE is no longer focusing on the development of large commercial systems as before, but more attention to the development of small-sized systems, simplifying this part of the system development steps.

The maximum feature of implementing this simplified action is to add ANNOTATIONS in Java 5.0 (Java 1.5). When the Annotations is introduced, when the Java EE is developed, it is necessary to write CODE, and write XML configuration files, and take care of it. It is not only benefited from the C language, and it is also experienced from the XDoclet practice of open source projects.

However, Annotations is a double-edged sword. The beginner is not well used, which will make the Hard Code (hard coded) in XML into the code annotations, the simplicity and flexibility of the code, Annotations discussion is here.

Of course, the introduction of Annotations is not just to solve the XML configuration. From the big concept, it is solved a resource injection problem (XML belongs to one of the resources). In the principle J2EE, the resources managed by the container are provided by JNDI to the application, It is now easy to implement injectory through Annotation. Resource Injection Design Concept is actually from IOC Mode, the JDON framework for the design and development has been implemented in the purpose of Annotations, in the JDON Framework Application Demonstration Source Code SimpleJDonframeworkTest, in JDonframework.xml A section is configured as follows:

This configuration is to use the JNDI name Java: / TESTDS of the database to JDBCDAO. JDON Framework will be based on Java 5.0. This line configuration will be written in JDBCDAO code via AnnotationS to facilitate programmers development.

From here, everyone can know the difference between EJB 3.0 and EJB 2.0, some people are confused, learning EJB 3.0 or learning EJB 2.0, in fact, EJB 3.0 does not have much change in EJB, just make programming Simplification, additional EJB CMP refers to Hibernate's new features, and EJB 3.0 maximum simplified changes are on the CMP programming method. Therefore, whether ejb 3.0/2.0, EJB principle and operation mechanism are the same, this part is the biggest difficulty in learning EJB, not because of EJB 3.0, understanding EJB will be easy.

Beginners can develop EJB 2.0 from Eclipse XDoclet, EJB 3.0 = EJB 2.0 xdoclet, here there is an Eclipse development EJB tutorial, using JBosside very simple, no lomboz and other plugins.

Security is an important feature of Java EE, that is, based on the safe access of the container, no need to manually encode yourself, specific implementation can refer to the JDON framework application demo source JDonnews. Although this is based on J2EE 1.3, the difference is not very big to Java EE 5.

Transaction Management Transaction Management is also an important part of Java EE 5, which expounds the main points of transaction management from several aspects. The standards are specified in the WEB layer to use transactions and threads in the Web layer. Standard: web server such as Tomcat does not need to provide transaction support in the Web layer, because the web component does not support transactional / delivery.

Because some architectures such as Struts Spring Hibernate / Struts Hibernate are the WEB structure in the standard, Java EE 5 specifies the life cycle of the web component transaction in J2EE 4.2.2. If the web component calls JTA directly, the transaction is not A plurality of requests across a client can only be completed in a request (servlet / JSP). This standard specifies that we cannot use long transactions in the web architecture (such as the above architecture) (such as a workflow / status map Requesting transactions, only a unique solution for a client cross-request: only use EJB's state session. Reference: i management is the main part of Java EE 5, Java EE contains more other technical parts such as JDBC JMS JCA JNDI, etc., require users to explore in practice.

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

New Post(0)