File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes EJB or not ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "EJB or not ?" Watch "EJB or not ?" New topic
Author

EJB or not ?

Benoît de Chateauvieux
Ranch Hand

Joined: Aug 10, 2007
Posts: 183
Hi Ranchers,

I'm working on my part 2 and I need to design a component that allows the integration with an external JMS system.
My component
- is not transactional.
- doesn’t need to be remotely invoked.
- is a lightweight component and its construction isn’t costly.

I'm planning to design it as a POJO.
It's less "modular" and less "service oriented" but I don't think I need an EJB.

What's your opinion ?
Do you think it can impact the scalability or other system quality ?

Thanks a lot for your responses,

Benoît


SCJP5 | SCBCD5 | SCEA5 Part 1
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

It sounds like a POJO to me!

Which version of the exam is this? JEE, right?

Yeah, it sounds like a POJO.

-Cameron McKenzie

Benoît de Chateauvieux
Ranch Hand

Joined: Aug 10, 2007
Posts: 183
Thanks for your answer, Cameron !
Yes, it is SCEA 5.0 for Java EE.

For you, what would be the advantages of designing it as an EJB ?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Well, what is an EJB in JEE5?

This clearly isn't a persistent object, so no JPA is in use.

So, it really must be designed as a POJO. From there, we can provide a Java Enterprise Edition 5 annotation on the bean so it can take advantage of some EJB container services. Which ones might this bean benefit from? Perhaps multi-threaded control? Perhaps the ability to apply security attributes to certain methods? Does this bean need to control any transactional attributes of JPA beans that it invokes? If so, perhaps using an annotation to characterize it as a session bean, and then slapping some declarative transactional attributes on it might be helpful.

There's always huge benefits to using an EJB. But, at the same time, one of the biggest downfalls of J2EE development over the past five years has been the overdesign of components. Too many people have overdesigned components into EJBs, causing huge problems.

But the SCEA exam isn't a place to be asserting any personal beliefs about application design. It's a place to be demonstrating that you know how to use JEE5 components. Sometimes it's not as important to design these things according to what you think might be the best approach in your day-to-day job, but instead, according to what you think the examiners want to see in your final project.

Is that a wishy-washy enough answer for you?

-Cameron McKenzie

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: EJB or not ?