[TYPO3-mvc] Understanding MVC

Frenck Lutke frenck at innologi.nl
Fri Mar 22 14:11:23 CET 2013


Hi Robert,

On 22-3-2013 11:54, Robert Schneider wrote:
> Hi NG,
>
>[snip]
>
> (This diverges from the extension-builders way with create/new. So is
> this already a bad approach?)
>
> [snip]
>
> Thank you and have a nice weekend!
> Robert
>

While the extension builder produces a generally usable, clean and 
easily understandable approach, it is in no way the only-, in most 
situations not even the best- and sometimes even a BAD approach. The 
keyword here is "general": it can't predict your exact needs (that's not 
its purpose), it just produces a general baseline for your model to 
customize further/build upon. In most cases, its CRUD related output 
NEEDS customization for e.g. usability purposes on more complex models, 
as you're finding out now.

The MVC pattern encourages you to divide the Model, View and Controller 
logic, for maintainability and decoupling purposes, but does not 
necessarily dictate how you accomplish your internal controller logic. 
So if you find your case is easier accomplished by compounding more 
logic into a single action, and you can still achieve this while keeping 
your code clean (enough), maintainable (enough) and serve your purposes, 
then I say you should. Find out how it works out for you. Maybe it 
doesn't, but then you know.

Don't let your doubts on what "should be" restrict your attempts too 
much. As a developer, you 1) won't stop being confronted by cleaner or 
better approaches for problems you've solved earlier, and should 2) know 
that in increasing maintainability/decoupling there is (almost) always a 
tradeoff in speed/performance that you sometimes need to balance. You'll 
even find yourself looking at problems which prioritize the opposite of 
the general recommendation of such patterns. Part of being a good 
software engineer in general, is knowing when to use which design 
patterns, and only using those you actually need or help you improve 
code quality without too much tradeoffs.



If my response is not sufficient enough to answer your specific questions:
I'm not really up to date on the most recent 
TYPO3/extbase/fluid-specific resources for your questions (considering 
the considerable improvements currently going on in documentation) and I 
feel that providing you with more general resources (of my own) 
regarding MVC might raise only more questions at this point, so I'm 
leaving that request to anyone more up to date or involved with TYPO3 
documentation, or your own search attempts.

Hope this helps,
Frenck


More information about the TYPO3-project-typo3v4mvc mailing list