RE: [PEAR-DEV] Text_Wiki
| From: | Jay Taylor | Date: | Wed, 27 Sep 2006 20:40:41 +0000 |
| Subject: | RE: [PEAR-DEV] Text_Wiki | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-44120@lists.php.net to get a copy of this message | ||
> On 9/27/06, Jay Taylor wrote:
> > Looking over Text_Wiki, it looks like the author chose to use a
> > massive amount of inheritance (it is clearly 2^n growth).
> Is there a
> > specific reason that this method was used instead of decorator?
Justin Patrin wrote:
> What exactly do you mean and what alternative would you propose?
Well, you inspired me to take a closer look at the Text_Wiki source, and it
looks to have been implemented with an eye for efficiency already. So I
would like to withdraw my previous (admittedly ignorant) criticism.
Applying the decorator pattern to this would net you a similar or even
identical result and be a complete waste of time.
However, in reviewing the source files I do see that the configuration
options for each of the classes generally seem to have been hard coded into
the library, with (as I stated in my other Text_Wiki post today) no apparent
straightforward way of changing them other than editing the package source
files (in which case if there is an update, it will of course overwrite your
files and change your app), or perhaps passing some crazy looking array of
options into your object when you create it.
diff: http://wi-fizzle.com/PEAR/Text/Wiki/Render/Xhtml/Url.php.diff
source: http://wi-fizzle.com/PEAR/Text/Wiki/Render/Xhtml/Url.phps
So, one update I would like to propose would be implementing equivalent
alterations like the one I made to Text_Wiki_Render_Xhtml_Url to the rest of
the rendering classes in Text_Wiki. This would enable a PEAR user to easily
set the options to suit their needs and avoid the aforementioned
complications. The change is only a few lines but it seems to me that it
would increase flexibility substantially on this..
Best Regards,
Jay