Originally posted by Srikanth Nittala:
Mine is a classic JEE application with this flow ( JSF + EJB + Oracle) on OC4J.
Originally posted by Srikanth Nittala:
In the EJB3 books and Sun's JEE5 tutorial i ve read so far, they always have an EJB ( Session bean) thats filled with business logic and calls to DB via Entity Manager(injecting it) .
But is it a good practice to have business logic and DB calls in EJB that way? Now if you add service class(using Spring) or an DAO ( that does DB calls for each entity) you lose the power of injections and container-managed Entity managers. And I dont see the use of Spring services here as i think it is an overhead code for a simple flows like CRUD.
So in short i guess my question is " Is it ok to have all the business logic in session facade EJB itself? Isnt the facade EJB supposed to be neat and clean just doing security and transactions? What are the best practices for JEE architecture?
Originally posted by Aurelio Calegari:
You don't need DAOs if you're using App Service + JPA, because JPA is itself a domain store. You may want to use DAOs when you're encapsulating access to legacy systems either through using raw JDBC directly or emulating a screen scraper. You may want to combine App Service + JPA for trivial stuff and App Service + DAO to run stored procedures, for example.
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Certified for SCJP, SCJD, SCDJWS,SCEA and IBM 141- XML& Related Technologies
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Certified for SCJP, SCJD, SCDJWS,SCEA and IBM 141- XML& Related Technologies
Grow a forest with seedballs and this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|