[TYPO3-mvc] Using interfaces for dependency injection on domain models

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Wed Mar 30 18:34:48 CEST 2011


Christian Zenker wrote:
>
> An interface would be more fitting in my opinion, if it was common to
> use different tables for the same purpose, like fetching information on
> users in tt_address, fe_users, etc. This way you can ensure that you can
> use the same views for every model.

Yeah, I understand. But wouldn't it be the "right" way to introduce
interfaces for every domain model in my extensions, to provide as much
flexibility as possible to other developers, which may need to exchange
those domain models for some reason?

I mean, if someday one comes along and wants to extend/enhance my
domain models, and an interface would fit best, wouldn't it be "bad"
if there were just no interfaces, because I decided myself, that
"I" don't need it, so no one else can use it?

That's what I'm about. Why not providing and using interfaces from
the beginning and if someone needs them in future, they can just
base their changes on the fact, that they are there.

I hope it's clear what I want to say, it's a bit difficult to describe.

Thanks for your feedback!

Best regards,
Thomas


More information about the TYPO3-project-typo3v4mvc mailing list