On 4 September 2014 17:01, Tom <[email protected]> wrote:

>
>
> Le jeudi 4 septembre 2014 16:42:11 UTC+2, Sebastian Brandner a écrit :
>
>> if i understand this correctly, it will require to define for every
>> entity and it's repo a service.
>>
>> it's a good solution but requires much maintainance if you have 20+
>> entities.
>>
>
> It's a little more work when creating everything, but more inline with
> nowadays best practices
> The repo definition are not so likely to change over time, so mot much
> maintainance once created
>

I would also suggest going down the Dependency Injection route: it's more
work, but you decouple your logic from:

 - the ObjectManager API (if you are not using it)
 - the service-locator (ObjectManager#getRepository() is actually a
locator, designed as utility method, abused by the entire world :-D )

Additionally, all the benefits of Dependency Injection.

It's not necessarily a big advantage, but it makes the code much more
portable.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to