Don't give me static...

James Bowes jbowes at redhat.com
Wed Jun 2 10:58:16 UTC 2010


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.

-James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/candlepin/attachments/20100602/65b3e717/attachment.sig>


More information about the candlepin mailing list