Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2004, 11:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default Class existens in ASP.NET

If I create a class in a dll and use it within my ASP.NET app, how will IIS handle that class? I'm trying to make an online bookstore and want to do it in an OO way. But I'm afraid my objects will die between sessions.
I.E. A user logs in and I create a Customer object from my Customer class and fill it with data from my database - will this object exist during sessions or do I need to save it somewhere, like in sessions variables?

Any pointers would be great! :)

 - mega
Moving to C# .NET
__________________
- mega
Aspiring JavaScript Ninja
 
Old November 18th, 2004, 05:38 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Typically, the technique is to load the object every time the user hits the server. If you store an excessive number of objects in the session, you'll chew up server memory. Instead, store some small piece of data such as a user ID in session so that you can create and load the user information based on that user id when you need it. For the example of an online store, you can have a database table that contains the contents of a user's shopping basket. You can call up the basket contents by querying the table with the user's ID. Again, you only then need to store the userid in the session to minimize one user's data footprint in memory.
 
Old November 19th, 2004, 11:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

Then I need to decide when to instantiate my object.. Hmm - I'm almost compelled to do ASP.NET stuff function based instead of OO. Do you know if the ASP.NET books from Wrox have a OOP approach or can you direct me to a ASP.NET book that does? I'm not sure I get this OOP thingy when it's applied to websites.

I know it's off topic - but do I really want to post a new topic just for that (and do you really want receive that)?

 - mega
Moving to C# .NET
 
Old November 21st, 2004, 05:36 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

you talked about BookStore applications,
take a look at here,it offers you an opensource sample,
also in ASP.NET Starter Kits I think Commerce Starter Kit is another good sample.

--------------------------------------------
Mehdi.:)
 
Old November 21st, 2004, 11:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

Thanks a bunch. I can't get to the http://www.gotocode.com/apps.asp?app_id=3 URL though..

 - mega
Moving to C# .NET
 
Old November 21st, 2004, 02:45 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

I think there is something wrong with gotocode,maybe it comes back again in next few hours,anyway you can send me an e-mail,I will give you the gotcode's sample ...

--------------------------------------------
Mehdi.:)
 
Old November 23rd, 2004, 12:04 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by mega
 Do you know if the ASP.NET books from Wrox have a OOP approach or can you direct me to a ASP.NET book that does? I'm not sure I get this OOP thingy when it's applied to websites.

OOP is OOP regardless of where it's used. Any .NET book is going to take an OO approach because that is how .NET works. That's the best part of .NET. You can use the same code regardless of what UI you are consuming it in. Build an OO solution and plop an ASP.NET front end on it.
 
Old November 23rd, 2004, 01:30 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

You're right. I’m using a MVC pattern and the Customer class is used by the controller layer. This is all fine but the objects die after each hit and I’ll need to initiate them again – filling them with data from my database.
I'm just used to think performance everywhere and initiating the objects every time opposed to just get the datasets directly from the db and use them in my code_behind, seem like a big overhead. But I guess that’s the cost of OOP and yeah, I could just as well use winForms instead.

I blame my C# book my insecurity.
Thanks to both of you.

 - mega
Moving to C# .NET





Similar Threads
Thread Thread Starter Forum Replies Last Post
My own class in asp.net 2.0 DarkForce ASP.NET 2.0 Professional 1 October 13th, 2008 12:39 PM
Error When Using Webclient class in ASP.NET sebastiansony .NET Web Services 0 June 24th, 2005 12:16 AM
A Class in ASP.NET Maxood ASP.NET 1.0 and 1.1 Basics 12 March 25th, 2004 03:31 PM
.NET class file in ASP page shahpragnesh_p VS.NET 2002/2003 1 August 22nd, 2003 10:50 AM
Exception Handling in ASP.net class mittalpa VS.NET 2002/2003 0 July 11th, 2003 03:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.