[josm-dev] Openvisible doesn't work anymore
Frederik Ramm
frederik at remote.org
Mon Nov 5 11:01:30 GMT 2007
Hi,
> The correct solution is use the facilities Java provides the way
> they are supposed to be used instead of making everything public.
> Hide stuff like the menus and expose a couple of routines for
> plugins to use to add menu options.
I'd go for a compromise: I think it is sufficient to provide a good
place for plugins to add their stuff to and they'll use it. (Whether
or not we use public variables for that is a different matter. I
guess the classic method would be to allow plugins to provide a
method that populates a menu, and then call that from the outside
when initialising the plugin?)
The problem with the current approach is mainly that plugins don't
know where to put their stuff so each does it differently.
I believe that if a plugin really really wants to add itself in a
strange place in the existing menu structure, or maybe even remove
other items from the existing menus and generally mix them up, then
so be it. I am not fighting a battle against malevolent plugins here,
I'm just trying to guide them to what I think might be proper.
Providing a properly encapsulated menu access method that still has
that flexibility is difficult (and bloats the code), unless of
course you just do a public getMenu() and allow the plugin to modify
the object as desired ;-)
Bye
Frederik
--
Frederik Ramm ## eMail frederik at remote.org ## N49°00.09' E008°23.33'
More information about the josm-dev
mailing list