Sie sind auf Seite 1von 1

SCEA Study Sheet

Architectural Considerations Scalability - Vertical/Horizontal expansion of the system to support more users Maintainability - Correct flaws in a component without affecting other components Reliability - Ensure integrity and consistency of system and transactions Availability - Services are available to users Extensibility - Add functionality without affecting other components Performance - Optimization of resources, speed of execution Manageability - Ensure health of the system Security - Ensure data is not disclosed or modified illicitly Common Architectures 1-tier - monolithic, standalone pros: manageability cons: scalability, maintainability, extensibility 2-tier - client/server, fat client, stored procedures 3-tier/n-tier - typical J2EE architecture Client Tier (web clients, applets) Web Tier (web servers, JSP's, servlets) Business Tier (EJB's) EIS Integration Tier (JDBC, ODBC, Corba) EIS Tier (databases, legacy data) Enterprise JavaBeans (EJB's) Stateless Session Beans (SLSB) Used to provide generic services Business logic Stateful Session Beans (SFSB) Maintain conversational state (shopping carts) Business logic Entity Beans (EB) Model business entities (nouns) Usually represents a row in the database Provides concurrent access to shared data Should be accessed via session beans Data Access Objects (DAO) Place DB access logic in DAO's, not EJB's Results in greater database portability Each EJB must have: Home Interface (extends javax.ejb.EJBHome) - allows client to create/remove/find an EJB Remote Interface (extends javax.ejb.EJBObject) - contains business methods callable by client Bean class (extends javax.ejb.SessionBean or javax.ejb.EntityBean) - contains implementation of Home and Remote interface methods and lifecycle methods EJB Container Model The container provides: 1) Life cycle management 2) Transaction management 3) Object distribution Container vs Bean Managed Persistence CMP: better portability across databases, simple datatypes only BMP: can perform better, complex datatypes EJB Lifecycles

Stateless Session Bean


DOES NOT EXIST 1. setSessionContext 2. ejbCreate METHOD READY 1. ejbRemove

Legacy Connectivity DOES NOT EXIST Screen scraper - acts as terminal emulator on one end 1. create 1. remove 2. setSessionContext and an object interface on the other 2. ejbRemove 3. ejbCreate - used if no access to source code Object mapping READY - wrappers map legacy objects to newer interfaces ejbPassivate ejbActivate - used if legacy interface changes often Off-board server PASSIVE serves as a proxy for legacy system often used with screen scrapers

Stateful Session Bean

Entity Bean

DOES NOT EXIST

Bean Passivation: container can serialize beans to disk to free resources ejbPassivate/ejbActivate can be implemented to close/reopen external connections null all non-transient, nonserializable fields

setEntityContext POOLED ejbActivate

unsetEntityContext

ejbPassivate 1. remove 2. ejbRemove

1. create 2. ejbCreate For SFSB's, ejbPassivate must also 3. ejbPostCreate

READY

Bean Pooling: container manages bean instances in a pool to conserve resources pooling increases scalability

Applicability of J2EE Distributed system frameworks CORBA - moves state of object (call by value) RMI - moves state and behavior (call by reference) RMI-JRMP: Used for pure Java applications RMI-IIOP: Standard protocol for EJB's, calls CORBA Java IDL: Used when calling Java with CORBA JNI: Java wrapper around native code

Transactions Atomic - all or none of transaction is performed Consistent - obeys integrity constraints Isolated - independent of other transactions Durable - data must persist once transaction is over Attribute Client Has Transaction Required Propagated RequiresNew Suspended & New NotSupported Suspended Supports Propagated Mandatory Propagated Never Exception Container vs Bean Managed Transactions CMT: Declarative, less code BMT: More control, only in Session Beans EJB does not support nested transactions Compiled by Brian Briggman, Patricia Guimaraes, Konrad Rokicki No Transaction New New Exception -

Beans have the following properties: Name CMT BMT CMP Stateless Session Yes Yes Stateful Session Yes Yes Entity Yes No Yes

BMP Yes

Passivation No Yes Yes

Das könnte Ihnen auch gefallen