Just like with the DAO layer, each implementation type has its own implementation of service classes. But all of the implementations have both org.packt.academic.student.portal.service
and
org.packt.academic.student.portal.service.impl
packages. The purpose of the business layer is to implement business logic with the use of the DAO objects.
Given the LoginService
interface of the SMP as follows:
public interface LoginService { public boolean isAdminUser(Login login); public boolean isStudentUser(Login login); public boolean isFacultyUser(Login login); }
The implementation of this interface is just a typical Transactional
class. A @Transactional
class starts with a transaction on each method start, and commits it on each method exit (or rollback, if the method was failed due to an error). Note that since the transactions are in the method's scope, and inside method we are using DAO, the DAO...