[TYPO3-mvc] getter/setter generation

Frans van der Veen frans at netcreators.com
Wed Jul 15 12:32:56 CEST 2009


Sebastian KurfŸürst wrote:
>> BTW: how do you guys handle large domain objects? Using getter/setter or
>> just set every flat property to public?
> Definitely getter/setter. That's a prerequisite f.e. for effectively
> using Aspect Oriented Programming under FLOW3.

Have you thought about implementing a __call method (in the
AbstractDomainObject) which returns / sets the property if no method is
defined, otherwise it calls the gettter / setter method? This saves you
the creation of many get/set methods, but gives you the freedom to
create one if needed. Another advantage is you can always (and thus
should) call a get/set method on the domain object (which hopefully will
discourage referencing public properties directly).

Cheers,
~Frans


More information about the TYPO3-project-typo3v4mvc mailing list