Upload
nyellutla
View
218
Download
0
Embed Size (px)
Citation preview
7/28/2019 SCEA Study Sheet 1
1/1
SCEA Study She
Compiled by Brian Briggman, Patricia Guimaraes, Konrad Ro
DOES NOT EXIST
READY
1. create
2. setSessionContext
3. ejbCreate
1. remove
2. ejbRemove
DOES NOT EXIST
METHOD READY
1. setSessionContext
2. ejbCreate 1. ejbRemove
PASSIVE
ejbActivateejbPassivate
DOES NOT EXIST
setEntityContext unsetEntityCon
1. remove
2. ejbRem
1. create
2. ejbCreate
3. ejbPostCreate
ejbActivate
POOLED
READY
ejbPassivate
Stateless Session Bean
Stateful Session Bean
Entity Bean
SCEA Study She
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
Architectural Considerations
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)
EJB Container Model
Applicability of J2EE
Enterprise JavaBeans (EJB's)
Atomic - all or none of transaction is performedConsistent - obeys integrity constraintsIsolated - independent of other transactionsDurable - data must persist once transaction is over
Distributed system frameworksCORBA - moves state of object (call by value)RMI - moves state and behavior (call by referen
RMI-JRMP: Used for pure Java applicationsRMI-IIOP: Standard protocol for EJB's, calls COR
Java IDL: Used when calling Java with CORBAJNI: Java wrapper around native code
Stateless Session Beans (SLSB) -Used to provide generic servicesBusiness 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 databaseProvides concurrent access to shared dataShould be accessed via session beans
Data Access Objects (DAO)Place DB access logic in DAO's, not EJB'sResults in greater database portability
AttributeRequiredRequiresNewNotSupportedSupportsMandatoryNever
Client Has TransactionPropagatedSuspended & NewSuspendedPropagatedPropagatedException
No TransactNewNew--Exception-
The container provides:1) Life cycle management2) Transaction management3) Object distribution
Transactions
EJB Lifecycles
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.SessionBeanor javax.ejb.EntityBean)
- contains implementation of Home and Remoteinterface methods and lifecycle methods
Bean Passivation: container canserialize beans to disk to freeresources
ejbPassivate/ejbActivate can beimplemented to close/reopenexternal connections
For SFSB's, ejbPassivate must alsonull all non-transient, non-serializable fields
Bean Pooling: container managesbean instances in a pool to
conserve resources
pooling increases scalability
NameStateless SessionStateful SessionEntity
PassivationNoYesYes
CMTYesYesYes
BMTYesYesNo
CMP--
Yes
BMP--
Yes
Beans have the following properties:
Container vs Bean Managed TransactionsCMT: Declarative, less codeBMT: More control, only in Session Beans
EJB does not support nested transactions
Container vs Bean Managed PersistenceCMP: better portability across databases,
simple datatypes onlyBMP: can perform better,
complex datatypes
Legacy Connectivity
Screen scraper- acts as terminal emulator on one endand an object interface on the other
- used if no access to source codeObject mapping- wrappers map legacy objects tonewer interfaces
- used if legacy interface changes oftenOff-board serverserves as a proxy for legacy systemoften used with screen scrapers