• 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

Managed Bean - Entity association in class diagram

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi people,
I think you all may have come across this situation - the Managed bean directly calls the Stateless session bean (or even if it does not), we end up using the entity POJO in the managed bean. So in that case, in the class diagram do you show the ManagedBean association with the Entity class? Do you show them as attributes in the Managed bean? I think my doubt is similar to what is there in this coderanch discussion. I would like to know your thoughts on this.
Thanks,
aditya
 
author
Posts: 188
11
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The managed bean calls the service(Stateless Session Bean) using DTO. When the service calls the data access tier, the DTO is converted to an entity using a mapper.

You can see the service layer flow here: http://amritendude.blogspot.in/2012/07/unit-testing-ejb-30-and-jpa-20.html
 
Aditya Kumar
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amritendu,

I am yet to see the link you posted (blocked here at work) but my quick thought - can't we use the entity object that can be exposed to managed bean? Do we still have to use DTO here?

Aditya
 
Amritendu De
author
Posts: 188
11
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would rather suggest just to use @Repository/DAO to make use of entities. If you are using @Service then DTO should be used. In my paper as far as I remember I did not use services. I just used DAOs with entities.
 
Aditya Kumar
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amritendu,

I am sorry - I am not basing my solution on Spring. Do you think I should be?

Aditya
 
Amritendu De
author
Posts: 188
11
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No spring use jee solution
reply
    Bookmark Topic Watch Topic
  • New Topic