My question is... is there a disadvantage to getting the non-EJB classes involved here? Shouldn't these also be marked as EJBs?
I'm sure that doing it this way they'd still be getting the transaction handling benefits of Session Beans, but am I right in thinking they're not getting full advantage of bean pooling and such performance related benefits on the regular classes? I know how bean pooling works, but I can't get my head round how it works if the beans call regular classes.
In an application I'm involved in, we have a policy where we only create Session Beans in our application layer if we specifically need to contain everything we're doing in a transaction (updating several tables one after the other for example). Otherwise, we just implement our business logic in regular classes. The only other place we use Session Beans are to wrap up calls to the EntityManager in a DAO class way down in the persistence layer.
I guess it was decided at some point that creating Session Beans where we don't specifically need them (for wrapping everything in one transaction) is an unneeded overhead. However, I again wonder if we'd be missing out on the performance benefits of bean pools. Is this good practice? Or should we be marking everything as EJBs for the reason I mentioned?
If you realize that you need some of the EJB features (transactions, pooling, timers, asynchronous call, WS endpoint, access through remote interface, ...)
When might you realise you need pooling? When might you not need it? If I understand correctly, it's a performance benefit with no drawbacks... so why wouldn't we just add @Stateless on all our POJOs?
On a slightly related note, I was making a start to study for SCBCD 5.0. However, from what you say, it seems Java EE 6 has more features which I really should know about, so perhaps I should consider studying OCPEJBD 6 instead. This means I'd have to study the persistence exam separately though. Would you have any advice on this?
Which certification would you prefer to see a programmer with?
Perfect, thank you, that pretty much wraps this one up
I wish you luck for your OCPEJBD 6! Can I ask what you are using to study?
Maybe I should be creating test projects and playing around, but I worry I'd miss out a lot of theory if I spent time doing that...
The fastest and most reliable components of any system are those that are not there. Tiny ad:
Create Edit Print & Convert PDF Using Free API with Javahttps://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire