• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB - Declarative operations

 
Sub swamy
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we use EJB's in our application is there any advantage in having light weight EJB's that delegate the actual implementation to POJO classes rather than having EJB's perform the implementation.

Also, when we have POJO classes, how does the application take advantage of declarative transaction and security control ?
 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Subramanian Narayanaswamy,

In my projects, I always put Business Logic directly in the EJBs.
This way, I know that my code is thread Safe.
And it saves me having to instantiate a new POJO class.

I have "tools POJO class" too, with static methods only (formating, date manipulation, etc.)

Hope it helps,

Beno�t
 
Sub swamy
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response.

Wanted to know if the use of POJO's was any better and what the impact of container transaction settings would be when we use POJO's.

Some specific clarifications are
1) Would POJOs make the application light weight and hence faster ?
2) In this case, wont BMT be a better approach than CMT ? - no entity bean stuff here.

And, a related question - can we use stateful session beans for large enterprise applications without compromising on performance and scalability ?
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The CMT feature is available only with EJBs. If you want to use POJOs you have to handle the transactions manually. The EJB 3.0 the Session beans and MDBs are POJOs. They do not implement any additional technology specific interfaces other than the business interfaces.

Thanks
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Use of stateful session beans is depends on your business requirement. If you have to store large data in memory then it is feasible to use stateful beans (You may consider session objects instead of this).

While using BMT you need to do lot of coding and have to manually control the transaction demarcation.There may be some problems if you are not really the expert on the transaction and the application server platform. I think in most of cases the CMT is useful unless you have specific business requirement.


Thanks
 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Subramanian Narayanaswamy,

If you need one of those features, developing with EJB is faster and more secure :
- Security
- Transaction support
- Persistence
- Concurrency
- Asynchronous messaging
- Clustering
- Load Balancing
- Fail-Over

Beno�t
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic