[TYPO3-ect] TS Action chains for SPL objects

Steffen Kamper steffen at sk-typo3.de
Sat Aug 4 15:21:45 CEST 2007


Hi Elmar,

"Elmar Hinz" <elmar07 at googlemail.com> schrieb im Newsbeitrag 
news:mailman.1.1186230425.11618.typo3-team-extension-coordination at lists.netfielders.de...
> Hello,
>
> it's a while ago, that we had an big thread about the possibility to 
> specify
> action chains by TS. Either the solutions where limited or complex. I want
> to make a next attemt for such a design.
>
> Instead of placing the object into a numbered order, each object has a
> pointer to the next object. You overwrite pointers, to place new objects
> into the chain. But the mayor reason for this model is, that a linear 
> chain
> of objects doesn't cover all needs. Think of the cases of validation where
> a different processing is required if validation fails.
>
> Don't be shocked. The example runs validation and a captcha. It't probably
> one of the longest that is possible. Other actions are comparingly simple.
>
> You discover a numberd order for function calls on objects and for
> parameters of functions.
>
> actions {
>
> ...
>
> editAction {
> ...
> }
>
> submitAction {
> START = sessionLoad
> sessionLoad = tx_my_sessionClass
> sessionLoad.do.1 = loadFromSession
> sessionLoad.go.next = request
> request = tx_my_requestClass
> request.do.1 = mergeParameters
> request.go.next = validation
> validation = tx_my validationClass
> validation.set.configurations < temp.validatorConfigurations
> validation.do.1 = validate
> validation.go.invalid = editAction
> validation.go.valid = captcha
> captcha = tx_my_captchaClass
> captcha.do.1.run
> captcha.go.display= render
> captcha.go.passed = transform
> render = tx_my_engineClass
> render.do.1 = render
> render.do.1.1 = captchaTemplate
> render.go.next = translate
> translate = tx_my_translatorClass
> translate.do.1.translate
> translate.do.1.1 = content
> translate.next.sessionStore
> sessionStore = tx_my_sessionClass
> sessionStore.do.1 = loadToSession
> sessionStore.go.next = RETURN content
> transform = tx_my_updateTransformer
> transform.next = update
> update = tx_my_modelClass
> update.do.1.update
> update.go.next = redirect
> redirect = tx_my_redirectorClass
> redirect.do.1 = redirect
> redirect.do.1.1 = listAction
> }
>
> ...
> }
>
> We later could add general entry and exit hooks to tx_lib_object, so that
> each still more flexibility can be added.
>
>
> Regards
>
> Elmar
>
>

That looks really interesting. In this example TS is used in a more complex 
way as normally when TS is used as configuration-part.

For practical use I want ask if this is only part of abstraction layer or 
does it have a pratical usage ?
I ask that in a "provocant" way to clearify the usage. my first thought was:
- this is part of programming logic and can lead very simple to mislead
- where do you see a practical example where you change this logic ?
- how to debug such constructs ?

I really like the possibilities given here, but i also see a danger in it.

vg  Steffen 




More information about the TYPO3-team-extension-coordination mailing list