Will Scheidegger ha scritto:
Isn't that what the ModuleRegistry class pretty much does? I might be
wrong / misunderstanding your questions, but my modules also have a
single module class instance created and managed by the ModuleRegistry:
ModuleRegistry.Factory.getInstance().getModuleInstance("my-module");
Yes, exactly.
We have around 12/15 modules, built on project vertical requirements.
Each modules register its module Class at startup, as usual.
BUT:
Each module has a manager, e.g.: NewsManager.java
This manager extends an abstract manager, common to all modules... and
so... and so...
OUR SCENARIO:
NavigatorModule (navigator-module) would like to know what are the
categories maintained by the NewsModule (news-module). So, he calls
NewsManager.getInstance().getCategories()
This because categories are stored on JCR, the first time NewsManager
starts, loads those categories and stores them in a private
Collection.... obviously.
Is it correct what I've done?
Another possibility is to create inside NewsModule something like:
private static NewsManager manager = NewsManager.getInstance()
public static AbstractManager getManager(){return manager;)}
and then module navigator would call:
ModuleRegistry.Factory.getInstance().getModuleInstance("news-module").getManager().getCategories();
Hope to have been more clear.
M.
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------