Docsity

Session Beans: Use, Types, and Implementation in Component-based Software Development - Pr, Study notes of Engineering

Partial preview of the text

Download Session Beans: Use, Types, and Implementation in Component-based Software Development - Pr and more Study notes Engineering in PDF only on Docsity!

Session Beans

Ye Wu

http://www.ise.gmu.edu/~wuye

SWE 645

Component-based Software Development

2006-9-

© Dr. Ye Wu

2

When to Use Session Beans

•^

Implement non-trivial enterprise’s workflow orprocesses

-^

Usually are used in multi-tiered applications

2006-9-

© Dr. Ye Wu

3

Example

DB Manager

DB

DB Manager

DB

2006-9-

© Dr. Ye Wu

4

Example

DB1Manager

DB

DB Manager

DB

SessionBean

2006-9-

© Dr. Ye Wu

5

Why Using Session Beans

•^

Simplify Enterprise Application

-^

Decouple dependences between client and server

-^

Reduce network traffic

-^

Enhanced security, transaction support

-^

Increase maintainability

2006-9-

© Dr. Ye Wu

6

Concerns for Session Beans

•^

How to determine the scope for a Session Beans– Use cases– Classes

2006-9-

© Dr. Ye Wu

7

Stateless vs Stateful Session Beans

•^

A stateful session bean can keep data betweenclient accesses. A stateless session bean must not.

-^

Both represent a private resource for the client thatcreated them

-^

Both are intend to model a process or task

-^

Both can update shared data, but do not representthat shared data in the way that an entity beandoes.

2006-9-

© Dr. Ye Wu

8

Stateless Session Bean LifeCycle

Not Exist Method Ready

Class.newInstance()

injection

PostConstruct

@Predestroy

Businessmethods

2006-9-

© Dr. Ye Wu

13

Implementing Stateful Session Beans

SAME!!!