Q:

When I should create a service and where is the best place to place the class?

I'm working on a project where I'll have many listings. In many cases these listings often will use the same code (related to Doctrine entities and master tables) so I'm thinking, should be right to define a service where all this common code lives and then call the service or any method from the service controller whatever I need? IMHO is the best way to deal with this or the other I'm thinking is use Traits, anyway what I need is to get some ideas from people here around this topic as for example how do you work with this in large projects, or if it's a good practice, or if I'm in the right path and last and not least where I should place the controller with all the code
PS: I forgot to mention I'm working with Symfony2 latest (2.5.5)

A:

You should create a service as soon as you need the same code in different bundles.
You could create your service in a new Bundle, e.g. CoreBundle, it will contain the common logic of all your application.

