• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

entity beans

 
capri
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
some where i heard that the entity beans should not be accessed remotely, its a bad design itself by the ejb creators
is it true
can some body give me more information about this
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is true in the majority of cases. Entity Beans represent your data model, giving someone direct access to your Entity Beans is essentially like giving someone direct access to your database. As you can probably imagine, this is frowned upon.
Furthermore, you would be tightly coupling your external clients with your Entity Beans and hence your data layer. A change in the database frequntly causes a change in the Entity Bean Layer which may or may not then cause a change in the external clients.
Better design dictates publishing a set of very stable interfaces that represent course-grain services for the client. In the EJB world this means using one or more Session Beans to act as a facade to your Entity Bean Layer and publishing those Session Beans for external use. This minimizes coupling and simplifies interaction with your system. The external client probably doesn't care how you model your database (which the Entity Beans would basically expose), they only care what services your system can provide.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic