The World’s Leading Microsoft .NET Magazine
   
 
timstall

Donate Today!

Search Box

 

Calendar

««Jul 2009»»
SMTWTFS
    12
3
4
567891011
12131415161718
19202122232425
262728293031

My RSS Feeds








Mailing List

Most Popular Tags

                                                           

Coding vs. Configuration

posted Monday, 10 March 2008

Real-world applications need to be configurable. There are lots of reasons an app must be configured - different environment, modify the thresholds, even change what providers are used for a task. There's a big difference between coding, and configuration:

  • Coding implies writing the actual logic in some language (C#, VB, Java, Html, JavaScript, CSS, Sql, etc...). Coding, by its nature, can deal with complex logic, and may reside in many files across many directories. Sometimes code needs to be compiled into binaries. There's a lot of room for error here, which is why IDEs (like Visual Studio) provide code debugging, and why the community encourages unit tests and code reviews.

  • Configuration implies using knowledge of the domain to tweak the app, after it's been deployed, usually via a small number of config files.

 CodingConfiguration
Requires knowledge of language syntaxYes (and usually for many languages)No (syntax is usually just xml. A huge point of configs is that they abstract out syntax).
Requires business domain knowledgeYesYes
Requires re-compilingSometimes (C#, Java --> Yes, Html/Sql --> No)No. Usually just xml or plain text
Number of filesMany - a 10,000 line app, with 50 files, could still just have 1 app.configFew (usually just 1, or 1 per directory)

 

More and more, the push is to abstract coding into configuration. I believe WCF is big on this - instead of getting bogged down in how to transport data (web services, remoting, FTP, messaging, etc...) you just configure the app as appropriate. We also see this in domain specific languages and code generation. For example, .Net tiers has a big config file, but it makes perfect sense if you understand the concepts of N-Tier architecture. So, you can do a little configuration, and it generates 1000s of lines, which spares you from tons of tedious coding.

tags:  

links: digg this    technorati    




1. Tom Clarkson left...
Monday, 10 March 2008 7:26 pm :: http://www.tqcblog.com/

This is only true for small apps. Have you ever tried working with SharePoint configuration files? Hundreds of xml files, typically thousands of lines each, and while the syntax is "just xml", you still have to work out just what sort of xml the application is expecting.


2. Benjimawoo left...
Tuesday, 11 March 2008 12:21 pm

It does also open up a whole new market for configuration manager applications as well. Just look at the WCF Configuration Editor in the Windows SDK. OK, so WCF Configuration is all XML-based, but it's still way easier to edit it in a tool.

So the question is - how long will it be before the business apps are so big, and their configuration so complex that we need to start writing tools to configure the configuration tools?


3. Tim Stall left...
Friday, 14 March 2008 8:56 am

Good points, thanks. I do see a blurry line - for example is MSBuild still coding, or really just a massive configuration script.


4. Simon left...
Tuesday, 8 April 2008 8:04 am :: http://harriyott.com/2005/03/programming

I wrote about configuration bloat a while ago: http://harriyott.com/2005/03/programming-by-text-file.aspx