[RFC][plugin]: make PluginObjectStore a singleton.

Omair Majid omajid at redhat.com
Thu Mar 31 12:15:12 PDT 2011


On 03/31/2011 03:03 PM, Deepak Bhole wrote:
> * Denis Lila<dlila at redhat.com>  [2011-03-31 14:54]:
>> >  The attached patch does what the subject says.
>> >
>> >  Ok to push?
>> >
> Please rename the instance to INSTANCE and method to getInstance to make
> it clearer that it is a singleton in the caller as well.
>

I agree with what Deepak said.

>> >  +// Enums are the best way to implement singletons.

I particularly like this comment ;) Do you have a source for this? I 
would prefer it if this was an actual class. It's not behaviourally an 
enum, so it should not be marked as such.

>> >  +enum PluginObjectStore {
>> >  +    THE_STORE;
>> >

Thanks,
Omair



More information about the distro-pkg-dev mailing list