[jboss-user] [EJB 3.0 Users] - Re: Design: When the line between domain objects and service

2009-10-01 Thread Wolfgang Knauf
Hi, I think you need a layer beetween MailBox and your EJB, which encapsulates the logic specific to the mailbox implementation. findMailbox should not return the entity, but the the implementation of the layer. Assume an interface (or an abstract base class): public interface IMailBoxHandler

[jboss-user] [EJB 3.0 Users] - Re: Design: When the line between domain objects and service

2009-09-29 Thread le_garcon_enerve
Hello! In the case of the mail-box, why not push the functionallity of reacting to an email into the implementation of the mailbox? E.g. change the mailbox.addMessage() method and dynamically set up a reference to the mailbox when you startup the bean. In general, you could use an

[jboss-user] [EJB 3.0 Users] - Re: Design: When the line between domain objects and service

2009-09-29 Thread ttarhan
Don't read too much into my specific example. I'm trying to illustrate a point. My point is that EJB and JPA force us into a model where our domain objects cannot rely on any container provided services. I fully understand the reasoning behind it. However, I'm asking for ideas on elegant ways