Today let’s talk about User Management use-cases more closely. We need several database mappers, several services and facade pattern.
Let’s see how those will be integrated together.
As you can see we have layers in our user management subsystem.
First one is called Data mapping layer. Currently it contains five database mappers. Each mapper is used to perform two actions:
- Insert or update database record
- Delete record from database
Services layer performs all business logic. There will be service which will allow to create and register new user for example or delete user and all it’s messages/visits. We also need some service which will be used for constraints checking while performing various database operations. When user says something in chat room, his message should be logged inside database… And yes — this is another service.
In other words all business logic will be performed using services layer.
Finally we will use MUC manager (facade pattern) which will provide high-level interface for our use-cases. MUC manager won’t have any access to database and mappers, but will use services instead.
Currently I’m implementing database mappers. When it will be finished I’ll create several posts dedicated to business logic and will provide finished and precise interface for MUC manager. After that we will implement services (one by one) and finally integrate all of this together.