J2EE Investigation
2011-02-24 15:01 Aga.J 阅读(335) 评论(0) 收藏 举报As we know J2EE is a platform designed for enterprise application. It has lots of advantages, and it can help us to develop high quality distributed transactional , high-speed , reliable enterprise application. Otherwise just because J2EE provides a component-based approach to the design, development, assemble, and deployment of enterprise applications, we-developer, Vendors or customers can enjoy the freedom to choose the products and components to best meet our business and technological requirements ( in business, business goal is first, isn’t it, aha).
Well, it’s reasonable to describe the basic and simple framework which J2EE application may takes. An experienced developer knows the famous MVC framework. Yeah, J2EE application has something similar in application framework. Just look at the picture below.
Can we find anything like “MVC”( ok, it’s my own idea. If you think they are not related, you can keep your idea).
First of all, let me briefly explain this picture. It’s easy to find that J2EE application is divided into four tier : client tier, web tier, business tier, EIS tier( it’s common to see the tier partition in other application or system ). However, do you notice that different tier may belong to some Machine. This is the basic feature of J2EE . By application J2EE platform, we can develop multitiered application which has various application components installed on different machines depending on the tier.
1 Client-tier components run on the client machine
2 web-tier components run on the j2ee server
3 Business-tier components run on the j2ee server
4 enterprise information system –tier software runs on the EIS server
Secondly, what exactly the J2EE components are? As we describe above, one J2EE application is made up of components , which are self-contained functional software unit. Here, you need to comprehend what is self-contained functional software unit. In my opinion, it’s such unit that it can complete one particular function and it can be assembled into J2EE application with its related classes and files. Most importantly, the unit can communicate with other components. Here is the components.
1 Application clients and applets (which are components that run on the client machine)
2 Java Servlet and JavaServer Pages technology ( which are Web components that run on the server machine)
3 Enterprise JavaBeans (which are business components that run on the server machine);
Thirdly, what are those components mean? ( you may ask what is applet). Here I will briefly introduce these concepts to you.
CLIENT as we know, a client is a application that receives user input and do some computation ,and finally show the result to the user. In J2EE, client can be refer to Web Client or application client. A Web Client consists of two parts: dynamic Web pages and a Web browser. How they cooperate to serve the user? The simple answer is that there is a web server generate dynamic Web page(may embed applets, which require java plug-in and possibly a security policy file to execute in the web browser.) and send it to the Web browser. The Web browser renders pages to show the result you want to get (there is a new concept called REST).As you see, most of the heavyweight operation like query database, execute complex business rules, connect to legacy application are off-loaded to server.
Another client is application client , which has GUI and created from Swing or Abstract Window Toolkit. This client also can communicate to Web server to gain something it wants.And it also can directly access something running in the business tier.( what’s the something,?we will learn later.)
DATA J2EE introduces a utility called Java Bean(that is the “something”. It help to manage data flow between an application client or applet and components running on the J2EE server or between components and a database. The java bean can be keep on both client side or server side. The beans in server side are called enterprise beans.
SERVER server consists of Web components and Business Components. Web components can be either servlets or JSP page. Servlets process client request and construct responses. What is the request? Yeah, Java bean comes out again. Server(exactly the Web tier) might include a JavaBeans to manager user input and send that input to enterprise beans running in the business tier for processing (business tier is a key tier for most business server. J2EE make it agile to adjust business goals in business tier).Finally look at the “Multitiered aplication” picture, we need to communicate to EIS( it’s not introduced here, you can gain some ideas from the SOA concept), here is a picture try to describe the interaction between the components. Try to deeply understand it!
(ps:
reference: J2EE Tutorials
author: aga j)
作者:Aga.J
出处:http://www.cnblogs.com/aga-j
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
个人学习笔记仅供本人记录知识所用,不属发表性文章。