为什么XML配置文件? [英] Why XML config files?

查看:58
本文介绍了为什么XML配置文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我想问这个与nospam'的荒谬线程分开希望

它可以得到一些诚实的关注。


VB6有一个一些简单快速的机制,用于从基本的

文本文件中检索值,而这些文件又可以通过

记事本简单轻松地维护。


我理解XML的好处,实际上,但在配置

文件的情况下,似乎它几乎总是不必要的复杂性,

两者都在访问保留它们。


我缺少什么?

解决方案

Daniel,


好​​吧,你回答了自己的问题。当您需要时,XML

的好处变得明显。当然,当事情发生时,你会想知道为什么你需要额外的复杂性,但是当你发现自己陷入困境并且你需要做出改变时,你会很高兴你有XML,因为可用于操作它的工具数量很多。


此外,就像XML中的其他工具一样,它允许轻松插入

其他业务流程(我在这里松散地使用业务)。


如果需要,VB中的所有例程都是以静态方法实现的
Microsoft.VisualBasic命名空间中的


Framework一起分发(大部分类都在Microsoft.VisualBasic.dll中)。

你可以设置对此的引用并像在VB中一样使用方法




希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- mv * @ spam .guard.caspershouse.com


D aniel Billingsley <分贝********** @ NO.durcon.SPAAMM.com>在消息中写道

新闻:嗯************** @ TK2MSFTNGP10.phx.gbl ...

好的,我想要请求将此与nospam的荒谬线程分开,希望它可以得到一些诚实的关注。

VB6有一些简单快速的机制,用于从基本的
文本文件中检索值反过来可以用记事本简单轻松地维护。

我理解XML的好处,但是在配置文件的情况下,它似乎差不多了在获取和维护它们时,无非就是不必要的
复杂性。

我缺少什么?



XML配置文件的好处是你不仅限于键/值设置
,但你可以有不同的

类型的配置更复杂。当然

你可以通过常规文本文件实现同样的目的,但是

为什么要重新发明轮子。


Tu-Thach

-----原始消息-----
好的,我想问这个与nospam'的
荒谬线程分开希望能得到一些诚实的关注。

VB6有一些简单快速的机制,用于从基本文本文件中检索
值,这反过来可以简单轻松地使用notepad维护


我真的了解XML的好处,但是在
配置文件的情况下,它似乎几乎总是不会超过
不必要的复杂性,无论是访问它们还是维护它们。 />
我错过了什么?





" Nicholas Paldino [.NET / C#MVP]" < mv*@spam.guard.caspershouse.com>写在

消息新闻:%2 **************** @ tk2msftngp13.phx.gbl ...

Daniel,

...当然,当事情有效时,你会想知道为什么你需要额外的复杂性,但当你发现自己处于绑定
并且你必须做出改变时,你很高兴您拥有XML,因为可用于操作它的工具数量非常丰富。


呃..你的意思是编辑器,记事本,写字板,Word等无限广告?来吧

,你必须做得更好。拜托,我不是要试图燃烧起来,但是你只是给出了从不发明的论据。 XML配置

文件首先。

此外,像XML中的其他所有内容一样,它可以轻松插入到其他业务流程中(我在这里使用业务)如果你愿意,VB中的所有例程都在Microsoft.VisualBasic命名空间中实现为静态
方法,该命名空间与
Framework一起分发(类为大部分都在



Microsoft.VisualBasic.dll)。


这对我的C#app来说似乎是一个相当讨厌的解决方案。


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?

解决方案

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.VisualBasic namespace which is distributed with the
Framework (the classes for the most part are in Microsoft.VisualBasic.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.com

"Daniel Billingsley" <db**********@NO.durcon.SPAAMM.com> wrote in message
news:um**************@TK2MSFTNGP10.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?



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?
.




"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@tk2msftngp13.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.VisualBasic namespace which is distributed with the
Framework (the classes for the most part are in


Microsoft.VisualBasic.dll).

That seems a rather nasty solution for my C# app.


这篇关于为什么XML配置文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆