Need Help with an ASP.NET 2 application organisation !

M

mateo

Hello i would like to have advices on an ASP.NET 2 application that i
must develop.
I'm new to ASP.NET, i am more of WinApp developper, so if there is some
experienced folks out there all advices are welcome.

So there it is, i'm developping an asp application that will be
accessed by many workers in a company. The app is basically dealing
with parts and customers (we sell pieces off all kind and we have lot's
of customers). My database will be SQL SERVER 2005 running on a
dedicated server. User's of this application will be devided in 3
groups, which one having some previleges and access to different parts
of the application.

Now all users will have access to parts,customers and some other
tables. So i am wondering if there is a way of sharing my dataset
containing for example(parts, customers and misc tables) with all users
of the application, so that i can cache this dataset and maintain state
(update, insert, delete) of those data in a global way. And if so how
can i achieve this behavior?

My database schema is almost done, i've use the asp_regsql tool to
create my users table in the database, but i've noticed that a user is
identified with a GUID. In my schema customers and users are identified
with a BigInt. What is the best way to link GUID to BigInt? I was
thinking of adding a table which would make the relation between a user
connecting to the app with a GUID and a user or customer represented by
a BigInt. Is this a good way of doing things?

Thanks in advance
Mateo
 
T

Tim_Mac

hi,
there are plenty of different ways of managing groups of users. the
simplest one to implement is just to have a UserType field in the
database, and then when the user logs in, you check their type and show
or hide links or information accordingly.
you can go more high powered then and have multiple group membership,
using a binary syntax, with each group having an identifier which is a
power of 2. then the membership 'value' can be defined as an OR-ing of
each of the group identifiers. to check membership, simply AND the
value with a group identifier, and if you get the group identifier back
then the user is a member.

in terms of your user interface then, you can have a page for each user
type if the displayed information is totally different. or you can
show or hide panels on a single page for each type of user.

for your data access, you can certainly implement a caching mechanism
such as you suggest. or you could use output caching based on a value
in Session["UserType"] or something like that. or you could just send
your commands straight to the database and skip the whole caching
thing, this may be worth considering if your dataset could get very
large and drag down the server. if the aspnet_wp.exe process takes up
too much memory, windows will recycle it regularly, which will really
degrade performance.

so many options... feel free to ask further questions.
tim
 
M

mateo

Hi and thanks for your advice.

I was thinking of managing users with the provided mecanism of asp.net
(role, membership,..) and related tables created.
To manage what users can see or not in the website i'll rely on groups
and the Web.Sitemap.

I saw that there's a file global.asax (i think) that allows me to
declare some variables global to the application and some to sessions.
Would it be a good place to instantiate my DataSet that i want to share
?

Is there a way i can cache different size of data by session or user
accessing the application ?

I'm kinda lost here, time to go !
thanks tim
mateo
 
T

Tim_Mac

hi mateo

you can declare application or session variables at any place in a web
application: global.asax, code behind for a page, direclty in an aspx
page etc. but it does make sense to set up application variables in
the Application_Start event, and Session variables in the Session_Start
event, which are both in global.asax

you probably don't want to put the dataset in the session state,
because you will have so many copies of it in memory if you have lots
of concurrent users, unless of course each user needs a custom dataset?


when you say different size of data, do you mean you want to cache a
dataset differently depending on how big it is?

i might suggest one thing and that is not to be totally sold out on the
idea of keeping all your data as an in-memory dataset, and managing the
consistency throughout. it can be a lot of work, and may not be
necessary. as you will know, SQL is extremely fast, and there are many
cases where you do not need to use caching at all. it all depends on
how intensive your data requirements are.

i know myself from building winforms applications you typically work
with a local copy of all relevant data in whatever object form (dataset
or otherwise) and make sure to copy changes to the database at all
times. but the web application model is very different. web pages are
single units that may only need a tiny piece of information to complete
their task.

tim
 

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

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top