Answer the question
In order to leave comments, you need to log in
What is your optimal set of patterns?
Over time, upon reaching a certain experience, you begin to understand that the standard set of classes in the MVC paradigm is not enough, so looking towards DDD, there is another feeling that there are too many patterns offered by this approach to design and development. So far I've singled out for myself:
1. Entity. Entity, contains setters and geters, only logic associated with the entity.
2.Service. The service contains the main business logic.
3. Repository. Contains basic CRUD storage operations.
4. DataMapper. Transforms the data received from the store into an entity object.
What is your standard set of architectural decisions?
Answer the question
In order to leave comments, you need to log in
I take patterns easier. A pattern is a certain component of the architecture (logical, physical, behavior, etc.) that I, as an architect, can reuse when working on the architecture of the system. There are components that are known to everyone, and there are those that only I need due to the specifics of the systems I develop. I can combine several patterns into one, I can refine an existing pattern to the condition I need, I can do something completely of my own.
You have listed some of the well-known ones. You can also see, for example, here: Catalog of Patterns of Enterprise Application Arch... . Perhaps you also use many of these patterns, but you did not name them in your question. But over time, perhaps you will accumulate your own experience.
There shouldn't be a "standard set of classes" in MVC, that's the paradigm. All standard sets of classes are nothing more than an architecture imposed on you by monopoly frameworks.
In my self-written solution, this is how:
Model is one row in the database that has a primary key and represents some kind of entity that the program operates on. This is a class with set/get + business logic related to this model.
For example: $user->getFullNameOrLogin()(); // returns the full username or login. This is the business logic of a specific model.
DataMapper - CRUD over Entity.
$userMapper->findById(1) will find an entry in the user table and instantiate and return that user's Model based on the table row.
Service - authorization and authentication, for example, getting a list of records based on the parameters from the request. I rarely use.
I'm too lazy to write further, I'll go smoke ..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question