Applying the Singleton Design Pattern in .NET Remoting
page 2 of 5
by Joseph Chahine
Feedback
Average Rating: 
Views (Total / Last 10 Days): 22541/ 30

Sample Scenario

For the purpose of clarity, let us take a sample scenario and consider that you are designing a distributed application as depicted in the picture below.  You have a Web Server hosting the Presentation Tier of your solution, an Application Server hosting the Business Tier of your solution, and a Back Office Server hosting your solution database.

Figure 1


To do so, you will be creating a .NET solution with at least 2 projects: an ASP.NET Web Application project and a Class Library project.  A website is created on the Web Server to host the Web Application files.  Another website is created on the Application Server to host the Class Library assemblies supposing here that your remote server is IIS.

On the Web Server you are probably going to use the Application State to store public information, for example, all DataTables that you might use to bind the drop-down lists available in your web pages (Countries, Departments, Titles, Currencies, etc.).

Let us call Combos the class responsible for retrieving the information from the database and fill the corresponding DataTable objects stored into the Remote Object.  The Remote Class has many children classes, Combos being one of them.  We call Remote Object an instance of the Remote Class.

Until now, everything does fine.  However, what if you called a method in your Business Tier and passed to it the DepartmentId as an argument and the method is supposed to compose en email for the department manager?  Where do you get the DepartmentManagerName and the DeparmentManagerEmail fields from?

·         The method into the remote object cannot read the DataTables in the Application State of the Web Server.

·         You cannot pass all that you need as arguments because the list of arguments can grow depending on what you are doing.

·         You would not like to open a connection to the database on each method call passing the DepartmentId as parameter.


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 6:57:23 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search