I am a developer with many years (approx 10years) development experience
using C++ for DESKTOP applications. I am writing a web application using
C#, and I wanted to ask a question about appropriate design.
My design is as follows:
I have an Application class, which delegates to various classes to
perform required functionality. The application class is responsible for
the following:
Authentication
Authorization
UserManagement
SystemAdmin
etc.
Because of the nature of the work that the Application class does, there
should not be more than one instance of it at any given time - since
both instances for example, may try to modify/save the same object to
database.
I was therefore thinking of implementing the Application class as a
Singleton. But then I rembered that a web application is different from
a desktop application, because you have several users requiring
authentication/authorisation etc at the same time - so maybe a Singleton
pattern would not be appropriate for web applications.
Even if I used a Singleton pattern - is the single instance restricted
to a particular users session - or does it apply server wide - i.e.
accross all sessions?
Any help and insight from experienced web application designers would be
much appreciated. 5 1273
Why don't you just use existing asp.net classes found in the
System.Web.Secu rity namespace?
If you want to wrap them into your code, you can make a set of classes that
we handle all these aspects based on the existing classes, like
securityManager , userManager etc, and all your pages will use these classes.
If you want to share these classes between several applications, make them
in a separate project as a class library and include it to different
applications.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Frank Moyles" <fg******@nospa m.comwrote in message
news:L6******** *************@b t.com...
>I am a developer with many years (approx 10years) development experience using C++ for DESKTOP applications. I am writing a web application using C#, and I wanted to ask a question about appropriate design.
My design is as follows:
I have an Application class, which delegates to various classes to perform
required functionality. The application class is responsible for the
following:
Authentication
Authorization
UserManagement
SystemAdmin
etc.
Because of the nature of the work that the Application class does, there
should not be more than one instance of it at any given time - since both
instances for example, may try to modify/save the same object to database.
I was therefore thinking of implementing the Application class as a
Singleton. But then I rembered that a web application is different from a
desktop application, because you have several users requiring
authentication/authorisation etc at the same time - so maybe a Singleton
pattern would not be appropriate for web applications.
Even if I used a Singleton pattern - is the single instance restricted to
a particular users session - or does it apply server wide - i.e. accross
all sessions?
Any help and insight from experienced web application designers would be
much appreciated.
On Sun, 23 Dec 2007 11:27:49 +0000, Frank Moyles <fg******@nospa m.com>
wrote:
>I am a developer with many years (approx 10years) development experience using C++ for DESKTOP applications. I am writing a web application using C#, and I wanted to ask a question about appropriate design.
My design is as follows:
I have an Application class, which delegates to various classes to perform required functionality. The application class is responsible for the following:
Authenticati on Authorizatio n UserManageme nt SystemAdmin
etc.
Are these things your Application class does or things the web
application will have to do to support the Application class?
> Because of the nature of the work that the Application class does, there should not be more than one instance of it at any given time - since both instances for example, may try to modify/save the same object to database.
I was therefore thinking of implementing the Application class as a Singleton. But then I rembered that a web application is different from a desktop application, because you have several users requiring authenticati on/authorisation etc at the same time - so maybe a Singleton pattern would not be appropriate for web applications.
How does this work with the desktop application? It would seem that if
user A is running one instance of the app on box A and user B is also
running an instance on box B, concurrency issues might exist. With a
web application is both instances will run on box C. The
functionality's container isn't radically different in this respect.
>Even if I used a Singleton pattern - is the single instance restricted to a particular users session - or does it apply server wide - i.e. accross all sessions?
Any help and insight from experienced web application designers would be much appreciated.
Re-examine the desired core functionality and determine how/if it can
be used by multiple users at once. Any possible concurrency should be
handled within the application and not be limiting the application to
a single instance.
regards
A.G.
I agree here. In addition, Singletons on the web are exceedingly difficult
to create especially across a server farm - throw in web gardens and it
becomes an expensive approach.
--
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:eP******** ******@TK2MSFTN GP05.phx.gbl...
Why don't you just use existing asp.net classes found in the
System.Web.Secu rity namespace?
If you want to wrap them into your code, you can make a set of classes
that we handle all these aspects based on the existing classes, like
securityManager , userManager etc, and all your pages will use these
classes.
If you want to share these classes between several applications, make them
in a separate project as a class library and include it to different
applications.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Frank Moyles" <fg******@nospa m.comwrote in message
news:L6******** *************@b t.com...
>>I am a developer with many years (approx 10years) development experience using C++ for DESKTOP applications. I am writing a web application using C#, and I wanted to ask a question about appropriate design.
My design is as follows:
I have an Application class, which delegates to various classes to perform required functionality. The application class is responsible for the following:
Authenticati on Authorizatio n UserManageme nt SystemAdmin
etc.
Because of the nature of the work that the Application class does, there should not be more than one instance of it at any given time - since both instances for example, may try to modify/save the same object to database.
I was therefore thinking of implementing the Application class as a Singleton. But then I rembered that a web application is different from a desktop application, because you have several users requiring authenticati on/authorisation etc at the same time - so maybe a Singleton pattern would not be appropriate for web applications.
Even if I used a Singleton pattern - is the single instance restricted to a particular users session - or does it apply server wide - i.e. accross all sessions?
Any help and insight from experienced web application designers would be much appreciated.
Hi Frank,
First of all, I would like to say that I agree with both of other MVP
friends. With custom profile, custom membership and custom authorization
providers that either you can write or find on the web, you can easily get
over these kind of problems.
If you insist about using your own stuff within your Application class with
a Singleton architecture, I would like to suggest you reading about "lock"
feature in C#.
All the best,
Coskun SUNALI
MVP ASP/ASP.NET http://sunali.com
"vapor" <va******@hotma il.comwrote in message
news:38******** *************** ***********@mic rosoft.com...
>I agree here. In addition, Singletons on the web are exceedingly difficult to create especially across a server farm - throw in web gardens and it becomes an expensive approach.
--
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:eP******** ******@TK2MSFTN GP05.phx.gbl...
>Why don't you just use existing asp.net classes found in the System.Web.Sec urity namespace?
If you want to wrap them into your code, you can make a set of classes that we handle all these aspects based on the existing classes, like securityManage r, userManager etc, and all your pages will use these classes.
If you want to share these classes between several applications, make them in a separate project as a class library and include it to different applications .
-- Eliyahu Goldin, Software Developer Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Frank Moyles" <fg******@nospa m.comwrote in message news:L6******* **************@ bt.com...
>>>I am a developer with many years (approx 10years) development experience using C++ for DESKTOP applications. I am writing a web application using C#, and I wanted to ask a question about appropriate design.
My design is as follows:
I have an Application class, which delegates to various classes to perform required functionality. The application class is responsible for the following:
Authenticatio n Authorizati on UserManagemen t SystemAdmin
etc.
Because of the nature of the work that the Application class does, there should not be more than one instance of it at any given time - since both instances for example, may try to modify/save the same object to database.
I was therefore thinking of implementing the Application class as a Singleton. But then I rembered that a web application is different from a desktop application, because you have several users requiring authenticatio n/authorisation etc at the same time - so maybe a Singleton pattern would not be appropriate for web applications.
Even if I used a Singleton pattern - is the single instance restricted to a particular users session - or does it apply server wide - i.e. accross all sessions?
Any help and insight from experienced web application designers would be much appreciated.
How does this work with the desktop application? It would seem that if
user A is running one instance of the app on box A and user B is also
running an instance on box B, concurrency issues might exist.
Not usually. With a desktop app, concurrency is only an issue if the clients
hit a common back end source.
--
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
"Registered User" <n4***@ix.netco m.comwrote in message
news:l2******** *************** *********@4ax.c om...
On Sun, 23 Dec 2007 11:27:49 +0000, Frank Moyles <fg******@nospa m.com>
wrote:
>>I am a developer with many years (approx 10years) development experience using C++ for DESKTOP applications. I am writing a web application using C#, and I wanted to ask a question about appropriate design.
My design is as follows:
I have an Application class, which delegates to various classes to perform required functionality. The application class is responsible for the following:
Authenticatio n Authorizati on UserManagemen t SystemAdmin
etc.
Are these things your Application class does or things the web
application will have to do to support the Application class?
>> Because of the nature of the work that the Application class does, there should not be more than one instance of it at any given time - since both instances for example, may try to modify/save the same object to database.
I was therefore thinking of implementing the Application class as a Singleton. But then I rembered that a web application is different from a desktop application, because you have several users requiring authenticatio n/authorisation etc at the same time - so maybe a Singleton pattern would not be appropriate for web applications.
How does this work with the desktop application? It would seem that if
user A is running one instance of the app on box A and user B is also
running an instance on box B, concurrency issues might exist. With a
web application is both instances will run on box C. The
functionality's container isn't radically different in this respect.
>>Even if I used a Singleton pattern - is the single instance restricted to a particular users session - or does it apply server wide - i.e. accross all sessions?
Any help and insight from experienced web application designers would be much appreciated.
Re-examine the desired core functionality and determine how/if it can
be used by multiple users at once. Any possible concurrency should be
handled within the application and not be limiting the application to
a single instance.
regards
A.G.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: MG |
last post by:
A Newbie question perhaps, but here goes:
Is it possible to seaprate the presentatieon layer, i.e., the html, from the
application itself.
For example, our developer has told us that we cannot do immeidate changes
to user interface becasue the presentaion layer is bound up with the rest of
the dll and to eextract that out of the app, would take ages. and so any
changes would be incorproated into the next buiild compilation.
|
by: Davey |
last post by:
I am planning on developing an application which will involve skills that I
have very little experience of - therefore I would appreciate comments on my
initial design thoughts.
Overview on system:
I'm not going to divulge the exact aims of the application but the purpose
of it is to allow multiple client applications to retrieve data from a
database (on a db server) and feed this data into another Windows
|
by: Adam Clauss |
last post by:
This may be more of a Visual Studio question than a C# question, but it came
up within the context of a C# app, so here it is.
In a Windows Form or a Web Form application, you can drag various
DataAdapters and create DataSets bound to them so everything is strongly
typed - a very nice feature.
Why in the world can this not be done the same way for ANY type of
application (say, Console, or Class Library). What do these features have...
|
by: orekin |
last post by:
Hi There
I have been trying to come to grips with Application.Run(),
Application.Exit() and the Message Pump and I would really appreciate
some feedback on the following questions .. There are quite a few
words in this post but the questions are actually quite similar and
should be fairly quick to answer ...
(1) What is Happening with the Threads
|
by: Saso Zagoranski |
last post by:
hi,
this is not actually a C# problem but since this is the only newsgroup I
follow I decided
to post my question here (please tell me where to post this next time if you
think this post shouldn't be here).
I have two design questions:
1. what is the correct (or best) way to include database queries into the
code if you plan on
| |
by: aparnasinha26 |
last post by:
Hi All,
I have to develop an application .The application has to update
database.It does not have any user interface.It needs to run on Windows
XP/2000 automatically at a particular time say 4 p.m. daily.
I have to develop the application in VB.net
My first question is which Visual Basic.Net Project type do I use-
Windows Service Or Class Library?
Second Question is What are the necessary initial steps I have to take
during development?...
|
by: Matthew Hood |
last post by:
My company has expressed a desire to convert an existing MS Access
application to a full VB.NET application. My experience is with VB6 so I
want to ask a few questions and get some input on the best way to handle the
following design:
Situation: We want to allow our customers to install with one of the
following options:
1. Use an Access MDB file as the data backend.
2. Use a SQL Server backend. (Either MS SQL, or MySQL)
3. Use an...
|
by: Paciente8159 AKA Klayman |
last post by:
Hi,
I have a couple of doubts reggarding a plugin based application in C++?
I want to build a c++ plugin based app. I have searched alot of things
in the net but I still don't know how to start this.
For example:
I want the plugin to be able to expose functions and HANDLES (for
synchronization with WaitForSingleObject for example).
|
by: goraya |
last post by:
This is design level discussion about web applications. How I design
application that support 1 million concurrent requests??
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |