• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing n arguments on dataobject in entity bean create?  RSS feed

 
kapil Gupta
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Am using SessionBeans on top of my EntityBeans. When the client code calls a method on session bean, it creates a data object(consisting of primitive data types) passes it as arguement to method call. My question is should I pass a dataobject or individual primitive types to create method of entity bean? Is it a gud design strategy to keep dependency on dataobject in entity bean?
Thanks,
Kapil
 
Jeremy Hsu
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I believe your entity bean has local interface instead of remote interface. Therefore, it is a better practice to keep your Entity Bean as fine grained as possible if you are using a local interface for your entity bean.

The reason is because the DataObject or DTO (data transfer object) can be changed (in order to fit the use case), and if the entity bean depends on such an object, every single change will require you to redeploy your entity bean. Therefore, use the primary object, in other words, lots of setXXXX methods calls in your SessionBean methods.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!