SCEA5
SCEA 5.0, SCBCD 5.0, SCWCD 1.4, SCJP 5.0
OMG-Certified UML Professional, Intermediate; OMG-Certified UML Professional, Fundamental
Janis Kazakovs wrote:In your case, Entity is a Business Object. It encapsulates your business data, which is persisted to a database. So, I would say, simply merge them.
Janis Kazakovs wrote:If you want to change the status of two entities you can do this either in Session Facade or Application Service, depending on your design.
SCEA5
SCEA 5.0, SCBCD 5.0, SCWCD 1.4, SCJP 5.0
OMG-Certified UML Professional, Intermediate; OMG-Certified UML Professional, Fundamental
Janis Kazakovs wrote:Hello Nithiraj,
I assume, that when you mention Entity you mean EJB Entity, from which I conclude that you host your application (or part of it) in EJB container. EJB Entity is persistent domain object, which encapsulates your business data and can be persisted to a storage by means of a persistency framework. In other words, Entity is more technology specific, where Business Object is more business domain specific, since it captures you business requirements, but both of them have the same conceptual meaning.
Janis Kazakovs wrote:
Now, you wan to decide where to put the logic to retrieve and store your business data. You are right, putting the data access logic in Session Facade wouldn't be a good idea, but you can use Data Access Object to encapsulate that logic and access it from you Session Facade. This is just an example and not advice. You can also follow approach described in Domain Driven Design and use Repository.
Janis Kazakovs wrote:
With regards to your question about Application Service, I cannot give you a definite answer; it depend on your design. You would like to use Application Service to encapsulate a use case specific logic that operates on several Business Objects. However, the same can be done in Session Facade. Again, it depend on your design decisions.
Application Service, most probably, will be POJO, while Session Facade will be your EJB session bean. Session Facade will call Application Service.
This is one of the possible sequences: SF -> AS -> BO ->DAO
Regards,
Janis
SCEA5
SCEA 5.0, SCBCD 5.0, SCWCD 1.4, SCJP 5.0
OMG-Certified UML Professional, Intermediate; OMG-Certified UML Professional, Fundamental
SCEA5
SCEA 5.0, SCBCD 5.0, SCWCD 1.4, SCJP 5.0
OMG-Certified UML Professional, Intermediate; OMG-Certified UML Professional, Fundamental
Your buns are mine! But you can have this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
|