[TYPO3-mvc] ValueObject against Entity

Stefan Frömken firma at sfroemken.de
Wed Sep 5 07:33:21 CEST 2012


Am 04.09.2012 17:22, schrieb Claus Due:
> Hi Stefan,
>
>> hmmm...works perfect in my sample extension. I have only one domainmodel registered as value object in my extension and marked it as AggregateRoot. It works without any problems.
>
> Also if your ValueObject has properties which are relations to other DomainObjects…? As far as I know that should not be possible. But I could be wrong about that.
>
> Cheers,
> Claus
>

Hello Claus,

I'm sure it will work. Also with related Domainmodels. The problem is, 
that everywhere you only find a description how it should work with the 
eyes of DDD. But there is no description about what TYPO3 does!

Yesterday I have discussed this problem over 3 hours with the 
Extbase-Team. I have searched many documentations regarding this problem 
and read many lines of code within the extbase extension. I have created 
a little extension which constist only of ONE domainmodel (category) as 
value object with list, show, edit and new actions.

Here is a result:

Create a new category with the name "CDs".
--> It works. "CDs" appears in the list action.

Create a new category with the name "Cars".
--> It works. "Cars" appears in the list action.

Create a new category with the name "CDs" AGAIN.
--> It doesn't work! "CDs" was not added to the list and there is no 
additional entry in the database.

Create a new category with the name "cds".
--> It doesn't work! "cds" was not added to the list BUT the already 
existing record "CDs" was renamed to "cds".

With this informations I searched again in the sourcecode of extbase and 
found out, that extbase doen not search for value objects with help of 
the uid. NO...it searches for the value object by a query which keeps 
all cols in it:

SELECT * FROM myTable WHERE street="myStreet" AND zip="12345" AND 
city="munich".

THAT is the difference between Entity and value object!

Stefan


More information about the TYPO3-project-typo3v4mvc mailing list