Originally posted by Arathi Raj:
Hi,
I have a doubt. Can EJB be used for an intranet application. We are developing an intranet website for our company. Will it be good idea if we use entity bean to retrive and store data from and to database and to use stateless session bean for performing business logic.
I feel we can complete this job just using servlets,jsp and jdbc. but by EJB technology will there be any use. and will it be possible in future to move this intranet website to internet.
thanks
arathi
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Originally posted by Arathi Raj:
Hi,
One more quick question. Can we use just stateful session bean to reterive and store data to and from database?
Thanks
Arathi
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Originally posted by Murthy Narasimha:
EJB approach is used to separate business logic from presentation logic.
Originally posted by Murthy Narasimha:
If the application grows in size, servlets,jsp and odbc will not scale up.
Originally posted by Murthy Narasimha:
Using EntityBeans for small applications will be overkill.Instead you can go for DAOs.
Originally posted by Murthy Narasimha:
It all depends on your application.
I think Entity Beans are pretty much useless for all applications... large and small.
Originally posted by Murthy Narasimha:
If u write JDBC code for an app, what if the databse vendor changes? do u rewrite the code again? what if u need your application needs to run many databases? Do u want to miss container services like caching and pooling?
Do u want to miss services like state management and write your own? What is the need of the app server then?
Originally posted by Murthy Narasimha:
Performance is not the only issue in enterprise applications. Things like productivity and maintanability are also important.
Originally posted by Murthy Narasimha:
How will u handle distributed transactions?what about security? by writing ur own code (and probably miss deadlines)? do u want to miss RAD benifits of J2EE?
Originally posted by Murthy Narasimha:
You can use method level security using caller roles ..etc. But what if security rules/roles change if u want to add new security rules/roles? you have to edit the EJB code. Instead you can specify security conditions in deployment descriptor.And change descriptor accordingly.
Originally posted by Murthy Narasimha:
What you said about entity beans is true. But one should remember that entity beans are for representing coarse-grained data objects rather than fine-grained ones( which many people fail to recognize) . If one needs fine grained access then they should use other ways like DAOs.
Originally posted by Murthy Narasimha:
But if your application needs coarse grained aceess then I think entity beans are the best solution.
Originally posted by Murthy Narasimha:
Building your entity beans to be coarse-grained is a common performance optimization. It allows modeling the business objects with plain java classes rather than as entity beans, reducing the inter-remote object communication and transactional overhead associated with entity beans.
Originally posted by Murthy Narasimha:
Entity beans provide a clear model to represent persistent business objects in applications and their design. In object models, simple Java objects are normally represented in a straightforward way, but do not include the transactional persistence management functionality usually required for business objects.
Entity beans not only allow the same type of modelling and thinking about business objects in an object model, but they also encapsulate persistence mechanisms while hiding all complexity behind the bean and container services which is not the case with POJO.
This allows applications to manipulate them as Java object references. By hiding the persistent form and persistence mechanism from any calling code, entity beans allow for creative persistence optimizations by the container, while keeping the data store open and flexible, only to be determined at deployment time.
Originally posted by Pradeep Bhat:
Particluarly of Hibernate I have created a thread comparing JDO and Hiberante. Some one bother to answer
With the release of EJB 2.0, which includes local interfaces, improved CMP, and CMR, the recommendation is back to not using coarse-grained Entity Beans. If you don't believe then check the lastest edition of Core J2EE (the bible of J2EE best practices). At no point in time were Entity Beans ever truely meant for representing coarse-grained data, it was just a hack.
Don't get me started about those stupid light bulbs. |