471,605 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

XML file vs. DLL?

I'd like feedback on using an app.config file to store static
information such as company name, database name, etc. then use a DLL to
load it. I want to put everything into enumerators. This is a winform
app. I'd like to avoid having to create an instance to access this
information. In other words, using only static methods.

The DLL allows me do any related additional processing specific to only
the static info. This seperates the static information from the
application and keeps it from attaching itself to one of the winforms
via instantiation. In other words, the winform app will use a non form
class as its startup object. The non form class will call the DLL, do
any additional processing, and load the first form. Does any one see
problems doing this?

XML or config file:
Will I need to load from the config file everytime since the methods
are static? Example?

Thanks,
Brett

Dec 8 '05 #1
2 1437
Brett,

I would look into creating a configuration provider. Basically, you can
place your XML configuration in the .config file for the app, and then that
information would be provided through the classes in the
System.Configuration namespace.

Check out this article on developer.com titled "Using Application
Configuration File in .NET", located at (watch for line wrap):

http://www.developer.com/net/net/article.php/3396111

This should give you the information you need to create your own
configuration handler.

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

"Brett Romero" <ac*****@cygen.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I'd like feedback on using an app.config file to store static
information such as company name, database name, etc. then use a DLL to
load it. I want to put everything into enumerators. This is a winform
app. I'd like to avoid having to create an instance to access this
information. In other words, using only static methods.

The DLL allows me do any related additional processing specific to only
the static info. This seperates the static information from the
application and keeps it from attaching itself to one of the winforms
via instantiation. In other words, the winform app will use a non form
class as its startup object. The non form class will call the DLL, do
any additional processing, and load the first form. Does any one see
problems doing this?

XML or config file:
Will I need to load from the config file everytime since the methods
are static? Example?

Thanks,
Brett

Dec 8 '05 #2
Yes, and I was doing that before. However, as you can see in the
example, he must provide a hard coded string reference to keys in the
file. Now, if those keys change, he's stuck. That's why I want a
combination of the configuration provider and DLL. The DLL will load
the enumerators from the file. Then I'd like to statically access the
enumerators. This keeps the app from having to know anything about the
file except in the initial startup non form class.

Brett

Dec 8 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by matt | last post: by
7 posts views Thread by Joseph | last post: by
3 posts views Thread by StGo | last post: by
3 posts views Thread by Shapper | last post: by
reply views Thread by thjwong | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

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.