sCOPE oRGANIZATION wIDE
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.
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
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.
- Application control
- Infrastructural Capability
Application Server Main Properties
- Transaction management
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
- Session Bean
- Stateless bean
- Statefull bean
- Enttyty Bean
- CMP – Container Managed Persistence
- BMP – Bean Managed Persistence
- Message Driven Bean (MBD) – Asyncronous beans
what to used and when to use
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.
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
Reflection & Retropection
Runtime can find out class and charachterstics
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.
Real world entity properties create class.
Coupling and Cohesion Software Engineering.