• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cade component diagram and DAO

 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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








 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
John Lincoln
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They don't need to be in the component diagram because they aren't your components. They are part of JEE.
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I included 'EntityManager' in the class diagram with a stereotype '<< JPA >>'.
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Ranch Hand
Posts: 133
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic