[TYPO3-mvc] domain modelling for extensibility

Chris Wolff - AERTiCKET AG cwolff at aer.de
Mon Mar 31 15:12:51 CEST 2014


Hi Christian,

Extbase derives templates Path from the controller Name. therefore you might want to use different controllers.  For different Processes.
As you said you have a lot of similar business logic. I would try to encapsulate the similarities in utility classes. Or create a base-class for all your controllers with methods and properties common for all your business process.
This would provide you with out of the box template for every controller partials are shared between controllers. So you could reuse them in every template. This would remove the conditions in fluid.

If you want to store  all your data in one table you have two options as well:
- one big model: every business process uses the same model, this might lead to problems with the validation and you might up doing a lot of Manuel validation.
- mapping... Extbase allows you to map a model to a database table this could be used to map all your models to the same table. this make maintaining your models more complex..
As you have to update the model and the mapping every time you add a property.
For one project, I have used this technic. Half way in to the project I had written a model generator which reads a json describing model and mapping. And writes both files.
This single json file per model is easier to maintain. Than to separate files for every model. But comes with the drawback that the model cant hold "custom get and set code" as it would be overwritten
The next time I use my generator. (this was not a problem in my case)

My Suggestion:
* CONTROLLER: 1 Controller per Form -> extending from the same base-class
* TEMPLATES/PARTIALS: a Template for every Controller (as its Extbase Default), using partials as for shared stuff.
* 1 Model for Every Form Process Mapped to the Same Table to enable Shared List Views (you might need a List view Model, with all fields visisible)

Regards 
Chris

-----Ursprüngliche Nachricht-----
Von: Christian Kartnig [mailto:office at hahnepeter.de] 
Gesendet: Montag, 31. März 2014 14:33
An: Chris Wolff - AERTiCKET AG; TYPO3 v4 MVC project
Betreff: Re: [TYPO3-mvc] domain modelling for extensibility

Hi Chris,

thanks for your helpful hints!

> *  if your models have great similarity you might, extend the models from an base-class.

Does this make it easier handling new models? Is there a kind of extension also on the template/partial side?

> *  is it likely, that you might want collections/querys of all your 12 business processes. And its therefore desirable to keep them in one Table/Model. Or is it better to spread the data over different tables as there are different concerns.

I definitely need queries across all 12 request forms (e.g. a filterable list containing all 12 request forms).
Is one Table/Model my only option in this case?

If I go for one Table/Model, do I have to have one huge fluid template full of conditions? Or is there some cleaner alternative?

Thanks a lot for your advice!
Christian



More information about the TYPO3-project-typo3v4mvc mailing list