[TYPO3-mvc] Tx_Extbase_MVC_Controller_Argument StoragePage
Sebastian Kurfürst
sebastian at typo3.org
Tue Jun 22 08:30:06 CEST 2010
Hey,
I think as well that this issue needs to be solved.
There might be two ways to solve this issue I see right now:
1) Using the repository findByUid method, as suggested.
I think technically, it would work quite easily. However, semantically,
by creating a repository for an object, you declare it as so-called
"Aggregate Root" [1], so it has a semantic meaning that a repository
exists for a given object.
In Domain-Driven-Design, if an object is an aggregate root, if it is
deleted, it deletes all non-aggregate root children as well. However,
in Extbase this is not automatically done by default, as we always have
the TYPO3 backend where you can access all objects, not just the
Aggregate Root objects.
So, declaring an object as aggregate root (in Extbase) has no (semantic)
consequences right now, that's why this solution might be possible.
2) Overriding the query settings with
$this->arguments[....]->querySettings->...
I could imagine that we can put the query settings used to fetch an
argument inside the Argument object. One could then do the following:
public function initializeFooAction() {
$this->arguments['bar']->getQuerySettings()->setRespectStoragePage(FALSE);
}
/**
* @param .... $bar
*/
public function fooAction(Tx_X_Domain_Model_Bar $bar) {
}
This seems cleaner to me from a theoretical standpoint, as we do not
have to define objects as aggregate roots if they should not be
aggregate root objects. However, the first variant is more
understandable (and as some of you suggested it, also more intuitive),
and also more powerful as somebody could use custom fetch code.
If we change it in way 1), we should check with the v5 guys as well, as
this part of Extbase / FLOW3 should stay in sync.
I'm not yet sure which way to go, but just wanted to throw in my opinion
on this -- what do you all think about these two variants?
Greets,
Sebastian
PS: I'll see if some people from v5 could join this discussion as well :)
[1]
http://richarddingwall.name/2009/10/13/life-inside-an-aggregate-root-part-1/
More information about the TYPO3-project-typo3v4mvc
mailing list