custom component across asp.net pages..

T

Tom L

I'm pretty new to .net stuff, but not new to programming (lots of vb, sql,
cold fusion, and some asp)..
I have a "middle layer" object model I created, that has all my business
rules and database access for an order entry system, starting with the Order
object, and other basic child items, like LineItems and PAyments under that.
This is being used in the vb.net front-end for normal users in the company,
but I'd like to use this for the web front-end as well in asp.net.

But I'm trying to best figure out where and how I keep the session data for
the user.

Scenario 1 - Use the object model in a passive way, where I use only
individual objects as necessary for "some" rules and db operations, and
after every web page I update data in a "shopping cart" table, and populate
the objects as necessary.

Scenario 2 - Somehow pass the Order object from page to page, which will
keep all data available, especially for those complex operation like order
totalling.

I would like to save some load on the sql server, and would prefer NOT to
have a db r/w every page access. Plus, I'm really after code reuse; but I'm
also looking for maximizing web performance.

Where do web services factor in? Is this a case where I take my "order
component" and turn it into a web service, or do I call it as just any
other object?

Thanks!
 
T

Teemu Keiski

Web services have also performance drawback as they involve serializing for
custom objects and sending over the wire (well not so bad if done on same
machine but still involves serialization two times, serializing and
deserializing).

As you discussed about using straight database, then what if you'd use
purely ASP.NEt's built-in session mechanism? In InProc mode it is very
efficient and doesn't involve serializing but you lose durability if app
restarts or crashes as then session data is just gone.

ASP.NET session has also two more targeted modes for such scenarios like
StateServer (external service) or SQL Server database itself. With
StateServer session is persisted on external service (same or other machine)
so if app crashes, data is not lost. However if service fails (probably
whole server having the service crashes) data would then be lost. SqlServer
mode is even more reliable as session data is physically stored in database.
These two modes have same kind of drawback as web services had that data
needs to be serialized in order to be stored to custom store.

If you think this could be an option, see more details about each session
mode at ASP.NEt Forums:
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=7504

--
Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top