Last post Nov 15, 2006 11:10 AM by pkellner
Nov 15, 2006 08:32 AM|FCsteve|LINK
Recently I have been looking into creating 'services' running in my asp.net application. These services will be called by helpers, but will persist so that they maintain performance by having 'indexes' of the items added to them rather than calling up a
database or xml file whenever items within it are examined.
I decided to inherit a httpmodule to run the service, the service would be initiailized by the applications initialization, at which time the service would load in the xml file/database table and thus contain the most current index.
I am however wondering if this approach is the best- the httpmodule appears to persist the lifetime of the application which is what i require, but am i using the right class to represent a 'service'.
Also, my helper class looks through the application's modules to find the 'service' and call methods to it -- is this the right approach too?
The service basically acts as a 'redirector' that allows me to subscribe paths and where they should actually end up, the service maintains token folder structures so that isapi will forward requests to .net (i cant tell iis to forward them because this
is a shared server).
Hopefully that makes sense, and I am aware that creating empty folders with token default.aspx files isn't the best idea, but its the only way i can actually acheive a 'restful' path structure within our site.
Nov 15, 2006 10:16 AM|pkellner|LINK
Nov 15, 2006 11:00 AM|FCsteve|LINK
Sorry Peter I probably didnt explain well.
The service will save the data to an XML file, but as well as this it will store the 'brief' information in memory for quicker indexing of this saved data. This way an application end won't actually cause data loss because the data is actually persisted
in full in the xml file. So when the application starts the httpmodule should be initialized, and during init() it checks the web.config for the configuration data, then during the first request it will map to the XML file and retreive the 'brief' information
from it and store it in memory for indexing.
I'm not entirely sure if this indexing is useful, it saves me time opening an xml document and iterating over the data to find a match, but may be more fuss this way than its worth.
I guess my base question was- are modules the 'way to go' when trying to run 'services' on an asp.net application.
Nov 15, 2006 11:10 AM|pkellner|LINK