473,695 Members | 2,943 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why XML config files?

Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes
it could get some honest attention.

VB6 had a some simple and fast mechanisms for retrieving values from basic
text files, which in turn could be simply and easily maintained with
notepad.

I understand the benefits of XML, really, but in the case of configuration
files it seems it is almost always nothing more than unnecessary complexity,
both in accessing them and maintaining them.

What am I missing?
Nov 15 '05 #1
22 3002
Daniel,

Well, you kind of answered your own question. The benefits of XML
become apparent when you need them. Granted, when things work, you wonder
why you need the extra complexity, but when you find yourself in a bind and
you have to make changes, you will be glad you have XML, as the number of
tools available to manipulate it are plentiful.

Also, like everything else in XML, it allows for easy insertion into
other business processes (I use business here loosely).

If you want, all of the routines in VB are implemented as static methods
in the Microsoft.Visua lBasic namespace which is distributed with the
Framework (the classes for the most part are in Microsoft.Visua lBasic.dll).
You can set a reference to this and use the methods as you would in VB
normally.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Daniel Billingsley" <db**********@N O.durcon.SPAAMM .com> wrote in message
news:um******** ******@TK2MSFTN GP10.phx.gbl...
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes
it could get some honest attention.

VB6 had a some simple and fast mechanisms for retrieving values from basic
text files, which in turn could be simply and easily maintained with
notepad.

I understand the benefits of XML, really, but in the case of configuration
files it seems it is almost always nothing more than unnecessary complexity, both in accessing them and maintaining them.

What am I missing?

Nov 15 '05 #2
The benefit of XML config file is that you are not limited
to just key/value settings, but you can have different
types of configurations that are more complex. Of course
you can achieve the same thing with regular text file, but
why reinvent the wheel.

Tu-Thach
-----Original Message-----
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopesit could get some honest attention.

VB6 had a some simple and fast mechanisms for retrieving values from basictext files, which in turn could be simply and easily maintained withnotepad.

I understand the benefits of XML, really, but in the case of configurationfiles it seems it is almost always nothing more than unnecessary complexity,both in accessing them and maintaining them.

What am I missing?
.

Nov 15 '05 #3

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Daniel,

...Granted, when things work, you wonder
why you need the extra complexity, but when you find yourself in a bind and you have to make changes, you will be glad you have XML, as the number of
tools available to manipulate it are plentiful.
Uh.. you mean like Editor, Notepad, Wordpad, Word, etc. ad infinitum? Come
on, you've got to do better than that. Please, I'm not trying to be flaming
sarcastic, but you just gave the argument for never "inventing" XML config
files in the first place.

Also, like everything else in XML, it allows for easy insertion into
other business processes (I use business here loosely).

If you want, all of the routines in VB are implemented as static methods in the Microsoft.Visua lBasic namespace which is distributed with the
Framework (the classes for the most part are in

Microsoft.Visua lBasic.dll).

That seems a rather nasty solution for my C# app.
Nov 15 '05 #4
Which is the cart and which is the horse? That is, by your own statement
("you can achieve the same thing with regular text file") didn't XML
reinvent the wheel?

"Tu-Thach" <an*******@disc ussions.microso ft.com> wrote in message
news:10******** *************** *****@phx.gbl.. .
The benefit of XML config file is that you are not limited
to just key/value settings, but you can have different
types of configurations that are more complex. Of course
you can achieve the same thing with regular text file, but
why reinvent the wheel.

Tu-Thach

Nov 15 '05 #5
Let me clarify... I meant my statement only to apply to config files, not
XML in general. The benefit is obvious when we start talking about
something complex like a representation of a DataTable, but config files
are typically fairly simple.

"Daniel Billingsley" <db**********@N O.durcon.SPAAMM .com> wrote in message
news:uc******** ******@TK2MSFTN GP10.phx.gbl...
Which is the cart and which is the horse? That is, by your own statement
("you can achieve the same thing with regular text file") didn't XML
reinvent the wheel?

"Tu-Thach" <an*******@disc ussions.microso ft.com> wrote in message
news:10******** *************** *****@phx.gbl.. .
The benefit of XML config file is that you are not limited
to just key/value settings, but you can have different
types of configurations that are more complex. Of course
you can achieve the same thing with regular text file, but
why reinvent the wheel.

Tu-Thach


Nov 15 '05 #6
I beg to disagree. Configuration files can be quite complex. Use of XML
for config files whenever your data is: nested rather than flat. For
example:
<servers>
<server type="developme nt">
<database>
<name="mydataba se">
<users>
<user>
<name>smith</name>
<role>manager </role>
</user>
<user>
<name>jones</name>
<role>clerk</role>
<users>
</database>
</server>
<server type="productio n">
<database>
<name="yourdata base">
<users>
<user>
<name>black</name>
<role>manager </role>
</user>
<user>
<name>white</name>
<role>clerk</role>
<users>
</database>
</server>
</servers>

Representing this in a flat INI type file is very complex if not impossible.
when new element groups are added to the INI file access code may break.
Since one has the power of Xpath and the XML DOM as part of the API one can
access groups of nested information quite easily ( \servers[server
@type="developm ent]\users).
Also a new element groups may be added to the XML config file without
breaking older access code.

give it a try.

dlr

"Daniel Billingsley" <db**********@N O.durcon.SPAAMM .com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Let me clarify... I meant my statement only to apply to config files, not
XML in general. The benefit is obvious when we start talking about
something complex like a representation of a DataTable, but config files
are typically fairly simple.

"Daniel Billingsley" <db**********@N O.durcon.SPAAMM .com> wrote in message
news:uc******** ******@TK2MSFTN GP10.phx.gbl...
Which is the cart and which is the horse? That is, by your own statement ("you can achieve the same thing with regular text file") didn't XML
reinvent the wheel?

"Tu-Thach" <an*******@disc ussions.microso ft.com> wrote in message
news:10******** *************** *****@phx.gbl.. .
The benefit of XML config file is that you are not limited
to just key/value settings, but you can have different
types of configurations that are more complex. Of course
you can achieve the same thing with regular text file, but
why reinvent the wheel.

Tu-Thach



Nov 15 '05 #7
We don't disagree - I said quite clearly that config files are *typically*
fairly simple, but acknowledged XML is obviously better for more complex
situations.

Of course, we're talking theoretically here. I would be curious to see what
percentage of .NET apps have config files this complex vs. the kind that
could easily be handled by a flat text file.

I find your point about breaking flat text files interesting because for
simple configuration information I see a 6-line file with all kinds of XML
tags much more prone to maintenance problems than a simple 1 or 2 line flat
file.

I don't think we need to keep going 'round and 'round on this. I made this
comment because I saw a *few* valid points in another thread which claimed
something like OO principles and n-tiered applications were the work of
satan. Obvious nonsensical drivel. I do, however, personally know of some
OO purists that always tend to make simple projects 10 times more complex
than they need to be, which in the long run costs somebody money.

So my point here is I just that this is an example - I think (with no
empirical evidence, of course) there are more cases than not that making
config files XML added unnecessary complexity. Could .NET have supported
both (without the VB namespace hack)? Hmmm.
"Dennis Redfield" <de************ *@acadia-ins.com> wrote in message
news:OQ******** ********@TK2MSF TNGP10.phx.gbl. ..
I beg to disagree. Configuration files can be quite complex.


<snip>
Nov 15 '05 #8
You are missing the point, of maintaining uniformity and standardization
across the whole world.
Keyur Shah
Verizon Communications
732-423-0745

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #9

"Daniel Billingsley" <db**********@N O.durcon.SPAAMM .com> wrote in message
news:uT******** ******@TK2MSFTN GP12.phx.gbl...
We don't disagree - I said quite clearly that config files are *typically*
fairly simple, but acknowledged XML is obviously better for more complex
situations.

Of course, we're talking theoretically here. I would be curious to see what percentage of .NET apps have config files this complex vs. the kind that
could easily be handled by a flat text file.

I find your point about breaking flat text files interesting because for
simple configuration information I see a 6-line file with all kinds of XML
tags much more prone to maintenance problems than a simple 1 or 2 line flat file.

I don't think we need to keep going 'round and 'round on this. I made this comment because I saw a *few* valid points in another thread which claimed
something like OO principles and n-tiered applications were the work of
satan. Obvious nonsensical drivel. I do, however, personally know of some OO purists that always tend to make simple projects 10 times more complex
than they need to be, which in the long run costs somebody money.

So my point here is I just that this is an example - I think (with no
empirical evidence, of course) there are more cases than not that making
config files XML added unnecessary complexity. Could .NET have supported
both (without the VB namespace hack)? Hmmm.

No. Remember, while configuration files are generally pretty simple, but
configuration can include things like assembly version redirections, etc,
which while not in every configuratoin, support HAS to be there, it may be
needed. Splitting across different formats just complicates things
needlessly. The choice to provide the slightly more complex solution with
vastly superior flexibility is a good choice, in my opinion. Flat files
simplicity is not enough to make up for their lack of flexibility.

It is, in theory, possible for an developer to write an INI or whatever for
his own settings. I'd call their design into question, I consider INI's and
the registry to be for legacy use only by this point.
"Dennis Redfield" <de************ *@acadia-ins.com> wrote in message
news:OQ******** ********@TK2MSF TNGP10.phx.gbl. ..
I beg to disagree. Configuration files can be quite complex.


<snip>

Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3823
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply* access config files. This is version 3, which is a big overhaul. It extends ConfigObj to reading config files with sections and various other simplifications. I find ConfigObj extremely easy to use and use it for reading config files and data...
1
1558
by: Rolf Molini | last post by:
Hello everybody, I put this in a separate thread because altough it is connected to the localization-problem in my former thread this is a completely different "joke" of the IDE. While waiting for some hint on how to include my own ressources in IDE-generated satellite-assemblies (because there can only be on assembly per each language) I decided to try to use the XML-editor for the IDE-generated .resx-files again. I noticed that the...
4
10571
by: Bennett Haselton | last post by:
If I add this to my web.config file: <authentication mode="Forms"> <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" /> </authentication> I can configure the application so that users who try to access a page in the application, get redirected to login.aspx where they have to sign in. (And the "signing in" is handled in the codebehind page of
4
2217
by: Jeffrey Palermo [MCP] | last post by:
I use web.config files in many directories, and my aspx files can access the AppSettings. If I have a subdirectory Foo with an aspx, and Foo has a local web.config that defines an AppSetting. My aspx in the Foo directory can properly access this local AppSetting. I understand that web.config files are cumulative as you go deep into the directory structure. Here is my situation. I have an aspx in the root of my application. I have a...
8
3163
by: Graham | last post by:
I noticed a similar post awhile ago and in terms of my problem it wasnt a suitable answer so I will ask again. I have VS2005 running a on development machine in my office where I do all my development on existing and new applications. This environment also has its own Sql Server with dev versions of all our live Databases. Our live production server also its own Sql Server, these 2 Sql Servers are kept completely separate (for obvious...
1
2567
by: Joseph Geretz | last post by:
I need to download a greater than 4 megabyte attachment via WSE / DIME. The only way I know how to configure this is via a .config file. Normally, the ..config file is the same name as the base application. I built a .NET driver program to test this, NetBrokerDriver and provided a NetBrokerDriver.exe.config file which specifies the following: <messaging> <maxRequestLength>-1</maxRequestLength> </messaging>
20
2613
by: tomerfiliba | last post by:
hey i've been seeing lots of config-file-readers for python. be it ConfigObj (http://www.voidspace.org.uk/python/configobj.html) or the like. seems like a trend to me. i came to this conclusion a long time ago: YOU DON'T NEED CONFIG FILES FOR PYTHON. why re-invent stuff and parse text by yourself, why the interpreter can do it for you? and anyway, i find this a very ugly format:...
11
3440
by: TARUN | last post by:
Hello All I need to ask about the configuration file in .NET, There are Two config File 1. Web Config 2. Machine config I understand the the usage of Web config , but not able to understand the usage of Machine config. I read in the article that you can also write your database connection string in Machine Config
1
1804
by: herbert | last post by:
In VS.2005 a Windows Service can have an app.config file. A class library can also have an app.config file. Now if my Windows Services uses three class libraries, each of it coming with its own app.config file, in which sequence are the app config files read in? eg What happens if there are trace switches of the same name with different values in those files? Or a the config files local to a VS project/assembly ? If so, they should not...
0
8619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8559
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8975
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8826
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8818
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6487
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4338
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2996
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.