Implementing the service layer
Each interface defined previously will have an appropriate implementation. The implementing classes will follow our DAO naming conventions by adding Impl
to the interface names resulting in CompanyServiceImpl
, ProjectServiceImpl
, TaskServiceImpl
, TaskLogServiceImpl
, and UserServiceImpl
. We will define the CompanyServiceImpl
, TaskServiceImpl
, and TaskLogServiceImpl
classes and leave the ProjectServiceImpl
and UserServiceImpl
as an exercise.
The service layer implementations will process business logic with one or more calls to the DAO layer, validating parameters, and confirming user authorization as required. The 3T application security is very simple as mentioned in the following list:
A valid user is required for all actions. The
actionUsername
must represent a valid user in the database.Only an administrator can modify the
Company
,Project
, orTask
data.Only an administrator can modify or add users.
Our service layer implementation will use the isValidUser
...