[TYPO3-50-general] Last minute concept fix? Incosistent class naming for domain models ...
Xavier Perseguers
typo3 at perseguers.ch
Thu May 28 10:37:19 CEST 2009
Hi Robert,
>> Hi Robert,
>>
>> I feel that the domain object and its connected repository belong
>> closely together, so to me it makes sense to have BlogModel and
>> BlogRepository in the same directory.
>> Same for the validation: As the BlogValidator validates the Blog Domain
>> Object, Validation is a property of the Domain Model and should thus
>> reside in Model\BlogValidator.
>
> If you want them all in one namespace it would need to be like
>
> \F3\Blog\Domain\BlogModel
> \F3\Blog\Domain\BlogRepository
> \F3\Blog\Domain\BlogValidator
>
> but we shouldn't put a BlogValidator into a Model namespace - it's not
> the model, is it?
>
>> So, I would leave it as it is now, because to me, Blog, BlogRepository
>> and BlogValidator are one single thing, and they inherently belong
>> together.
>
> Just for the sake of discussion: We could also group the models by
> aggregates.
>
>
> F3\
> Blog\
> Domain\
> Blog\
> BlogRepository
> BlogModel
> BlogValidator
> BlogOwnerModel
> BlogOwnerValidator
> BlogService
> Post\
> PostRepository
> PostModel
> CommentModel
> TagModel
>
> Comments?
It seems to be a bit overkill for "simple" domains but I guess that once
the domain become "real-life", then it could make sense.
But first idea of at least separating repositories, model classes,
services and validators would already be much better.
--
Xavier Perseguers
DBAL-Member
http://xavier.perseguers.ch/en/tutorials/typo3.html
More information about the TYPO3-project-5_0-general
mailing list