[TYPO3-mvc] URIBuilder rewrite
Bastian Waidelich
bastian at typo3.org
Tue Sep 1 10:06:17 CEST 2009
Xavier Perseguers wrote:
Hi Xavier,
thanks for your comprehensive feedback ;)
> autoReset is not a must thus OK to leave it
I think, that's a YAGNI-case.
Normally you won't have to deal with this anyways. And if you do, you
probably do so in order to _keep_ the settings. So you'd use the same
instance of the UriBuilder to create multiple related links (e.g. in a
loop) or you'd explicitly reset the UriBuilder (or create a new instance).
> please add a "return $this" at the end of method reset().
> This will allow us to write $this->uriBuilder->reset()->uriFor()
I disagree (sorry). I think it's fine to have a fluent interface for
"stupid" setters. But having reset() there seems to be out of place. How
are others thinking about this?
BTW: I found out, that method chaining is hard to test cause not only
you have to mock the uriBuilder but all its setters in order to avoid
fatal errors in your unit tests..
> Did you tried BlogExample with your changes? Seems that the "reset"
> problem is there too...
What problem exactly? Do you have the latest versions of TYPO3 core,
extbase, fluid & blog_example?
All the best
Bastian
More information about the TYPO3-project-typo3v4mvc
mailing list