Reputation:
Is model comprises of model object and classes that perform database connection and database operation and service class?
It is normally believed that service layer fills the gap between controller and model.So,what exactly service layer does,it creates the object of class that performs the database operation?
Upvotes: 1
Views: 224
Reputation: 58444
Structures in service layer do not make database connections.
The connection is created at the bootstrapping stage of application and via builder/factory, it is passed to each of data access object (usually implementing DataMapper pattern). This is the part that actually interacts with database. The rest of structures in domain business logic part of application has no idea, where or how the information is stored.
Service layer itself has two major groups of structures:
Upvotes: 1