473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Application Design Question

Hello everyone I'm hoping someone with more experience can suggest how
I would go about designing the following:

We have a standard web application and in its current form there are no
distinct layers. Everything is jumbled together. In an effort to
deploy new code in a more structured manner I've decided to break apart
the UI from the Business (no big stretch here). I have a data access
class in my business layer which is obviously called frequently.

We're using mulitple databases and thus have multiple connection
strings encoded in web.config. The data class I'm building now
retrieves the various connection strings and then depending on the use
a certain connection object is instantiated.

So far so good - no major issues here, however, rather than always
going to web.config (or AppSettings) and iterating through all the
AppSettings to find the connection strings seems silly so I chose to
iterate through them the first time the data class is called and then
store the list in cache which each subsequent instantiation calls.

My dimlema now is more one of design principle rather than a technical
problem. If my data class calls into the System.Web.Cache and I want
to get a current instance of the web application then in a sense I'm
starting to mix my layers again (aren't I).

Is it regarded as poor practice to 'touch' the HttpApplication object
from the business layer? It seems that the HttpApplication object
lives in the presentation layer and as such so does the cache. Am I
being too fussy about breaking apart my layers given that this is a web
application?

Can someone give me a shove in the right direction?

Thanks

Nov 19 '05 #1
2 1335
Not sure about your design issue... struggling with these things myself :-S
But you could use the Caching Application Building Block from the Design &
Pattern team. Then you are on the save side.
http://msdn.microsoft.com/library/de...l/caching1.asp
--
Remy Blaettler
Helping you collaborate better!
www.collaboral.com
<mr********@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello everyone I'm hoping someone with more experience can suggest how
I would go about designing the following:

We have a standard web application and in its current form there are no
distinct layers. Everything is jumbled together. In an effort to
deploy new code in a more structured manner I've decided to break apart
the UI from the Business (no big stretch here). I have a data access
class in my business layer which is obviously called frequently.

We're using mulitple databases and thus have multiple connection
strings encoded in web.config. The data class I'm building now
retrieves the various connection strings and then depending on the use
a certain connection object is instantiated.

So far so good - no major issues here, however, rather than always
going to web.config (or AppSettings) and iterating through all the
AppSettings to find the connection strings seems silly so I chose to
iterate through them the first time the data class is called and then
store the list in cache which each subsequent instantiation calls.

My dimlema now is more one of design principle rather than a technical
problem. If my data class calls into the System.Web.Cache and I want
to get a current instance of the web application then in a sense I'm
starting to mix my layers again (aren't I).

Is it regarded as poor practice to 'touch' the HttpApplication object
from the business layer? It seems that the HttpApplication object
lives in the presentation layer and as such so does the cache. Am I
being too fussy about breaking apart my layers given that this is a web
application?

Can someone give me a shove in the right direction?

Thanks

Nov 19 '05 #2
I understand your discomfort.

I think you have a few options:
1. Use the Configuration Application Block from
www.microsoft.com/practices which implements its own caching mechanism
(either the older block or Enteprise Library).
2. Pass the web apps' Cache object into the methods that need it, or
into their New() constructors, and use it, and swallow your discomfort.
(I have done this, its not bad, you can substitute another cache object
when you need to use it with another platform at some point, should
that ever come).
3. Write your own connection string provider class that is a
Singleton-type class with its own caching mechanism - should be fairly
easy to do, and you can decide if you want to put a FileSystemWatcher
onto the configuration file or not (if its always in web.config, then
there's no point - any changes to that file and your app automatically
gets restarted).

Mike

Nov 19 '05 #3

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

Similar topics

4
by: MG | last post by:
A Newbie question perhaps, but here goes: Is it possible to seaprate the presentatieon layer, i.e., the html, from the application itself. For example, our developer has told us that we cannot...
43
by: Davey | last post by:
I am planning on developing an application which will involve skills that I have very little experience of - therefore I would appreciate comments on my initial design thoughts. Overview on...
4
by: Adam Clauss | last post by:
This may be more of a Visual Studio question than a C# question, but it came up within the context of a C# app, so here it is. In a Windows Form or a Web Form application, you can drag various...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
10
by: Saso Zagoranski | last post by:
hi, this is not actually a C# problem but since this is the only newsgroup I follow I decided to post my question here (please tell me where to post this next time if you think this post...
1
by: aparnasinha26 | last post by:
Hi All, I have to develop an application .The application has to update database.It does not have any user interface.It needs to run on Windows XP/2000 automatically at a particular time say 4...
2
by: Matthew Hood | last post by:
My company has expressed a desire to convert an existing MS Access application to a full VB.NET application. My experience is with VB6 so I want to ask a few questions and get some input on the...
4
by: Paciente8159 AKA Klayman | last post by:
Hi, I have a couple of doubts reggarding a plugin based application in C++? I want to build a c++ plugin based app. I have searched alot of things in the net but I still don't know how to...
6
by: goraya | last post by:
This is design level discussion about web applications. How I design application that support 1 million concurrent requests??
5
by: Frank Moyles | last post by:
I am a developer with many years (approx 10years) development experience using C++ for DESKTOP applications. I am writing a web application using C#, and I wanted to ask a question about...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.