Hi! I'm currently redesigning my plugin (Milkbox), based on Mootools
1.3, and as I do it, I want to be sure to clean up code and use best
practices.

So a couple of questions:

1. What are, apart from the main one (the modification of prototype),
the practical differences of extending vs implenting Events? For
Milkbox, I just need to fire some simple event to listeners. Till now,
I always did it via Implement. Is it the best way?

2. Milkbox is not supposed to be instantiated more than once per page,
since there's no reason to build the viewer's html code more than
once. Instead there can be a lot of different galleries, and all use
the same viewer (so maybe I could code a MilkboxGallery class)..
Anyway, that said, if I want to prevent instantiation, should I use
some kind of singleton or is it better to simply put some arbitrary
internal check? Or maybe there's some other better pattern?

Bye (and thanks)!





Reply via email to