• 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

Using entity beans in project

 
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
I am confused why we use entity bean when we can do everything using stateless session bean and dataaccessobject.Why we need an object oriented view of tables.
PLs clarify
candy
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
it is all because of a big boss "Container".
In a table, if i have 100 fields, i can tell the container to take care of any no. of fields. So that the container takes cares of those fields i.e. the container is responsible for their persistence, their isolation level, transaction etc ..
 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Augg
What do u mean by container takes care of everything.It only takes care of update and other query we have to write with EJBQL.And performance wise entity beans are not so good.
And ultimately isolation level of database is used.
Give some more solid logic for using Entity beans
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's pretty simple really. You will write only about 1/10 of the code if you use Entity beans than if you write your own DAO's. It's much, much simpler to use Entity beans.
And performance isn't always a critical factor. Entity beans perform well enough for many, many applications. Even applications where speed is critical could use them for parts of their application -- speed is usually only critical in a few use cases out of many.
It's a tradeoff of programmer effort for runtime performance, plain and simple.
Kyle
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Augg,
Thanks for joining JavaRanch, but could you take a quick look at the naming policy and edit your profile accordingly.
 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Kyle
BUt dont u think its more easier to use sessionbean and dataacceessobject than entity beans.And also if Entity beans are not complicated then why the concept of JDO with session bean is coming up so fast.
Plz clarify
THanks
candy
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi candy,

BUt dont u think its more easier to use sessionbean and dataacceessobject than entity beans.

According to me only if we have used both approaches for a while, we would be able to gauge what works better for a project. Nothing is a "silver bullet" you know.
On serverside.com you would find long dicussions about this topic. I remember myself reading it and now I don't recall the url but surely good would help you find that
Regards
Maulin
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by candy varma:
HI Kyle
BUt dont u think its more easier to use sessionbean and dataacceessobject than entity beans.And also if Entity beans are not complicated then why the concept of JDO with session bean is coming up so fast.
Plz clarify
THanks
candy


No, I don't think using DAO's are easier than Entity beans -- quite the opposite in fact. If you'd sit down and try to write a few yourself you'd come to the exact same conclusion. The reason why JDO's are so popular is that they give the exact same object to relational database mapping capabilities of cmp's without the security and transactional control aspects of ejb's that many people feel are extraneous -- but that honestly don't get in your way that much.
Kyle
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic