I've noticed that the number of application-configuration entries for CSLA has grown to quite a few. I'm wondering whether it's time to consider making a custom configuration section just for the CSLA entries. Maybe it's just too much exposure to the EL, but it's been my philosophy that these non-application settings should be segregated into their own section. I realize that some of them could be considered "application specific", but I think they fall more into the "framework driver" category.
I know that making one of these was a major PITA on .NET 1.1, but it's been made considerably easier from .NET 2.0 onward - especially considering that the CSLA entries are simple name/value entries. Plus, developing a custom section could allow for the configuration entries to evolve beyond name/value pairs if necessary. I'm not suggesting we have to go the whole design-time-configuration route, as the EL configuration allows. But maybe it's something that could be worked into a release. It also wouldn't be hard to keep the backwards compatability of allowing the settings to remain in the "AppSettings" section.
Just my $0.02 (probably more like $0.005 in the current economy...) Thoughts?
- Scott
Actually, that's not the case. We developed a custom-configuration section for a version of our database provider, to let other programmers create some infrastructure classes for databases the provider didn't support OOTB. If you ask the configuration system for an instance of your custom configuration class, and the configuration file doesn't have the custom section (or custom section definition), you just get a null reference back.
HTH
- Scott
That makes me feel better about the idea then. Really that was
my only objection – other than backward compatibility – to having a
custom section.
So you think people will be happy having to add the custom
section gunk at the top just to add the
<add key=”CslaAuthorization” value=”Csla”
/>
line to their config file? Because for a lot of people that’s
the only line they need to add. This change, while more elegant, will quadruple
the amount of XML someone has to type to get running.
Rocky
From: tmg4340
[mailto:cslanet@lhotka.net]
Sent: Tuesday, January 27, 2009 8:30 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA custom configuration section (WishList?)
Actually,
that's not the case. We developed a custom-configuration section for a
version of our database provider, to let other programmers create some
infrastructure classes for databases the provider didn't support
OOTB. If you ask the configuration system for an instance of your custom
configuration class, and the configuration file doesn't have the custom section
(or custom section definition), you just get a null reference back.
HTH
- Scott
I guess that depends on how you see CSLA shaking out configuration-wise. There are already WPF-related configuration entries, and we've just had a discussion concerning how to handle the divergent WPF/WinForms functionality. The impression I got from the discussion is that you're not all that keen to develop a separate set of assemblies to manage the change. Using that line of thinking, I believe that a "single source solution" will likely entail more WPF-related configuration entries (long-term, I think that using compiler directives will break down.) Presuming that WPF does gain wider adoption, the amount of CSLA-specific configuration information may be more likely to rise - both in amount and what "normal users" have to use.
Aside from that - and this may defeat the purpose altogether - you can allow for both AppSettings-based configuration entries and/or a custom configuration section. Obviously, it's not recommended that you mix the techniques, but for those folks who only use a single entry, they could still put it in AppSettings.
I certainly agree that a more elegant solution that adds more work does not make a better solution. And the argument that "Microsoft makes you do it" for such things as the EL is, to be honest, a somewhat flimsy argument. But presuming that you switched to a custom configuration section, I don't believe the extra XML is terribly onerous. It's boilerplate for the most part, and a web.config file requires much more boilerplate than this would. That's certainly not a strong argument - but it's still an argument.
- Scott
Well... I'm not sure we want to tackle trying to fix the myriad issues with configuration files as they currently exist in .NET. You've obviously developed a custom solution to deal with the biggest problem - though I'm not exactly sure how MS would solve it, to be honest.
Given that you've already customized your configuration options and created your own custom section providers, I'd expect that a custom section for CSLA configuration information would probably not be terribly helpful for you. So being able to still use AppSettings would, I think, be of some benefit.
I suppose this shoots another hole in my suggestion, but the whole configuration-file concept is pretty difficult to cleanly deal with anyway...
- Scott
Copyright (c) Marimer LLC