Not to sound stupid, but how (in VB.NET) would I create a singleton class
like that?  As a separate assembly?  (I would think so.)  I get that it
will require that the various properties and methods will need to be
Shared, but I am not sure on the rest.


On Thu, 11 Apr 2002 13:12:15 -0500, franklin gray
<[EMAIL PROTECTED]> wrote:

>I was going to create a XML Document and put it in a singleton class that
is available to the entire app.  This way it would be in memory at all
times for quick access like the config file.
>
>-----Original Message-----
>From: Andrew Cherry [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, April 11, 2002 11:26 AM
>To: [EMAIL PROTECTED]
>Subject: Re: [DOTNET] .Config vs .INI vs Registry Question
>
>
>Looking at your recommended XML solution... I'm just curious. Do you
>hack together your own XML reader and writer based on the
>XMLReader/Writer classes, or is there a class that can be used to
>retrieve data via something akin to query strings (a la the
>serialization mechanism) already present in .Net somewhere?
>
>Thanks,
>Andrew
>
>-----Original Message-----
>From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf Of
>franklin gray
>Sent: Thursday, April 11, 2002 11:54 AM
>To: [EMAIL PROTECTED]
>Subject: Re: [DOTNET] .Config vs .INI vs Registry Question
>
>
>I might be telling you something you already know.
>
>If you have an exe with say 10 dlls, you can create a config file and
>use the settings in the config file for all 11 projects (the exe and
>dlls).  You can't, however, create two exes and have both use the same
>config file.  Plus, you can't write to the config file at run time
>easily.  So, with that said, if you need to share data between two apps
>or write to it at runtime, then I like the idea of creating your own XML
>file and reading from that.
>
>I was going to do that for user preferences until we decided that the
>preferences should be kept by login Id and not machine.  So if a user
>logged in on another machine, we wanted the user to still have the same
>preferences, which meant we had to store that in the DB.
>
>Things such as URLs and DB connections and so on that only change at
>install times or a system change, then I use the config file.  I like it
>so much better then the registry because it's easy for me to change when
>testing.  Ini files are OK, but I think XML files gives us a much better
>format to store the data.
>
>-----Original Message-----
>From: David Williams [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, April 11, 2002 10:06 AM
>To: [EMAIL PROTECTED]
>Subject: [DOTNET] .Config vs .INI vs Registry Question
>
>
>I am currently spec'ing out a distributed application (by which in this
>case I mean that it requires many different assemblies) and was looking
>for the "correct" method of building and accessing external
>configuration data. If I was working in VB6 like I used to I would use
>either an .INI file (if the pieces would reside on different boxes) or
>the Registry (if they all reside on one box.)  In .NET the technology is
>to use .config files for external configuration.  The problem that I am
>having is:  How do I create and use a .config file across assemblies, or
>am I going down the wrong path altogether?
>
>David Williams
>Senior Developer
>Strohl Systems
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET,
>or subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET,
>or subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to