• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Managed Bean - Entity association in class diagram

 
Aditya Kumar
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • 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
 
Amritendu De
author
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • 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
  • 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
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • 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
  • 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
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No spring use jee solution
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic