• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

All About Entities

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Evil is afoot. But this tiny ad is just an ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic