[TYPO3-mvc] Persistence of value objects

Jochen Rau jochen.rau at typo3.org
Thu Apr 19 18:33:13 CEST 2012


Hi,

On Thu, Apr 19, 2012 at 06:01:11PM +0200, Bastian Waidelich wrote:
> >I would like to propose a more radical approach: What if we drop the
> >whole distinction between Entity and ValueObjects?
> 
> Wow, and that coming from you!? ;)

Why not? I don't question DDD here. I just want to fix its issues. ;-)

> I'm not perfectly sure about the implications, but I have the
> feeling that ValueObjects do make sense. And IMO it doesn't conflict
> with the idea of having different representations of a VO.
> With your example "#FF0000" could be just a different rendering of
> the color "red": $color->renderAsHexCode() or
> ColorToHexCodeConverter($color). Similar for the french label:
> <f:translate key="colors.{color}" />

The example $color->renderAsHexCode() just hard-codes the process of
dereferencing a representation. It makes it very hard to add new
representations. Same with ColorToHexCodeConverter($color).

The second example <f:translate key="colors.{color}" /> is correct. But
{color} should return the identifier of the concept. By now, it is the
representation "red" in the "default language" (shudder).

> I know, the color is just a dump example but this probably applies
> to more comples ValueObjects, too.

Yes, it does.
 
> Well, I'm not a DDD expert. But we have finally fixed support for
> ValueObjects in FLOW3 [1] and if we decide to drop that, this should
> be discussed with both teams.

I know, sorry. I should have come up with this earlier. But there was
always the "only-the-concept-of-Jochen" argument.

What's your suggestion for a joint discussion?

-Jochen

> 
> [1] https://review.typo3.org/#/c/9762/
> 
> 
> -- 
> Bastian Waidelich
> TYPO3 Core Team Member
> 
> TYPO3 .... inspiring people to share!
> Get involved: typo3.org


More information about the TYPO3-project-typo3v4mvc mailing list