473,387 Members | 1,742 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,387 software developers and data experts.

Persist object

Jon
Hello all,

I'm in need of some brainstormin help!

We have an object that we use in a number of places, both by User Controls
and Pages. This object is loaded everytime we need to use the piece of
functionality.

Example:

The user logs in and the object is loaded, the user then clicks a link to do
a task and again the object is loaded again.

What is the best way to persist the object? Session, cookie etc as it will
be used alot as the user uses the app.

Also, what are people thoughts about this, and it there any patterns that
may help?

Thanks all,

Jon
Nov 19 '05 #1
4 1530
Jon,

If it is an aspx or html page and is called with the same parameters or
without any parameters, it will be cached on the client side and will open
very fast. You will have to tell us more about the nature of the object to
hear other suggestions.

Eliyahu

"Jon" <Jo*@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
Hello all,

I'm in need of some brainstormin help!

We have an object that we use in a number of places, both by User Controls
and Pages. This object is loaded everytime we need to use the piece of
functionality.

Example:

The user logs in and the object is loaded, the user then clicks a link to do a task and again the object is loaded again.

What is the best way to persist the object? Session, cookie etc as it will
be used alot as the user uses the app.

Also, what are people thoughts about this, and it there any patterns that
may help?

Thanks all,

Jon

Nov 19 '05 #2
Some ramblings,

if the object is loaded from server side state then I suggest making
all your pages (and controls?) extend from a base class (that you
create), this class would extend from System.web.UI.Page,

This class could load the object and set a property, which the derived
classes could access.

If the object is not to big then I'd recomend doing this each page
load, caching the object brings in added complexity,

If its a big object (or static for all users) then cache it, use the
session for user based objects and cache for static objects

In my experience though its best to load the object with each page
request

Nov 19 '05 #3
Jon
Eliyahu,

The object is data that is a collection class that we loop through to
create a tree (like Windows). This tree is not only used for navigation, but
also used in UserControls to help the user when carrying out some action,
like copying a file, specifying where to place a file etc.

The data help in the collection class rarely changes, but when we use it, we
always reload it and we were just thinking if that would be a performance
drag?

Thanks,

Jon

"Eliyahu Goldin" wrote:
Jon,

If it is an aspx or html page and is called with the same parameters or
without any parameters, it will be cached on the client side and will open
very fast. You will have to tell us more about the nature of the object to
hear other suggestions.

Eliyahu

"Jon" <Jo*@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
Hello all,

I'm in need of some brainstormin help!

We have an object that we use in a number of places, both by User Controls
and Pages. This object is loaded everytime we need to use the piece of
functionality.

Example:

The user logs in and the object is loaded, the user then clicks a link to

do
a task and again the object is loaded again.

What is the best way to persist the object? Session, cookie etc as it will
be used alot as the user uses the app.

Also, what are people thoughts about this, and it there any patterns that
may help?

Thanks all,

Jon


Nov 19 '05 #4
Jon,

If the collection is specific to a user session, the best place is the
session.

If it is application-wide, meaning it is the same for all users, a public
static variable will be good. You can also use application's Cache if you
want to be able to control the way how the object persists.

Eliyahu

"Jon" <Jo*@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
Eliyahu,

The object is data that is a collection class that we loop through to
create a tree (like Windows). This tree is not only used for navigation, but also used in UserControls to help the user when carrying out some action,
like copying a file, specifying where to place a file etc.

The data help in the collection class rarely changes, but when we use it, we always reload it and we were just thinking if that would be a performance
drag?

Thanks,

Jon

"Eliyahu Goldin" wrote:
Jon,

If it is an aspx or html page and is called with the same parameters or
without any parameters, it will be cached on the client side and will open very fast. You will have to tell us more about the nature of the object to hear other suggestions.

Eliyahu

"Jon" <Jo*@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
Hello all,

I'm in need of some brainstormin help!

We have an object that we use in a number of places, both by User Controls and Pages. This object is loaded everytime we need to use the piece of
functionality.

Example:

The user logs in and the object is loaded, the user then clicks a link to
do
a task and again the object is loaded again.

What is the best way to persist the object? Session, cookie etc as it

will be used alot as the user uses the app.

Also, what are people thoughts about this, and it there any patterns that may help?

Thanks all,

Jon


Nov 19 '05 #5

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

Similar topics

3
by: news.rcn.com | last post by:
How can I access the request and response object for a page using javascript. I want to stick some data on with something like request.setAttribute( "User's choice for later use" ). I can't seem...
1
by: magister | last post by:
hello I am putting together a web form which builds an xml file. I have another class which is referenced in the asp.net page. The first page load creates an instance of the class. In the class...
3
by: John Dalberg | last post by:
I am setting the HttpContext.Current.User in the Application_AuthenticateRequest event in global.asax.cs. When I use the IsInRole function in a web page, it works fine. So far so good. (Note that...
2
by: dotnettester | last post by:
I'm having hard time using FileInfo object. Using aspupload component from Persist I can view the file like object.FileExist(absolutePathToaFileOnNetwork) works but it fails with FileInfo...
6
by: Kent Johnson | last post by:
Is there a way to persist a class definition (not a class instance, the actual class) so it can be restored later? A naive approach using pickle doesn't work: >>> import pickle >>> class...
0
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design...
1
by: =?Utf-8?B?amVmZg==?= | last post by:
Hi. I am wondering if it is possible to serialize or somehow persist a COM object that does not implement IPersist or IPersistStream from VB.NET. Is it possible to roll my own serializer; ideally...
5
by: keyser soze | last post by:
hi i get data with ado i need to get a xml string from the recordset how can i get it without having to persist the recordset in a (xml) text file is there a simple way ?
5
by: Marc | last post by:
Ok, I am studying dot net, and I have a probably newbee sort of question again. I have made a form and a button that fills the gridview on the form. I also want to make a delete and edit button....
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$) { } ...
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
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,...
0
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...
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.