Road - 4. Applicability of J2EE

xiaoxiao2021-03-06  120

General.THE MOST Commonly Used J2EE Technologies (in Order of Use) Are: • Java Servlets / JSPS • JDBC • JNDI • EJB • JMS • Java XML Pack • Java Mail • Java IDL / RMI-IIOP • JTA / JTS

Identify application aspects that are suited to implementation using J2EE technology An enterprise environment / application with the following qualities would be suitable for J2EEtechnologies (ie why J2EE?): • Heterogeneous environmentAny medium to large sized organisation will have a variety of servers / platforms in use in theenterprise (eg Windows, Linux, Solaris, AS400). As JVMs are available for most platforms, Javaprovides Write Once Run Anywhere. Consequently use of J2EE enables code reuse, skillsconsolidation, etc. across the enterprise. • Requirement for vendor neutrality and / or enterprise integration.A primary function of Java and J2EE is to provide generic interfaces for both developers (usingAPIs) and service providers (using SPIs). This enables an organisation to pick and choose productsas they see fit without the fear of vendor lock-in In Addition, Integration Between EnterpriseComponents Is Quicker and Easier. • ProductivityJ2ee Provides a Feature-Rich Set of High Quali ty APIs (and some default / reference implementations) .Developers can use the APIs to reduce the time spent coding. Eg sending email from anapplication used to be time-consuming as a developer had to write a cut-down email client orintegrate classes from a Third Party;

email support can now be added using Java Mail in a fewminutes. • Future-proofingWhenever there's a core demand in the development / service provider community, Sun works inpartnership with other suppliers of enterprise components to provide Java and J2EE APIs andimplementations that support the demand. By using J2EE, an organisation can be reasonably certainthat any developments within the industry will:. 1) be available in J2EE and 2) be available in atimely-fashion Eg support for web services was added to J2EE as soon as it became apparent thatthere was . a demand in the community • Requirement for Enterprise class components.J2EE is high quality and provides fully integrated support for enterprise concepts - eg security, transactions, etc.Identify application aspects that are suited to implementation using EJB (ie why use EJB?) EJB DRAWS ON The Use of Java to Provide a Generic Interface for Both Developers and Service Providers.ejb Provides A Standard Execution and Packaging ENV ironment which enables the development ofcomponents that are distributed, container managed and fault tolerant In addition, EJB provides support fordeclarative programming - for transactions, security, etc.An enterprise environment / application with the following qualities would be suitable for EJB technologies:. • Large scale deployment.The application has to service a large number of users whilst maintaining high levels of performanceand availability EJB facilitates such requirements through support for clustering (multipleinstances.;

location transparency via JNDI and smart stubs), demand-based instance pooling, caching, etc. • Transactional in nature.EJB provides ACID support for distributed transactions either automatically using CMT (ContainerManaged Transactions) or programmatically using BMT (Bean Managed Transactions withJTA / JTS ). If the application is transactional in nature (eg transferring amount between bankaccounts) it is suitable for EJB • Requirement for fine-grained security.EJB has integrated support for declarative, fine-grained security • Requirement for supporting a variety of clients.EJB splits the architecture in to n-tiers - typically client tier, web tier, EJB tier and EIS tier.The business logic is centralized in the EJB tier Consequently, there is a greater level of reuse andapplication clients are thinner • Requirement for enhanced.. Productivity / reliability.ejb backs the "Iceberg" Model - The Majority of The Low-Level Functionality (Eg Threading, Pooling, CMT, CMP / R, ETC.) HAS BEEN DEVEL oped by experts and is automatically bestowed upon theapplication developers Consequently the developers can concentrate on writing the business logic.However, the productivity benefits may be mixed - EJBs take longer to write;. an application mayhave to integrate with an existing database or a non- DB source so has to use BMP (Bean ManagedPersistence), etc. • Re-use.Components can be written that can be re-used across several projects. • Component provider.If the business of the organisation is providing components for others (eg A SAP Library

An enterprise environment / application with the following qualities would not necessarily benefit from EJB: • simple, small scale website - might be better to use Servlets and JSP with local Java classes • no transactional requirements • only basic security requirements • an application that needs To Use facilities "Forbidden" by EJB (Eg Socket Servers, JNI Wrappers, ETC.) • An Application That May Needs to Be Scaled-Down (EG A Self-Contained Client Version That Won't Havecess To An Ejb Container) • a development team who are not comfortable with EJB developmentIdentify suitable J2EE technologies for the implementation of specified application aspects.Servlets / JSPs • need to process dynamic requests from HTTP clients A dynamic request is one where the response can be tailored on a per request basis - EG Filter by IP, Get Customer Details from DB And Render AS HTML • Use Servlets for Lower Level Functionality Such As Processing Requests, Routing, ETC. • Use JSPS for Presentation Aspects Such as Combining Data and Template for HTML OUTPUT

JDBC • Use to access a vendor specificia in a Generic WAY

JNDI • Use to access Vendor Specific Directory or Naming Products in a Generic Way - E.g. USED Byjdbc for Connections, Access LDAP, ETC.

EJB • LARGE SCALE Deployment • Need Transaction / Security (with The Added Bonus of Declarative Programming) • Need to Support a Variety of Clients • No EXIns (USE CMP)

JMS • Use for Systems That Require Asynchronous Features • Use to integrate with legacy systems • Use to Simulate Threads in EJB

Java XML Pack • Use for B2B Message Exchange and / or HTTP Application Clients • Use to Product Web Services

Java Mail • Use to send / receive email with plain or mime content

Java IDL / RMI-IIOP • use Java IDL to write Java-CORBA services (ie Java CORBA clients and / or Java CORBA object servers) • use RMI-IIOP to allow CORBA clients to interoperate with EJB objects or Java RMI object serversJTA / JTS • Use when you need coarse grained Transactions • Use when you ejb-cmt isn't an option

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

New Post(0)