Hi Chris,

The basic idea is that MZmine modules should be singletons, because each module 
has a single instance of ParameterSet, which is saved to the configuration file 
during MZmine shutdown. If you create multiple instances, the configuration of 
the additional instances would not be saved.

The current code does not enforce the singleton pattern, but I think we should 
follow it.

Cheers,

Tomas


On Oct 26, 2011, at 1:28 PM, Pudney Chris (ext) GBJH wrote:

> G'day,
> 
> I noticed that the ThreeDVisualizerModule uses a kind of singleton
> pattern, see
> http://mzmine.svn.sourceforge.net/viewvc/mzmine/trunk/src/net/sf/mzmine/modules/visualization/threed/ThreeDVisualizerModule.java?revision=2559&view=markup
> 
> I understand that this makes it possible to have the static methods
> setupNew3DVisualizer(...), which are called from pop-up menus for
> showing 3D plots.
> 
> What I don't understand is why?
> 
> Instead of calling ThreeDVisualizerModule.setupNew3DVisualizer(...) why
> not use the standard pattern of other modules and create a new instance
> each time, i.e. new ThreeDVisualizerModule().setupNew3DVisualizer(...)?
> 
> The code for the latter is much simpler and cleaner, so why not use it?
> 
> The singleton pattern seems to be used for several other modules (I
> guess those ones that are called from pop-up menus too) but I'm not sure
> why a single instance is needed.
> 
> Am I missing something?
> 
> Thanks,
> Chris.
> 
> 
> 
> 
> Syngenta Limited, Registered in England No 2710846
> Registered Office : Syngenta Limited, European Regional Centre, Priestley 
> Road, Surrey Research Park, Guildford, Surrey, GU2 7YH, United Kingdom
> 
> 
> 
> This message may contain confidential information. If you are not the 
> designated recipient, please notify the sender immediately, and delete the 
> original and any copies. Any use of the message by you is prohibited. 
> 
> 
> ------------------------------------------------------------------------------
> The demand for IT networking professionals continues to grow, and the
> demand for specialized networking skills is growing even more rapidly.
> Take a complimentary Learning@Cisco Self-Assessment and learn 
> about Cisco certifications, training, and career opportunities. 
> http://p.sf.net/sfu/cisco-dev2dev
> _______________________________________________
> Mzmine-devel mailing list
> Mzmine-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mzmine-devel
> 

===============================================
Tomas Pluskal
G0 Cell Unit, Okinawa Institute of Science and Technology
1919-1 Tancha, Onna-son, Okinawa 904-0495, Japan
TEL:  +81-98-966-8684

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Mzmine-devel mailing list
Mzmine-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mzmine-devel

Reply via email to