Using Application Settings in N-tier architecture

S

schoenfeld.one

How are Application Settings supposed to be used in multi-tiered
applications?


If I have a winforms application consising of 2 projects

1. UI PROJECT: has the settings

2. DATABASE PROJECT: needs the settings

It seems 2 must reference 1, but that would create a cyclic reference
as 1 needs 2 as well.
 
R

RobinS

Actually, you should have 3 layers.

1) UI
2) Business layer
3) Data layer

The UI talks to the business layer, passing in what it needs and
using its classes and the methods and properties thereof.

The business layer calls the data layer to access and update the
data.

Specifically what kind of application settings are you talking about?

Robin S.
 
M

Michael Nemtsev

Hello (e-mail address removed),

Use the setting specific to the domain next to your domain app, so all ui
settins are next to ui project and db settins are next to db project
---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
 
S

schoenfeld.one

Hello (e-mail address removed),

Use the setting specific to the domain next to your domain app, so all ui
settins are next to ui project and db settins are next to db project

I couldn't get Settings files to work in my Class Library project. Any
ideas?
---
WBR,
Michael Nemtsev [C# MVP] :: blog:http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
How are Application Settings supposed to be used in multi-tiered
applications?
If I have a winforms application consising of 2 projects
1. UI PROJECT: has the settings
2. DATABASE PROJECT: needs the settings
It seems 2 must reference 1, but that would create a cyclic reference
as 1 needs 2 as well.
 
M

Michael Nemtsev

Hello (e-mail address removed),
I couldn't get Settings files to work in my Class Library project. Any
ideas?

What the settings are - just XML!
Use System.Xml namespace to work with them. For example i prefer to to use
XPath to get values from config's libs

---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangel
 
S

schoenfeld.one

Hello (e-mail address removed),


Use System.Xml namespace to work with them. For example i prefer to to use
XPath to get values from config's libs

I was kind of hoping to reap the benefits of the Visual Studio
Application Settings Editor.

It seems it only works on top-level projects.
---
WBR,
Michael Nemtsev [C# MVP] :: blog:http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
 
S

schoenfeld.one

Actually, you should have 3 layers.

1) UI
2) Business layer
3) Data layer

The UI talks to the business layer, passing in what it needs and
using its classes and the methods and properties thereof.

The business layer calls the data layer to access and update the
data.

Actually, I have many more tiers (emissary. I was giving a simple
example of what I need.


Specifically what kind of application settings are you talking about?

In VS.NET 2005 you can create/edit/remove settings in an editor. The
editor creates the XML file and also updates a statically typed
settings class which references that XML file.

I want to use those features but in all my tiers, not just the top-
level tier.

Can I do that?
 
R

RobinS

Actually, I have many more tiers (emissary. I was giving a simple
example of what I need.




In VS.NET 2005 you can create/edit/remove settings in an editor. The
editor creates the XML file and also updates a statically typed
settings class which references that XML file.

I want to use those features but in all my tiers, not just the top-
level tier.

Can I do that?

I know how to do it in VB. Do you want me to post it, and you can
figure out how to do it in C#?

Robin S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top