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

Andreas Förthner andreas.foerthner at netlogix.de
Thu May 28 10:39:35 CEST 2009


Hi Robert,

Robert Lemke schrieb:
> Hi Sebastian,
> 
> On 28.05.2009, at 10:25, Sebastian KurfŸürst wrote:
> 
>> 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?

Yes, that's exactly what I meant. We would pollute the Model namespace 
with a lot of validation classes.

>> 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?

In case of clean namespaces this looks really good to me. But we will 
get a lot of folders containing only one or two classes, do we really 
want that?

Greets Andi


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