ENTERPRISE JAVA BEANS


sCOPE oRGANIZATION wIDE

MVC
Model= EJB
View= JSP
Controller = SERVLET

Why should we go for EJB?
Scalability (application should work same for 2 client and 2 million client.)
Should be catering to multiple request simulatanously.
Problem with the thread is Sycronization.
EJB CONTANER, will work on instance pooling and multiple instance.

Example
jdbc

to enable tansaction, first step is to make the autocomit off.
set autocommit flase applicable to the JVM where this property is set.

focus should be buisness logic, let transaction manage by somebody so this will be managed by CTM (container transaction management)

Web server & application server
Diffrence
Application server is super set of web server. In other words web server can be one component in application server.
Main diffrence will be application server is aware of its surroundings.

  1. Security
  2. Application control
  3. Infrastructural Capability

Application Server Main Properties

  1. Transaction management
  2. LDAP
  3. Persistance
  4. Threading
  5. Socket
  6. DBMS

Enterprise Level Application
EJB can be deploy only on Application Server. Used for scalable problems.

MESSAGE BEANS: asyncronous communication

If you need to generalizes something you make implementation and every one will write interface for it.

EJB distributed component need security any request comes in from cinet has to be checked.

EJB Contaner will decide whether to provide you access or not.

Per bean there will be one instance object.
Rule of thumb: One client one bean one instance will be always true.

Types of Bean

  1. Session Bean
    1. Stateless bean
    2. Statefull bean
  2. Enttyty Bean
    1. CMP – Container Managed Persistence
    2. BMP – Bean Managed Persistence
  3. Message Driven Bean (MBD) – Asyncronous beans

what to used and when to use

Session
Dealing with process, Its a temporary or volatile.

Stateless-Session bean without any instance variables. i.e. processed are not dependent on each other. Example could be Controlling Mechenism

Statefull-Session bean with instance variable i.e.

Entity
Dealing with DBMS or Data

EJB FrameworkEJB framework Session Facade (Mean entry point.)

Creating session bean from Web Sphear Application Development.

EJB Module -> Project -> EJB -> Create 2.0 EJB -> Project Name -> Module Deps -> Finish

  1. newInstance()
  2. ejbCreate
  3. setSessionContext

Technology

Reflection & Retropection
Runtime can find out class and charachterstics

Terminology
Call back method
Calles when an event occurs.

Thoughts on java

Java in not 100% OO?
1) Static classes, does not require instance to acces its charachterstics.
2) Reperesantation of real world entity without charachterstic is not possible. But we can create java class without any class variables.

Import Definations

Abstraction
Real world entity properties create class.

Coupling and Cohesion Software Engineering.

Advertisements

One thought on “ENTERPRISE JAVA BEANS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s