Don't give me static...

Adam Young ayoung at redhat.com
Wed Jun 2 13:45:04 UTC 2010


On 06/02/2010 06:58 AM, James Bowes wrote:
> On Tue, Jun 01, 2010 at 04:55:11PM -0400, Justin Harris wrote:
> <snip>
>    
>>> Since we are using Guice, it does make sense that we would use it to
>>> create a singleton of the Config, but how does that affect the custom
>>> modules we load in the Config to configure Guice? Is this a chicken
>>> and the egg problem?
>>>        
>> Quite possibly, maybe we are overloading the Config class too much?  One possible
>> solution is to split the config into:
>>
>> 1) Config to get Guice up and running
>> 2) Config component that can be injected into other objects
>>      
> I'd prefer to just instantiate the config twice rather than complicate
> things to work around something that only happens once.
>
> Or, we go whole hog and make classes for each configurable part of
> candlepin.
>
>    
>>>        
>>>> What do you guys think?  Am I overreacting?  :)
>>>>          
>>> See above, and static's aren't always bad.
>>>        
> new Config() sticks out with all the other guiceyness, so I'm all for
> changing that. I think static makes sense for a config map, however, as
> in the non-testing code, you wouldn't want to be altering any of those
> values.
>    

   Typically, in a unix Daemon, kill -1 means reload your config.  So, 
you would want to reload at that point, possibly by just creating a new 
instance.
> -James
>    
>
>
> _______________________________________________
> candlepin mailing list
> candlepin at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/candlepin
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/candlepin/attachments/20100602/85ae74e2/attachment.html>


More information about the candlepin mailing list