473,805 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Cach e 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 1355
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********@hot mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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.Cach e 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 FileSystemWatch er
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
1974
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 do immeidate changes to user interface becasue the presentaion layer is bound up with the rest of the dll and to eextract that out of the app, would take ages. and so any changes would be incorproated into the next buiild compilation.
43
2855
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 system: I'm not going to divulge the exact aims of the application but the purpose of it is to allow multiple client applications to retrieve data from a database (on a db server) and feed this data into another Windows
4
1996
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 DataAdapters and create DataSets bound to them so everything is strongly typed - a very nice feature. Why in the world can this not be done the same way for ANY type of application (say, Console, or Class Library). What do these features have...
6
20088
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 quite a few words in this post but the questions are actually quite similar and should be fairly quick to answer ... (1) What is Happening with the Threads
10
2140
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 shouldn't be here). I have two design questions: 1. what is the correct (or best) way to include database queries into the code if you plan on
1
326
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 p.m. daily. I have to develop the application in VB.net My first question is which Visual Basic.Net Project type do I use- Windows Service Or Class Library? Second Question is What are the necessary initial steps I have to take during development?...
2
1866
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 best way to handle the following design: Situation: We want to allow our customers to install with one of the following options: 1. Use an Access MDB file as the data backend. 2. Use a SQL Server backend. (Either MS SQL, or MySQL) 3. Use an...
4
3722
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 start this. For example: I want the plugin to be able to expose functions and HANDLES (for synchronization with WaitForSingleObject for example).
6
4127
by: goraya | last post by:
This is design level discussion about web applications. How I design application that support 1 million concurrent requests??
5
1275
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 appropriate design. My design is as follows: I have an Application class, which delegates to various classes to perform required functionality. The application class is responsible for the following:
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10609
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.