[TYPO3-core] Domain model "page"
Christian Kuhn
lolli at schwarzbu.ch
Fri Feb 20 13:31:05 CET 2015
Hey.
On 19.02.2015 21:21, Steffen Müller wrote:
> I disagree. Extbase already ships pointless domain models for a
> fictional CMS domain, e.g. FrontendUser. IMHO these models violate the
> domain driven design principle: I have never seen a domain which uses
> all properties of FrontendUser and therefore these properties should not
> be exposed. The same would go for pages.
> One could argue with convenience to create domain models facets based on
> the core models, but it gets rather pointless when you want your domain
> model classes to also serve as a documentation of your domain. You would
> have to add all properties + getter/setters to the facet anyway.
>
Full +1. Thanks for sharing these thoughts.
This is exactly the reason why extbase has no page model and hopefully
never will.
Furthermore, domain modeling is about solving the specific domain.
Properties that are not relevant in a specific domain should not be part
of an according model, no matter if they are part of an underlying db
table or not.
We're striving for single and simple domain models for specific domains
in our application nowadays: If there is for example a table with
products and a ton of db fields, there is a model for customer
containing properties shown on the website for "buyers" like price,
title, whatever. And there is another (mostly independent) model for
"accounting" showing how many were bought and the title and a price
history. And there is a model for "logistics" containing stock and
stuff. So, all of these go to the same table in the end, but they are
independent from each other and don't interfere - ok, maybe there is one
abstract to contain basic stuff that *everyone* needs, but that is not
the important thing. The point is there is no monster model that
contains everything for every use case.
Introducing a generic page model to extbase would introduce this
monster. This must be avoided.
Regards
Christian
More information about the TYPO3-team-core
mailing list