RE: [SMARTY-DEV] more abstraction committed
| From: | boots | Date: | Fri, 09 May 2003 15:27:33 +0000 |
| Subject: | RE: [SMARTY-DEV] more abstraction committed | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1434@lists.php.net to get a copy of this message | ||
-- Monte Wrote:
> On another note, as a consequence of abstracting I also reorganized
> the function arguments to be more like Smarty plugins, so instead of:
> funcname($foo1,$foo2,$foo3)
>
> we now have:
>
> funcname($params, &$smarty)
>
> Where $params is an associative array containing $foo1, $foo2, $foo3.
> Thich makes things easier to maintain and expand.
Would it be possible to start using the convention of having $smarty
passed as the first parameter to the function? That should really make
it easier to extend things in the future and no one would have to guess
which parameter position to pass $this into.
I've been thinking about the abstraction and I expect that this work is
still highly experimental, correct?
Asides from Andrei's comments, I'm not really sure how this counts as
abstraction. Its more modularization down to the function level, which
is somewhat strange. How does one extend/modify Smarty using this new
regime? I think there will be a lot of mechanics and a lot of
data-driven lookups. It looks like there is a new function that is
dealing with the "abstracted" pieces. Perhaps some profiling code
should be placed in there. One interesting consequence of this is that
if Smarty is reduced completely to modularized functions, then the
compiled templates can include just enough functions to get the page
processed. That is very interesting.
In my mind, there are still advantages to using static classes and
interfaces, yet I am really intrigued as to where Monte's direction
will take things. I love the idea of static classes interfaces because
it would allow all of the data to be quickly passed around and to also
maintain multiple states of the engine concurrently. It also means a
uniform way of passing parameters and other data while still having
access to "local" class members (as I discussed with Monte, I'm
thinking of Decorators to achieve that). I realize that it depends on
some class features--PHP4's weakest feature, so it may not be tenable
from a practical point of view.
xo boots
ps. Monte: Vegas, eh? Ahhh, the bright lights and late nights. Try not
to lose as much money there as I do ;)
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com