[TYPO3-50-general] Last minute concept fix? Incosistent class naming for domain models ...
Thomas "Thasmo" Deinhamer
thasmo at gmail.com
Wed Dec 2 23:24:44 CET 2009
Good evening,
I've read throu the whole thread, neither beeing a DDD expert,
nor a very experienced PHP developer, but the current structure
of the model directory seems a bit confusing to me. Mainly because
the model files and classes itself have no 'Model' suffix.
I try to avoid nit-picking, also because this topic has been
discussed a lot, but what do you think about this approach:
Classes/
Controller/
BreakfastController.php
DinnerController.php
LunchController.php
Model/
Repository/
EggRepository.php
PepperRepository.php
SaltRepository.php
Service/
EggService.php
PepperService.php
SaltService.php
Validator/
EggValidator.php
PepperValidator.php
SaltValidator.php
Egg.php
Pepper.php
Salt.php
You may even call the 'Model' directory 'Domain',
or even call the model files 'EggModel.php' etc.
But this way the structure seems more 'native'
to me. Please tell me your oppinions.
This example was chosen, because, as what I understand,
the Model itself is e.g. an 'Egg' or the 'Pepper', and all
the other objects, like validators, repositories, services
correspond with the model itself. So it was clear for me to
put the models on level up the related objects.
Any thoughts on this?
Thanks a lot for participation,
Thomas
Robert Lemke schrieb:
> 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
> \F3\Blog\Domain\Repository\BlogRepository
> \F3\Blog\Domain\Service\BlubbService
> \F3\Blog\Domain\Validation\BlogValidator
>
> Should we implement that for FLOW3 1.0.0 alpha 1? Changing it later
> would cause some trouble I guess, especially for Extbase.
>
> Cheers,
> robert
>
More information about the TYPO3-project-5_0-general
mailing list