On Aug 3, 2009, at 6:27 PM, Asiri Rathnayake wrote:
While the
"every plugin could declare to be in a given category" is
easily casted to the Macro world, I am not sure how to translate the
"every plugin is free to add new categories".
How about like this:
* Each macro has a getCategory() method.
* Macro manager calls this method and if the category is an existing
one, it
is put into that collection.
The problem with this is that a "category" is a data structure so test
for equality could be problematic.
Imagine 3 macros return:
ID:category1
Name:Foo foo foo
Icon:foo.jpg
ID:category1
Name:Bar bar bar
Icon:bar.jpg
ID:category2
name:Foo foo foo
Icon:baz.jpg
How would you handle this?
Imho, getCategory() should return a simple string that is an id of a
category defined and stored in a "registry"
The problem is how could a macro put a category inside this registry?
Maybe at initialization time it could do store new categories in the
registry (if it wants to do so) so that a subsequent call to
getCategory would return an existing id.
The registry could also be populated by default with a set of
"standard" categories (maybe defined in some wiki pages).
-Fabio