473,791 Members | 3,122 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Preserving data within a whole application.

I just recently recieved my full copy of Visual Studio 2005
(excited!!!), and have gone head first into writing my first
application.

Sadly, I've hit a design barrier.
From what I can see, ASP.NET 2.0 has no facility that is instantiated

upon deploying an application - similar to servlets. I don't really
need the functionality of a servlet, but what I am interested in
getting is an "always on" class that exists between different requests
between different ASP.NET classes.

My first instinct is to create some static monster class that has all
my functionality and that will persist for the duration of the whole
ASP.NET application's life. Although something in my gut tells me that
static classes are not to be abused in such a way.

Does ASP.NET provide me with anything that I can use to share
information between aspx pages and web service classes? On top of
that, what would be the best way to write a totally non-visual class
that is responsible solely for my "business logic"? The idea is that
after writing this omnipresent workhorse class, I'll use aspx pages,
web service pages and anything else to make use of the same set of data
without having to hit a database for small tidbits of session data.

(I'm writing a very simple user login system, and while I'm aware of
ASP.NET's built in user handling, I would like to write my own system
and then work it into ASP.NET's system afterwards.)

Apr 29 '06 #1
4 1232
You aren't actually looking for servlet functionality but application level
state? Cache or Application could help with that

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Omega" <at******@gmail .com> wrote in message
news:11******** *************@y 43g2000cwc.goog legroups.com...
I just recently recieved my full copy of Visual Studio 2005
(excited!!!), and have gone head first into writing my first
application.

Sadly, I've hit a design barrier.
From what I can see, ASP.NET 2.0 has no facility that is instantiated

upon deploying an application - similar to servlets. I don't really
need the functionality of a servlet, but what I am interested in
getting is an "always on" class that exists between different requests
between different ASP.NET classes.

My first instinct is to create some static monster class that has all
my functionality and that will persist for the duration of the whole
ASP.NET application's life. Although something in my gut tells me that
static classes are not to be abused in such a way.

Does ASP.NET provide me with anything that I can use to share
information between aspx pages and web service classes? On top of
that, what would be the best way to write a totally non-visual class
that is responsible solely for my "business logic"? The idea is that
after writing this omnipresent workhorse class, I'll use aspx pages,
web service pages and anything else to make use of the same set of data
without having to hit a database for small tidbits of session data.

(I'm writing a very simple user login system, and while I'm aware of
ASP.NET's built in user handling, I would like to write my own system
and then work it into ASP.NET's system afterwards.)

Apr 29 '06 #2
Neato, how would I go about making use of that?

Where in my application can I have my workhorse class instantiated
before any requests are made? Should I just write a singleton that
stores it's reference in the cache or Application?

Keep in mind, I want this object to exist for every page and web
service in my program. It must exist across page loads, across page
types and across users. I want all that information to be preserved
even after the page has been rendered and sent out to the user.

Apr 29 '06 #3
That is Application or Cache, both are application wide. Difference is that
Cache supports all sorts of dependencies where cached data can be stalled
when for example a file or other cache item, (in ASP.NEt v2 also data in
database) changes while Application is just static. You could initialize
them in global.asax in Application_Sta rt event which runs once when app
starts. Or you could do it in lazy way when first request for the data comes
in. It's up to you.

On Page you have Cache and Application properties available as is. Like

Application["key"] = obj;
object obj = Application["key"];

//And same with cache plus a few overloads of Insert method

In web service you access cache with Context.Cache or just HttpRuntime.Cac he
(Application is as-is). In case you want to be sure about accessing even
without request context you could use HttpRuntime.Cac he

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Omega" <at******@gmail .com> wrote in message
news:11******** **************@ j33g2000cwa.goo glegroups.com.. .
Neato, how would I go about making use of that?

Where in my application can I have my workhorse class instantiated
before any requests are made? Should I just write a singleton that
stores it's reference in the cache or Application?

Keep in mind, I want this object to exist for every page and web
service in my program. It must exist across page loads, across page
types and across users. I want all that information to be preserved
even after the page has been rendered and sent out to the user.

Apr 29 '06 #4
You Finnish folk rock my small Canadian world. One of my favourite all
time teachers from high school is a Finnish dude.

Thank you so much for the help!

Apr 29 '06 #5

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

Similar topics

6
1804
by: Karl | last post by:
This might not really be a javascript question, but I'll start with this group. At http://www.gazingus.org/ there is a very nice collapsible menu written using CSS and Javascript >>>> Using Lists for DHTML Menus HTML lists, along with well-placed CSS and JavaScript, result in flexible dynamic menus that gracefully degrade in older browsers.<<<<<<<
8
25406
by: Jerry | last post by:
I have an off-the-shelf app that uses an Access database as its backend. One of the tables contains a field with an "OLE Object" datatype. I'm writing some reports against this database, and I believe this field contains data I need. When I view the table in datasheet view, all I can see in this field is the string "Long binary data". So, I've got the problem of needing to extract data from this field, but I don't know what format...
16
5142
by: TTroy | last post by:
Hello, I'm relatively new to C and have gone through more than 4 books on it. None mentioned anything about integral promotion, arithmetic conversion, value preserving and unsigned preserving. And K&R2 mentions "signed extension" everywhere. Reading some old clc posts, I've beginning to realize that these books are over-generalizing the topic. I am just wondering what the difference between the following pairs of terms are: 1)...
5
3409
by: rAinDeEr | last post by:
Hi, I have a web application with a table to store terms and conditions of a Company. This may some times run into many pages and some times it may be just a few sentences. It is a character text field. I want to know which Data type I need to use so that it doesnt waste memory. thanks in advance, rAinDeEr
9
5740
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo field is printed within the detailed area. The problem is, the apllication is not setup properly, thus the users are entering data within the memo field as: location1 1/1/2005 1/1/2006
2
4568
by: Clive Green | last post by:
Hello peeps, I am using PHP 5.2.2 together with MP3_Id (a PEAR module for reading and writing MP3 tags). I have been using PHP on the command line (Mac OS X Unix shell, to be precise), and am getting on more or less OK. So far, I have managed to parse my tab-delimited .txt file properly into an array, and then use this array to update the tags on a bunch of MP3 audio files. Nice.
3
3303
by: sophia.agnes | last post by:
Dear all, I was going through the book "C a software engineering approach by darnell & Margolis" there was a section named sign preserving vs value preserving it is as follows sign preserving rule:- when signed and un signed objects meet in an expression, the result is
9
5165
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all On SQL Server tables I use SqlDataReader to query data like "SELECT * FROM table". Is there something similar for XML Files ? I want to use SQL Syntax like "SELECT * FROM table" on a XML file. After query I want to get something like SqlDataReader based on Query to loop. I do not want to use a DataSet. It should be more like streaming
0
9666
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
10419
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
10201
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6770
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
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2910
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.