• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

All About Entities

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
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.
A teeny tiny vulgar attempt to get you to buy our stuff
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic