Re: [extremeprogramming] About placing configuration defaults
"Jim Shore" <[email protected]> Wed, 20 Nov 2019 23:04:16 -0800
| Newsgroups | gmane.comp.programming.extreme-programming |
|---|---|
| Message-ID | <[email protected]> |
I had that problem too. I solved it in two ways: 1) Not providing configuration data directly, but rather objects, built from multiple pieces of configuration data, that use that configuration to do things of interest. 2) Better design of the lower parts of the system, so that although entry points receive the configuration object, lower layers only receive the objects they rely upon. It may be relevant that I don’t use automatic dependency injection, so it’s not easy for methods to just get an object. It has to be explicitly provided by the caller. This has made me think carefully about dependencies and class relationships, and it’s painfully obvious when I’m doing something ugly like passing an object everywhere or using a global. James > On Nov 20, 2019, at 10:45 PM, Pedro Galan <[email protected]> wrote: > > We follow that approach ourselves and we have ended up with a huge configuration class that is injected pretty much everywhere. The side? effect is that almost every single component have access to every single configuration parameter, which doesn't make us feel particularly comfortable. We are planning to change the approach which doesn't seem to be the best option for our system (although it don't doubt it can fit others). -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#160272): https://groups.io/g/extremeprogramming/message/160272 Mute This Topic: https://groups.io/mt/60557252/2417047 Group Owner: [email protected] Unsubscribe: https://groups.io/g/extremeprogramming/leave/4902963/619838065/xyzzy [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-