Tutorial for building J2EE applications using JBoss and eclipse Chapter 2 Part 1

Source: Internet
Author: User
Tags access properties

All J2EE components are written in the Java programming language

This statement clearly demonstrates that J2EE can only be developed using Java. I have heard that some open source enthusiasts can use it. net, and then work through some converters. I am not very familiar with this. But for me, if I want to develop. net, I will use Microsoft's stuff. Don't think too much. After all, that is professional. Java is used for J2EE development.

The Java 2 Enterprise Edition (J2EE) is a multitiered architecture for implementing enterprise-class applications and web based applications.

This statement illustrates the J2EE presentation method.

The main aim of J2EE technology is to create a simple development model for enterprise applications using component based application model.

The purpose of J2EE is to make it easier to develop enterprise-level applications, but I think it is not easy to configure J2EE.

Note this may not be ideal in all scenarios: for example, a small scale application might be a better fit for a light-weight Java technology solution

This sentence tells me not to be superstitious about J2EE, but to change as needed. Select an appropriate architecture based on the actual situation.

The project I want to implement will use the Web Client. I talk a lot about this part.

As shown in the figure above, the Web Browser needs to access the business tier through servlets or JSP. You can also choose whether to use Java Beans components between the Web Tier and business tier.

Next let's take a look at business components communication.

 

There are three types of enterprise beans:

Session beans (stateless and stateful)

Entity beans (bean managed and container managed)

Message-driven beans

This document describes session beans as follows: "A Session Bean represents a transient conversation with a client. When the client finishes executing, the Session Bean and its data are gone ". Entity beans has the opposite feature: "If the client terminates or if the server shuts down, the underlying services ensure that the entity bean data is saved ". Message-driven beans are a combination of sessions and JMS interfaces. JMS is a good thing. In a large retail system I used to build, communication between components is through JMS, however, many implementations of JMS seem to be expensive now, and there is another free problem, which often increases the memory consumption for no reason.

Java Beans and Enterprise Java Beans are distinguished here. Java Beans can be used at the server and client layers. It can be used as a component for internal communication between a client application, a J2EE server, or a database. However, EJB can only be in the service layer of the server layer. Below is the description of the original article,"Java Beans are not considered J2EE components by the J2EE specification as JavaBeans are different from enterprise beans. javaBeans component architecture can be used in both server and client tiers to manage the communication between an application client or applet and components running on the J2EE server or between server components and a database, whereas Enterprise JavaBeans components are only used in the business tier as a part of the server tier. javaBeans have instance variables and has an accessor and mutator methods to access properties of bean or say, accessing the data in the instance variables which simplifies the design and implementation of JavaBeans components."

J2EE containers

J2EE containers provide a lot of convenience, such as multi-thread, transaction, status, thread pool, and so on. Now the container has provided. We only need to focus on business processing.

Containers are actually a bridge between business components and the underlying functions of the system. So I think some time has been spent repeatedly processing some underlying functions. If some projects have accumulated, or you can reuse thread pools and other things, J2EE container is now available, however, time is spent on configuration, so we need to rely on tools for automatic configuration. Without these tools, the original intention of J2EE has been lost, developing an enterprise-level system will take more time.

The J2EE server itself has integrated web iner and EJB container. In fact, the client also uses Java container, which is the JRE we are familiar.

Packing

I think the most complicated thing in J2EE is packaging, a lot of XML files, and there is nothing to verify. It will only be known when deployed. If you need to write all the data, it will return to the original age. Fortunately, lomboz will automatically use XDoclet to generate these things.

Web components are packaged into Web Archive (. War ). It will include sevlets, JSP, and some static resources such as HTML and images.

The service components are packaged and stored as Java archive (. Jar ). It includes the scripts for EJB deployment, remote, object interface files, and so on.

We can also see the JAR file format on the client, which can be called a Local Executable File.

The J2EE program will package the above files into enterprise archive (. Ear), which includes all the files required for deployment. For example:

 

Role J2EE platform roles

Many roles are defined in the J2EE specification, including developer, explorer, deployer, system administartor, and tool rovider. In the current domestic development environment, the division of labor has not yet reached such a detailed level, it is often possible that one person assumes multiple roles. Apart from the explicit separation of tool provider and developer, all others work by one. Among them, I plan to use the daily bulid tool to process the role of cycler. The official explanation is as follows, "The Application Generator ER takes all building blocks from the application component provider and combines them into J2EE applications. ". Deployer uses the open-source automatic Deployment Tool ant, so we can focus on developing business.

 

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.