aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Cade component diagram and DAO 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 "Cade component diagram and DAO" Watch "Cade component diagram and DAO" New topic
Author

Cade component diagram and DAO

John Lincoln
Ranch Hand

Joined: Feb 11, 2003
Posts: 192
Hi,

I amusing EJB3 /JPA for the solution. I have stateless session beans as part of the solution which has Entity manager (used for all CRUD operations of database)

The business methods are within the stateless session bean, in short i don't have any separate DAO class. The entity manager is doing the abstraction.

How do i represent this in my Component diagram since entity manager is a EJB3 frame work class.

In the case example there are Inventory DAO, Pricing DAO and the sequence diagrams do show Entity Manager.

Should i give the DAO name and specify these are entity managers in brackets

Please advise


thanks








Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29241
    
139

In the sequence diagrams, I showed the session bean calling the entity manager. I named that class entity manager since it is a built in class.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
John Lincoln
Ranch Hand

Joined: Feb 11, 2003
Posts: 192
Thanks Jeanne.

In the component diagram, how should i represent them

I mean in the integration layer, just specify an instance of entity manager ( that is part of stateless session bean).

Or

There is no need to specify this at all.

Please advise
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29241
    
139

They don't need to be in the component diagram because they aren't your components. They are part of JEE.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

I included 'EntityManager' in the class diagram with a stereotype '<< JPA >>'.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Luay Abdulraheem
Ranch Hand

Joined: May 18, 2011
Posts: 65
Question1 : Including Entity Manager in Sequence diagram means that we need to include in Class diagram ?

Question2 : In general, if Entity Manager is included in Sequence diagram,is this sequence right or wrong :
...... stateless --> DAO --> Entity Manager --> Entity
OR
...... stateless --> DAO --> Entity --> Entity Manager

Question3 : Do we also need to show in our Sequence diagram, the Entity that is used as well ?

Thanks


SCJP, SCWCD, OCMJEA, OCEEJBD, OCEJPAD, TOGAF® 9 Certified, OCEJWSD
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

1) Some people have, some people haven't as they feel its part of API and no need to include - so, its upto you.

2) From the DAO, you would be calling the EntityManager only - why would the sequence goto Entity?

3) This is a tricky one. If the Entity is being created, its easy to show. In other cases, not so easy.
Luay Abdulraheem
Ranch Hand

Joined: May 18, 2011
Posts: 65
1) Can I show the Entity Manager in Sequence diagram, and not show in Class diagram ?
2 & 3) So what you are saying is that in Search operation we don't need to add the Entity in our Sequence diagram, but in Add operation we do ? or never show the Entity at all ?

Thanks,
Krzysztof Koziol
Ranch Hand

Joined: Nov 19, 2006
Posts: 133

John Lincoln wrote:Hi,

In the case example there are Inventory DAO, Pricing DAO and the sequence diagrams do show Entity Manager.



Those are DAOs to external systems and have nothing to do with EM. In which diagram InventoryDAO or PricingDAO are used?

The question is why EmailDAO (external system as well) is not show in the 3rd diagram nevertheless that there is a call "sendEmail()".

Share your opinion, please.


SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCEA/OCMJEA 5.0
Dumitru Postoronca
Ranch Hand

Joined: May 06, 2008
Posts: 46
Jeanne Boyarsky wrote:In the sequence diagrams, I showed the session bean calling the entity manager. I named that class entity manager since it is a built in class.

Jeanne, are you saying that you didn't use the DAO pattern for DB access in your application?
I believe the 'deprecation' of DAOs for database access has it's upsides and downsides. Is there a community consensus regarding this practice? (I was under the impression that it's still debated )
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29241
    
139

Dumitru Postoronca wrote:Jeanne, are you saying that you didn't use the DAO pattern for DB access in your application?
I believe the 'deprecation' of DAOs for database access has it's upsides and downsides. Is there a community consensus regarding this practice? (I was under the impression that it's still debated )

I didn't use the DAO in my submission because the system is so simple. In real life, I do use a DAO for JPA. As does the CodeRanch forum software.

You are correct that the topic of whether to use a DAO is not universally agreed on. I personal favor it. I do many things in real life that I didn't do in the exam submission and vice versa.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cade component diagram and DAO
 
Similar Threads
please help for clustering it requires remote or local interface?
Class diagrams...
using JPA and JDBC together
Business Logic in EJB3 SessionBean?
Can i have a private variable in a stateless