I'm sure this is a problem a lot of other people have come across but there seems to be very little coherent discussion on the issue, so I'd very much appreciate any views people might have on the matter.
The problem is whether or not you compromise your object-oriented principles and stick with the EJB dependency injection annotations and a weak domain-model, or strive for a richer domain model with a sub-optimal JDNI lookup solution.
Take adding an item to simple shopping cart as an example.
The code above makes Cart dependent on Product and Price, when in reality Cart only cares about Order. The logic in the addItem method should really be in the Order object, but because Order is a POJO you can't inject the necessary EJB references. What's more, because the EJB interfaces are local they don't have a JNDI name assigned in the same way remote one would.
There also seems to be very little guidance from Sun on this matter; ALL the examples in the JEE 5 Tutorial follow the weak domain model approach with business objects presented as little more than dumb placeholders for persistent data
What are people's thoughts on this? When it comes to EJB do we simply have to accept that local service lookups from POJOs aren't a viable option?