Duwamish Deployment Solution

Source: Internet
Author: User
Duwamish Deployment Solution

Duwamish 7.0 supports two multi-computer deployment solutions. The non-distributed deployment scheme deploys the Web layer, business appearance, business rules, and data access layer on a Web host. However, the Web host can be copied between clusters to achieve load balancing. The Distributed Solution deploys specific components on individual servers. For example, the business appearance, business rules, and data access layer may be located on servers independent from Web hosts. In actual deployment, the database server is usually located on a separate computer.

1,Non-distributed deployment scheme

Deploy the Web layer, business appearance, business rules, and data access layer on a Web host, and then implement the network field (Web Farm) through software (such as Application Center 2000) or hardware) load Balancing for each Web Server in.

Duwamish 7.0 is installed on the local machine by default. It adopts a non-distributed deployment solution.

2,Distributed Deployment Scheme

Use the. NET Framework remote processing technology to distribute applications to multiple computers. Simply put, IIS Web Server and Application Server are separated. The Web layer (including the SystemFramework and Common projects) is deployed on the IIS Web, businessFacde/BusinessRules/DataAccess layer (including the SystemFramework and Common project) are deployed on the Application Server together.


Duwamish 7.0 uses the HTTP/binary instead of HTTP/SOAP. The decision to use HTTP is based on the requirements of the firewall on port 80. The use of binary instead of SOAP is based on performance considerations. For large data blocks, binary performance is superior to SOAP. Therefore, if you want to pass large data blocks (such as arrays, datasets, or data tables), use a binary formatting program. If you want to transmit small data blocks, it is irrelevant to use SOAP or binary formatting. When an integer is passed, both of them have good performance.

3,How to SetDu wamish 7.0Deployment is based on. Net RemotingDistributed System

The Deploytool provided by Microsoft is used automatically as follows (manual and convenient ):

C: \ Program Files \ Microsoft Visual Studio. NET 2003 \ Enterprise Samples \ Duwamish 7.0 CS> deploytool deploy RemoteMachine = localhost path = "C: \ Program Files \ Microsoft Visual Studio. NET 2003 \ Enterprise Samples \ Duwamish 7.0 CS \ duwamis1__remote"

Enter the preceding command line code in the command line window.

[10/29/2004 6:43:43 AM] Creating directory C: \ Program Files \ Microsoft Visual Studio. NET 2003 \ Enterprise Samples \ Duwamish 7.0 CS \ Duwamish7_Remote on W1MIS38

[10/29/2004 6:43:43 AM] Stopping all internet services on W1MIS38

[10/29/2004 6:43:59 AM] Deploying Duwamish7 Business Facade on W1MIS38

[10/29/2004 6:43:59 AM] Creating web site on W1MIS38

[10/29/2004 6:44:00 AM] Generating remoting configuration files

[10/29/2004 6:44:00 AM] Starting all internet services on W1MIS38

[10/29/2004 6:44:02 AM] Starting Default Web Site on W1MIS38

[10/29/2004 6:44:02 AM] Deployment successful

Running result:

(1) create a Web Application (Duwamish7_Facade) in IIS. The local path is: C: \ Program Files \ Microsoft Visual Studio. NET 2003 \ Enterprise Samples \ Duwamish 7.0 CS \ Duwamish7_Remote \ web serves as the Remote Server, and the Bin directory is the DLL file of BusinessFacde/BusinessRules/DataAccess layer (including SystemFramework and Common project.

The web. config file contains all Remote Objects configurations, as shown in figure

<Wellknown mode = "Singleton" type = "Duwamish7.BusinessFacade. ProductSystem, Duwamish7.BusinessFacade" objectUri = "ProductSystem. rem"/>

(2) The Web layer creates the remotingclient. cfg configuration file. For the Application Server, the Web layer is equivalent to the Client.

The remotingclient. cfg configuration file contains the formatter setting (binary). Select the binary formatter to serialize the message. Note that this is due to performance considerations.

(3) Web application load the remotingclient. cfg configuration file

The Web application includes the following code in the global. asax file: load the Retmoting configuration file in the Application_OnStart event.

Void Application_OnStart ()


ApplicationConfiguration. OnApplicationStart (Context. Server. MapPath (Context. Request. ApplicationPath ));

String configPath = Path. Combine (Context. Server. MapPath (Context. Request. ApplicationPath), "remotingclient. cfg ");

If (File. Exists (configPath ))

RemotingConfiguration. Configure (configPath );


The previous Code ApplicationConfiguration. OnApplicationStart () is to call the OnApplicationStart () method of Duwamish7.SystemFramework. ApplicaitonConfiguration to initialize application root and read the configuration information in web. config (DuwamishCode Analysis).

Add Comment
| Fixed Link | Reference announcement (0) | Record it | Duwamish
Fixed Link Close
Http://spaces.msn.com/csharpnet/blog/cns! 3137B1B94B82075B! 250. entry

Duwamish Architecture Analysis

Duwamish is an enterprise-level Distributed System architecture provided by Microsoft. If an enterprise-level distributed system is developed, it can be imitated. If it is to develop some simple systems, it can be completely simplified.


I have also learned the Duwamish example before, but I have found different experiences and experiences at different times. As Lu Yan said:Through researchDuwamishExample:. NetThe design concept of the application architecture can be learned by the low-handed. NetProgramming skills, is really suitable for all ages.


Therefore, here we will learn and experience the Duwamish example again.


1,Du wamish 7.0The structure is divided into four logical layers (FROM MSDN):

Web layer-Presentation

The Web layer provides clients with access to applications. This layer is implemented as a Web project in the Duwamish. sln solution file. The Web layer consists of ASP. NET Web forms and hidden code files. Web forms only use HTML to provide user operations, while code hidden files implement event processing for various controls.

Business appearance layer-Business Facade

The business appearance layer provides an interface for the Web layer to process accounts, category browsing, and book purchases. This layer is implemented as the BusinessFacade project in the Duwamish. sln solution file. The business appearance layer is used as the isolation layer, which isolates the user interface from the implementation of various business functions. Except for low-level systems and support functions, all calls to the database server are performed through this assembly.

Business Rule layer-Business Rules

The business rule layer is implemented as the BusinessRules project in the Duwamish. sln solution file. It contains the implementation of various business rules and logic. Business Rules complete tasks such as verifying customer accounts and book orders.

Data Access layer-Data Access

The data access layer provides data services for the business rule layer. This layer is implemented as the DataAccess project in the Duwamish. sln solution file.


In addition to the above four logic layers, Duwamish 7.0 also contains shared functions encapsulated in the Common project in the Duwamish. sln solution file. The Common layer contains datasets used to transmit information between layers. The Common project also contains the application configuration and tracing classes in the SystemFramework project in the Duwamish. sln solution file.


2. Relationship graph (from msdn) between each logical layer and its call to SequeanceFigure example:

The following is the entire call process for obtaining the Description of Category on the Categories. aspx web page.

(1) instantiate the ProductSystem object

(2) Call the GetCategories () method of ProductSystem

(3) Check the validity of parameters

(4) create a Categories: DataAccess object instance

(5) return the above object

(6) Call the Categories: GetCategories () method of the DataAccess object

(7) create a CategoryData: Common object instance

(8) return the above object

(9) return CategoryData: Common object instance, which contains the required data

(10) return CategoryData: Common object instance to web/Client

(11) Check Data Validity

(12) read and display the result: Description of Category

The SystemFramework project contains configuration parameters required by applications, ApplicationLog log classes, and ApplicationAssert parameter verification classes. The SystemFramework project is referenced by all other projects.


The Common project contains datasets used to transmit information between layers. For example, the CategoryData mentioned above inherits System. data. dataSet is neither the so-called typed DataSet nor the general DataSet. It is simple and practical, and is based on. net Remoting: a distributed system is developed to exchange data between tier and tier. Common projects are also referenced by other projects, except for SystemFramework projects.


All the Classes in the BusinessFacade project inherit the MarshalByRefObject class, which is obviously used to deploy BusinessFacade tier as Remote Objects. However, it is not actually deployed as Remote Objects by default, and the Web layer still calls the local object (《DuwamishDeployment Solution).




When developing enterprise-level Distributed Systems Based on. Net Framework, the above architecture is worth recommending, but it is not flawless. In fact, there are some points worth improving. Obviously, it is impossible for an example to fit all the actual situations. The requirements are too harsh. In fact, the architecture of Fitch and Mather 7.0, another example of Enterprise Samples, is somewhat different from Duwamish.


If you are developing a local system, do not imitate the Duwamish architecture (you can see the process of calling the Description obtained from the Category above, which is too difficult .), For example, the Classes in Business Facade and Business Rules should adopt the fine-grained interface design, and the interaction parameters between layers do not all need to use DataSet. You can use setter/getter as appropriate, this not only improves development efficiency, but also improves performance, maintainability and reusability.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.