Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity EJBs.

 
Cristian Cardenas
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working with EJB 2.0 and I thought that is a good approach to create one Entity Bean for every table on the DB schema, but a friend of mine told me that it's not a good practice.
Is it right? Which kind of tables are good to be modeled as Entity Beans and which not?
Thanks a lot.
Cristian.
 
Ihab Ismail
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Cristian Cardenas:
but a friend of mine told me that it's not a good practice.

Did your freind tell you why it's not a good practice?
 
Manas Ahlaad
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the idea of having an entity bean for each table is in practice but not advised. problems are
1. increased network traffic since number of calls are increased
2.databse schema dependency i.e tight coupling between database schema and entity beans
3.not manageable since number of tables are generally large in a typical application scenario.
4.increase in granularity ,which results in client handling relation between entity beans.
for all these reasons fine- grained bean approach is not opted.
reference :
http://developer.java.sun.com/developer/restricted/patterns/AggregateEntity.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!