[TYPO3-dev] DDD: modelling question and how to search in model

Henjo Hoeksma me at henjohoeksma.nl
Mon Apr 9 12:03:55 CEST 2012


Hi Gerhard,

On Sun, Apr 8, 2012 at 21:03, Gerhard Mehsel <sparking at gmx.net> wrote:

> Hello,
>
> I want to create a extbase extension that deals with persons. I try to use
> DDD and the main entity should be PERSON. It's hard for me to calculate the
> position. Later I want to do things like searching in the model or call
> controller actions via ajax to update only parts of the model without
> sending the complete model within one big HTML form.
>
> A person has properties like prename, lastname, ... and it has some
> addresses (value objects):
> - a private address
> - a company address
> - some addresses for delivery purposes
>
>
> What is the best way to model a proper relation between the entities?
>
This is completely dependent on your 'problem' you are trying to solve.
There's not so much as a 'wrong' way, but you do want to think in terms of
what solves the problem best and yet is as simple as possible.

So if your person always has three types of addresses I will most-likely
create a address object (and probably using Single Table Inheritance for
the different types, and hook it up to tt_address if appropriate).

Domain Modeling should always be focused on solving your problem, so I
would stay close to that and be as simple as possible within solving it. It
will make your program understandable, extendible and more stable.


> BTW: Is there a best practice to search in entites (including related
> entities/value objects)?
>
You can use a whole lot of magic methods in your searches, see Jochen's
blogpost [1] on using the repository to get an idea.

[1]
http://blog.typoplanet.de/2010/01/27/the-repository-and-query-object-of-extbase/

Have fun!

Henjo


>
>
> Regards,
> Gerd
>
>
> ______________________________**_________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-dev<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev>
>



More information about the TYPO3-dev mailing list