How to develop a high quality Java EE system for Beginners

Source: Internet
Author: User
Tags definition implement jboss jboss server tomcat
j2ee| Beginners

Java EE more and more learners, the technology of Java-EE is constantly developing, emerging a variety of concepts, this article is an easy to understand the concept of these concepts to the beginners to explain, in order to master the learning direction of Java EE.

The first thing we need to know is that Java and EE are two different concepts, Java is not just a language, has represented a different huge camp with Microsoft, so Java sometimes refers to a genre of software systems, of course, currently mainly. NET and Java two major mainstream systems.

Java EE can be said to refer to the implementation of the database information system, the database information system from the early dBASE, to DELPHI/VB, such as C/s structure, developed to B/s (browser browser/server server) structure, and the Java EE mainly refers to B/s structure of the implementation.

Java EE is also a framework and standard, framework similar to the concept of APIs, libraries, but beyond them. If you need to learn more about the framework, you can start with design mode.

The Java EE is a fictitious big concept, the Java EE Standard mainly has three seed technical standard: The Web technology, the EJB technology and the JMS, talks about the Java EE should say finally must implement to these three sub concepts.

Each of these three technologies is applied in two parts: the container part and the application part, the Web container also refers to the Jsp/servlet container, if you want to develop a Web application, whether compile or run, must have Jsp/servlet library or API support (except jdk/ Outside the J2SE).

In addition to Jsp/servlet technology in Web technology, but also need JavaBeans or Java class to implement some functions or packaging to carry data, so the Web technology was initially nude for short Jsp/servlet+javabeans system.

When it comes to JavaBeans technology, it involves component components technology (component), which is the core foundation part of Java, and many software design concepts (design patterns) are implemented through JavaBeans.

JavaBeans is not part of the concept of Java EE, if a JavaBeans object is called by Web technology (that is, Jsp/servlet), then JavaBeans runs in the Java EE Web container, and if it is invoked by the EJB, it runs in the EJB container.

EJB (Enterprise JavaBeans) is a kind of promotion and specification of ordinary JavaBeans, because enterprise information system development needs a scalable performance and transaction, security mechanism, this can ensure enterprise system smooth development, rather than develop to a scale to replace a software system.

At this point, the JavaBeans component evolved to EJB, not to say that the previous JavaBeans form disappeared, which naturally formed two kinds of JavaBeans technology: EJB and Pojo,pojo completely different from the EJB concept, referring to the ordinary JavaBeans, And the JavaBeans does not cling to a certain framework, or simply say: This JavaBeans is created by you for this application alone.

Java EE application System development tools are many: such as JBuilder, Eclipse, and so on, the IDE is the first development tools, that is, their primary basic function is to develop JavaBeans or Java class, but if you want to develop the EE system, To implement either Web technology or EJB technology, it is possible to have some specialized module functionality (such as Eclipse needs Lomboz plug-ins), and most importantly, because the Java EE system is differentiated into containers and applications two parts, In any development tool to develop Java EE need to specify the Java container.

Java EE containers are divided into web containers and EJB containers, tomcat/resin are web containers, and JBoss is the EJB container +web container, where web containers are implemented directly using TOMCAT. So the Web application you develop can run on both containers, and the WEB+EJB application you develop can only run on the JBoss server, and the commercial product websphere/weblogic and JBoss are of the same nature.

Java-EE containers are also called Java-EE servers, most of which are consistent in their concepts.

If your Java EE application database connection is obtained through Jndi, that is to say, it is obtained from the container, then your Java EE application System is basically independent of the database, if you have coupled the database JDBC-driven configuration in your Java application system, Then your Java EE application system has a database concept color, as a mature need to promote the Java application system, not recommended and specific database coupling, of course, how to ensure that the performance of Java EE application System is reflected in your design level.

The standard of the application system design and development level of Java EE is: decoupling; Can your application system be completely disconnected from each other? is not interdependent, and only in this way, can embody the maintainability, scalable software design objectives.

In order to achieve this goal, the emergence of various framework concepts, the Java EE Framework standard divides a system into the web and EJB main parts, of course, we are sometimes not based on this specific technology, but from the design of abstraction as a presentation layer, service layer and persistence layer, which separates the Java EE from a height, the three levels, To achieve decoupling.

Therefore, in actual programming, we should also put our own function to these three levels, it is not easy to do this without technical constraints, so we still have to use the Java technology to implement it, and then you can implement the service layer and the persistence layer using the EJB specification, Web technology to achieve performance layer;

Why does EJB detach the service layer from the Jsp/servlet because it enforces constraints on JavaBeans encoding, and there is now a weak constraint on JavaBeans, implemented using the IOC pattern (and of course EJB 3.0 takes this approach), before the IOC model was born, is generally through the factory model to JavaBeans constraints, forming a service layer, which is jive such open source forum design principle.

Thus, separating the service layer from the presentation layer currently has two alternative schema choices: Managing the Common JavaBeans (POJO) framework (such as spring, jdonframework), and the EJB framework for managing EJBS, because EJB is not just a framework or a standard, and standards can be expanded, so the two distinctions may in the future be blurred and incorporated into the same standard. However, the individual believes that: standard-setting is to serve a purpose, always sacrifice some for others, so the two architectures coexist for a long time.

These two architectural differences have also been the birth of a new term: a completely pojo system is also known as a lightweight system (lightweight), in fact, this noun itself does not have a strict definition, more is an attractive sign, lightweight means easy to learn easy to use? By this definition, systems such as lightweight spring are not easy to learn, and are the systems of EJB 3.0 (still called EJB) considered lightweight?

The service layer framework is used to separate the JavaBeans from the Jsp/servlet using the service layer framework, while the use of the presentation layer framework can completely separate the remaining JavaBeans in the JSP, which is mainly responsible for showing the correlation, Generally through the tag library (taglib) to achieve, different frameworks have their own tag library, struts is widely used in a presentation layer framework.

In this way, the separation of the presentation layer and the service layer is achieved through two frameworks, the rest is the persistence layer framework, which separates the database storage from the service layer through the persistence layer framework, which has two directions: directly writing JDBC SQL statements (such as Ibatis); using O/R The hibernate and JDO technologies implemented by mapping technology, and of course the entity Bean Technology in the EJB.

The persistence layer framework is now blossoming, each has its own advantages and disadvantages, so as with the performance layer framework, there is no framework currently designated as a standard framework, of course, the presentation layer framework is now out of a JSF, it represents a page component concept is a new direction, but the complex implementation of the people are somewhat forgotten and discouraged.

In all of these Java EE Technologies, although Sun has played a big role, on the whole: there is an assessment on the Web: Sun's theory is invincible; Sun's products are playing against the wall; for beginners, especially those trying to pass or have passed sun certification, quickly get rid of Sun's shadow , take off immediately, use the open source domain product to realize own application system.

Finally, if your Java application system takes the framework of the presentation layer, service layer and persistence layer mentioned above, you can also develop a high quality application system without having to master the design pattern.

Also note that: the development of a high-quality Java EE system also needs to understand the correct business needs, then domain modeling provides a more practical way to correctly understand the business requirements, the relevant detailed knowledge can be integrated from the UML perspective.

Of course, if you want to design your own industry framework, so the first step is to start with the design pattern, because the design pattern provides you with a JavaBeans or decoupling reference implementation, and when you learn the decoupling of the basic unit JavaBean or the class, then the decoupling between the system modules can be mastered , and you will be able to refine the industry framework, which is another development direction.

The above ideas can be summed up as a sentence:
Java EE Development Three pieces of treasure: Domain Model (field modeling), patterns (mode) and framework (framework).




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.