[TYPO3-mvc] How to load a list of value objects?
Henjo Hoeksma
me at henjohoeksma.nl
Tue Apr 19 00:44:42 CEST 2011
On 2011-04-18 15:09:34 +0200, Stefan Isak said:
> Hi,
>
> almost a year ago I asked a similar question with the subject: "Query
> value objects. How can I handle it?"
>
> Jochen Rau answered:
> You are right: In DDD there are no Repositories for ValueObjects. But
> I suggest to be pragmatic ;-)
> I did not encounter a major drawback having a Repository for
> ValueObjects -- yet ;-)
>
> So today I also use repositories for value objects (only if it's
> useful, not in general).It feels right and I don't see a violation on
> concept of value objects.
>
> Cheers
> Stefan
>
> On Apr 18, 2011, at 2:37 PM, Martin Kutschker wrote:
>
>> Am 18.04.2011 11:51, schrieb Franz Koch:
>>>
>>> I know that there's a statement that any model having a repository has
>>> to be a aggregate root, but I
>>> can't second this.
>>
>> And I don't think it's true. IMHO there are (only?) two rules.
>>
>> Any model within a repository may be accessed only via the repository.
>> Any model that is not a an aggregate root may be accessed only via
>> models that are aggregate roots.
>>
>> So I think if you have DB-based value objects it is sensible to add a
>> method to you repository to
>> list all values current available. So as long as the query factory code
>> of yours is within the
>> repository I see no fault in it (besides that it is cumbersome).
>>
>> Masi
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
I knew I read it somewhere ;-)
Henjo
More information about the TYPO3-project-typo3v4mvc
mailing list