[TYPO3-50-general] Last minute concept fix? Incosistent class naming for domain models ...

Christopher Hlubek bruno.bolzano at gmail.com
Wed Jun 3 16:51:26 CEST 2009


2009/5/28 Robert Lemke <robert at typo3.org>:
> Hi folks,
>
> (please answer in typo3-project-5_0-general)
>
> while writing a little app based on FLOW3 I once more realized that our
> conventions for the naming of the model and repository classes are not
> consistent. Our names currently look like these:
>
> \F3\Blog\Domain\Model\Blog
> \F3\Blog\Domain\Model\BlogRepository
> \F3\Blog\Domain\Service\BlubbService
> \F3\Blog\Domain\Model\BlogValidator
>
> you see?
>
> The consistent alternative would be something like:
>
> \F3\Blog\Domain\Model\BlogModel

At a first glance I really don't like the Model suffix for model
classes. It's a Blog after all. The naming of properties would be no
longer consistent (like $postModels which is awful or $posts but
containing PostModel objects). I think it's a general rule of thumb,
that variables should be named after the type if there is no other
special meaning.

The other classes like a repository, the validator and service are
rarely used inside the domain model itself and are more a technical
thing. But I think one of the greatest achievements of DDD is the
language part and that would be polluted by the Model suffix.

Greetings,
Christopher


More information about the TYPO3-project-5_0-general mailing list