[TYPO3-50-general] Last minute concept fix? Incosistent class naming for domain models ...

Robert Lemke robert at typo3.org
Thu May 28 11:32:28 CEST 2009


Hi Sebastian,

On 28.05.2009, at 11:06, Sebastian KurfŸürst wrote:

> I just tried out how it looks to have a
> F3\BlogExample\Domain\Model\BlogModel which has multiple
> F3\BlogExample\Domain\Model\PostModel's inside, and I think that's a  
> bit
> strange... Actually there are multiple Posts inside a Blog, but  
> still it
> is just one Post Model.
>
> I really don't just want to give arguments against it, but I hope you
> see my point :-)

Let's assume you create an application for managing conferences. You  
draw
your domain model and come up with models like "Conference", "Session",
"Visitor", "SessionPaper", "Abstract", "Description" etc.

Now you're in trouble:

namespace F3\ConferenceApp\Domain\Model;
class Abstract {
}

"Abstract" is a reserved PHP keyword. "AbstractModel" wouldn't be a  
problem.

The point is that the class containing the information about an abstract
is not the real abstract - its a _model_ of a real abstract. That's  
why I
find it absolutely natural to call it "AbstractModel".

Or take a "Customer". It's not really the customer, it's a model of a  
customer.

robert


More information about the TYPO3-project-5_0-general mailing list