Re: [extremeprogramming] About placing configuration defaults
"Avi Kessner" <[email protected]> Tue, 19 Nov 2019 17:25:12 +0200
| Newsgroups | gmane.comp.programming.extreme-programming |
|---|---|
| Message-ID | <CAGEhWpEbEmkWpqm+gEyYNjdRqiubAceAShGOBwjWaC8AzcBK3Q@mail.gmail.com> |
My understanding is that the defaults should be placed closest to where these things change. Some defaults should be at the top level, especially defaults related to the environment. (base urls, api keys etc) Some defaults should be placed where the configuration is being requested, especially arguments that are passed in at runtime. (test file name, number of interactions, other optional args you might have) Wherever someone might be interested in what the default is, try to have them searching for it as little as possible. The less often the value of the config is likely to change, the "higher up", I think it should be. brought to you by the letters A, V, and I and the number 47 On Tue, Nov 19, 2019 at 4:28 PM Luiz Esmiralha <[email protected]> wrote: > Hello XP people, > > I am not sure if here is the right place to ask such a question, but I > know there are lots of people here that can program circles around me, so I > will give it a shot. If I am off-topic, well... sorry. :) > > Anyways, I've been thinking about configurations and defaults. And I would > like to know what are your thoughts on where to place defaults. Would you > centralize them all in one single place (such as a Configuration class at > the very edge of the system) or delegate each one to the components/classes > actually using it? > > My concrete case is (yet another) small test framework driven by a CLI. > There is some configs such as a folder to read the specs from, api keys, > URLs and so on. Some have sensible defaults, some don't. At the moment, the > configuration defaults are decided by the args parser and passed on to a > Configuration object that is used in every other place. > > What would you do instead? > > After writing it, the question seems so basic that it makes me blush a > bit. But that's me: always wondering if someone knows a better way of doing > what I do. > > Thanks a lot, > Esmiralha > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#160229): https://groups.io/g/extremeprogramming/message/160229 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]] -=-=-=-=-=-=-=-=-=-=-=-