Technology
http://www.bratandblekning.com Top Blogs J2EE ~ JAVA TUTORIAL

J2EE

The most important goal of the Java EE 6 platform is to simplify development by providing a common foundation for the various kinds of components in the Java EE platform.The Java EE 6 platform includes the following new features:
·         Profiles: configurations of the Java EE platform targeted at specific classes of applications. The Java EE 6 platform tells a lightweight Web Profile targeted at next-generation web applications and Full Profile that consists of all Java EE technologies and provides the full power of the Java EE 6 platform for enterprise applications.

·         New technologies, including the following:

o    Java API for RESTful Web Services (JAX-RS)

o    Managed Beans

o    Contexts and Dependency Injection for the Java EE Platform (JSR 299), informally known as CDI

o    Dependency Injection for Java (JSR 330)

o    Bean Validation (JSR 303)

o    JASPIC  i.e Java Authentication Service Provider Interface for Containers



Java EE Application Model
The Java EE application model begins with the Java programming language and the Java virtual machine. Their  portable, secure and developer productivity proves that ,they can provide forms the basis of the application model. J2EE is designed to support apps that implement enterprise services for clients,customers, employees, suppliers, partners. These applications are complex and potentially accessing data from different sort of sources and distributing applications to a variety of clients.
A middle tier typically runs on dedicated server hardware and has access to the full services of the enterprise.
The Java EE application model defines an architecture for implementing services as multitier applications. So this model partitions the job or work required to implement a multitier service into the following parts:
·         Implementation of business and presentation logic by the developer
·         The standard system services given by the Java EE platform
The developer can depend on the platform to provide solutions for the hard systems-level problems of developing a multitier service


Distributed Multitiered Applications


The Java EE platform uses a distributed multitiered application model for enterprise applications. Applicationlogic should be divided into components according to function & these application components that make up a Java EE application are installed on various machines, depends upon the tier in the multitiered Java EE environment to which the application component belongs.
As shown in figure two multitiered J2EE applications divided into the tiers described in the following:-
 The Java EE application parts shown in following Figure are presented in Java EE Components.
·   A Client-tier components run on the client machine.
·   And Web-tier components run on the J2EE server.
·   Also Business-tier components run on the J2EE server.
·   Enterprise information system (EIS)-tier software runs on the EIS server.
Although a Java EE application can consist of all tiers shown in Figure, J2EE multitiered applications are normally considered to be three-tiered applications because they are distributed over three locations: client machines and the J2EE server machine ,the database or legacy machines at the back end. The 3-tiered applications that run in this way extend the standard two-tiered client-and-server model by placing a multithreaded application server between the client application and back-end storage.




Figure 1-1 Multitiered Applications
Diagram of multitiered application structure, including client tier, web tier, business tier, and EIS tier.

Security

Although other enterprise application models require platform-specific security measures in every application, the J2EE security environment enables security constraints to be defined at deployment time. The J2EE platform makes applications portable to a wide variety of security implementations by shielding application developers from the complexity of implementing security features.
The Java EE platform provides standard declarative access control rules that are defined by the developer and interpreted when the application is deployed on server. J2EE also provides standard login mechanisms so application developers do not have to implement these mechanisms in their applications. A same application works in a different sort of security environments without changing the source code.

Java EE Components


Java EE applications are made up of components. The Java EE component is a self-contained functional software unit that is assembled into a Java EE application with its related classes and files and that communicates with other components.
The J2EE specification defines the following Java EE components:
·   App clients and applets are components that run on the client.
·   Java Servlet, JSF, and JSP technology components are web components that run on the server.
·   Enterprise JavaBeans (EJB) components (enterprise beans) are business components that run on the server.
Java EE components are written in the Java programming language and are compiled in the same way as any program in the language. The diff b/w Java EE components and “standard” Java classes are that Java EE components are assembled into a J2EE application, these are verified to be well formed and in compliance with the J2EE specification and they are deployed to production, where they are run ,managed by the J2EE server.

Java EE Clients


The J2EE client is usually either a web client or an application client.

Web Clients


A web client consists of two parts:
·   Dynamic web pages containing various types of markup language (HTML, XML, and so on), which are generated by web components running in the web tier
·   A web browser, which renders the pages received from the server
A web client is sometimes called a thin client. And Thin client usually do’nt query databases ,execute business rules, or connect to legacy apps. When we use a thin client, such heavyweight operations are off-loaded to enterprise beans executing on the J2EE server, where they can lack in security, speed and reliability of J2EE server-side technologies.

Application Clients


An application client runs on a client machine and provides a way for users to handle tasks that require a richer user interface than can be provided by a markup language. The application client genrally has a graphical user interface (GUI) created from the Swing or the Abstract Window Toolkit (AWT) API, but a command-line interface is certainly possible.
Application clients directly access enterprise beans running in the business tier. Well ,if application requirement warrant it, an application client also can open an HTTP connection to establish communication with a servlet running in the web tier. Appl clients written in languages other than Java can interact with J2EE servers, enabling the J2EE platform to interoperate with legacy systems, clients.
Applets


A web page received from the web tier can include an embedded applet. In the Java, an applet is a small client application that executes in the Java virtual machine installed in the web browser. client system will likely need the Java Plug-in and possibly a security policy file for the applet to successfully execute in the web browser.
Web components are the preferred API for creating a web client program, it is because no plug-ins or security policy files are needed on the client systems. The web components allow cleaner and more modular application design because they provide a way to separate applications programming from web page design.
The JavaBeans Component Architecture


The client and server tiers can also include components based on the JavaBeans component architecture (JavaBeans components) to manage the data flow between the following:
·   An app client or applet and components running on the Java EE server
·   Server components and a database
JavaBeans components can’t be considered Java EE components by the Java EE specification.
JavaBeans components have properties and have get and set methods for accessing the properties. The JavaBeans components used in this way are typically simple in design and implementation but should conform to the naming and design conventions outlined in the JavaBeans component architecture.

Java EE Server Communications

Figure 1-2 shows the various elements that can make up the client tier. The client interects with the business tier running on the Java EE server directly or, as in the case of a client running in a browser or also by going through web pages or servlets running in the web tier.

Figure 1-2 Server Communication

Diagram of client-server communication. Application clients access the business tier directly. Browsers, web pages, and applets access the web tier.

Web Components


Java EE web components are either servlets or web pages created using JavaServer Faces technology and/or JSP technology (JSP pages). Servlets are Java programming language classes that dynamically process requests and construct responses. Java Server Pages are text-based documents that execute as servlets but allow a more natural approach to creating static content. JSFtechnology builds on servlets and JSP technology and provides a user interface component framework for web applications.
Static HTML pages and applets are bundled with web components during application assembly but are not considered web components by the Java EE specification. The Server-side utility classes can also be bundled with web components and, like HTML pages, these are not considered as web components.
As shown in Figure , the web tier, like the client tier, might include a JavaBeans component to manage the user input and send that input to enterprise beans running in the business tier for processing.


Business Components


Business code, which is logic that solves or meets the needs of a particular business domain like banking, retail, or finance, is handled by enterprise beans running in either the business tier or the web tier. Figure above shows how an enterprise bean receives data from client programs, processes it (if necessary), and sends it to the enterprise information system tier for storage. The enterprise bean also recieves data from storage, processes it (if necessary), and sends it back to the client program.

Figure 1-4 Business and EIS Tiers

Diagram of client-server communication showing detail of entities, session beans, and message-driven beans in the business tier.

Enterprise Information System Tier


The enterprise information system tier handles EIS software and includes enterprise infrastructure systems, such as enterprise resource planning (ERP), mainframe transaction processing, database systems, and other legacy information systems. Ex:- Java EE application components might need access to enterprise information systems for database connectivity.

Static HTML pages and applets are bundled with web components during application assembly but are not considered web components by the Java EE specification. The Server-side utility classes can also be bundled with web components and, like HTML pages, these are not considered as web components.
As shown in Figure , the web tier, like the client tier, might include a JavaBeans component to manage the user input and send that input to enterprise beans running in the business tier for processing.


Business Components


Business code, which is logic that solves or meets the needs of a particular business domain like banking, retail, or finance, is handled by enterprise beans running in either the business tier or the web tier. Figure above shows how an enterprise bean receives data from client programs, processes it (if necessary), and sends it to the enterprise information system tier for storage. The enterprise bean also recieves data from storage, processes it (if necessary), and sends it back to the client program.

No comments:

Post a Comment