There are different names that people use to call different tiers in a typical enterprise application. A service layer or otherwise a business logic layer is where you write the business rules / process which is the backbone of what you are developing. The reason being that when your business rule or process changes, you only have to change it in only one place.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joined: Oct 04, 2006
I also investigated and below is the understanding
Action calls -> Controller Action Servlet class --> calls the service method of BO( like getCustomerService() of class CustomerService for BO Customer) --> calls DAO in this case it is CustomerDAO interface for getCustomer() method --> calls DAOImpl in this case CustomerDAOImpl (DB connection and persistence logic) --> DB calls
Controller Servlet --> free to ask about the service of BO( Customer) that is getCustomerDetails etc..
Customer POJO --> used as DTO to hold the data and nothing knows about the controller,DAO or Service Layer
Service Layer --> contains the service calls including business logic as per business requirement or validation at this level just to check the instance is customer or not before persisting the data into db.
Persistence layer --> connection to db , update,save,select query using either JDBC,JDBCtemplate,Hibernate,JPA
let me know if my understanding is better than last time.