[dev] Horde_Image stuff...
Michael Rubinsky
mike at theupstairsroom.com
Thu Oct 18 22:00:56 UTC 2007
Been thinking thorough some of this some more...I'm wondering about
the way the Decorator interface is currently coded. I kind of went in
the direction it looks like it was heading based on what was already
started. Currently, to apply an effect, we would:
<code>
$decorator = $image->getDecorator('effectname', $params);
$decorator->draw();
.
.
$another_decorator = $image->getDecorator('another_effect', $params);
$another_decorator->draw();
.
.
$image->display();
</code>
It makes more sense to me to simply have a method like
addEffect('effectname', $params) or something similar that wouldn't
actually return the decorator, just apply that effect to the image,
since that's all the decorator is doing anyway....which leads me to
the next point, these aren't really Decorators, in the true OO pattern
sense of the work, at least not as far as I understand the decorator
pattern....they are supposed to implement the same interface as what
they decorate, no? So, and I think Chuck had made this suggestion
somewhere..maybe on irc, that these should be called something else,
maybe Plugins or Effects?
Thoughts?
--
Thanks
Mike
"Time just hates me, that's why it made me an adult." - Josh Joplin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: PGP Digital Signature
Url : http://lists.horde.org/archives/dev/attachments/20071018/949a813c/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 2013 bytes
Desc: PGP Public Key
Url : http://lists.horde.org/archives/dev/attachments/20071018/949a813c/attachment-0001.bin
More information about the dev
mailing list