Symfony2 applications typically have a collection of objects. Doctrine is EntityManagercommonly used to retrieve and store these objects.
Entities are used in many places in an application; for many objects and for the entity, it makes sense to complete the processing of this object plus extraction / saving in the service.
For example, for an object there Usermay be methods UserServicewith methods fetchUser($user_id)and persistUser(User $user)(or maybe just fetch()and persist()), this is just an example).
An application can have many essentially oriented services for extracting and saving entities. Such services will be similar in their interfaces, differing in the type of entity being processed.
The fact that the application may contain many essentially oriented services seems to be a common situation. It follows that the question of the names and architecture of such services is a common problem.
For a new application that requires the creation of, for example, base classes EntityServiceand child UserService, WidgetServiceand ProductService, it repeats itself, since the problem must be solved in the means for solving such aspects.
Are there best practices for embedding such entity management services in a Symfony application?
It seems like this should be a problem, a figurative pattern that should be followed.
Are there any naming conventions that should be followed?
I noticed that in different applications, both the "UserManager" and the "UserService" have both service names selected. Are there prevailing agreements?