Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

All About Entities

 
Kalyana Sundaram
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(1) In general, Entities model the Business objects that can be represented as Nouns. Having said that what kind of Business logic may go into it. Because after all Entities are there to represent something and may be transported across networks.

(2) EJB3.0 does not mandate a Entity to be a serializable. In which case how is that can be transported across a network.

Java Gurus please throw some light on this...

-=- Kalyan
 
Steven Young
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm no Java guru, but I'll contribute my opinion:

(1) Because entities are now POJOs, you can add business logic if you choose to. However, the recommendation is not to add business logic, stick to using just getter & setter methods.

(2) If you need to transport your entity across the network, I think you must implement Serializable. If you are just using your entity locally and passing it around within the same JVM, you don't need to implement Serializable. Unlike in earlier versions of EJB, where your only choice of transporting entity beans was using RMI, even if it was just a local pass.

That's my theory anyway. Anyone, please feel free to correct.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic