doctrine2 - How to avoid setters using Symfony with admin panel creator? -


i want avoid getters/setters hell in entities (here reason: http://ocramius.github.io/doctrine-best-practices/#/53), both popular admin panel generators:

need getters , setters render view.

my idea create dto object instead (http://ocramius.github.io/doctrine-best-practices/#/57) , use named constructors create entities. want call named constructor inside service. best way force admin panel generators use dtos persist/update data, can give me idea and/or example of practices in case?

the way imagined use dto instead of real entity, call prepersist/preupdate hooks , use custom service, looks confusing.

one of important aspect of ddd correctly identify bounded contexts (usually aligned sub-domains) , determine appropriate technologies , architectures use within those.

an admin panel sounds generic crud in nature. if that's case don't try fight , embrace crud within bc. trying implement pure domain model in bc isn't needed make things more complicated need be.

however, if determined complexity justifies domain model advise against using code generator. modeling reality of complex domain not easy task, , not 1 achieved tool.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -