Duwamish 7 Preliminary - Data Process

zhaozj2021-02-11  182

DUWAMISH 7 is a Microsoft's distributed application example based on ASP.NET.

I have to study one or two due to work. I have a personal experience, I don't dare to share it, so I share it with the public. One and discuss ASP.NET, Wan Wang people will be enlightened,.

BTW has a structure and process in MSDN.NET, and I summarize my experience on this basis, and do a supplement on it. If you have any questions, you can check it.

Duwamish's core file:

SystemFramework / ApplicationAnssert.cs // Verify Data Legality SystemFramework / ApplicationConfiguration.cs // Defines the Framework of the Read and Write Configuration CommON / DUWAMISHCONFIGURATION.CS // Read and write configuration (via ApplicationConfiguration)

The above is the core of the entire application, and there is an ApplicationLog.cs, the role and configuration.

Web / Web.config // Application Profile Web / PageBase.cs // Web Forms page Base class for ASPX derived, which define data shared between the page (such as user, order information, definition with attribute) Web /ModuleBase.cs // Web control base class for module / *. ASCX derived, defined all of the application paths required for all modules and other shared information (definition with attributes) Duwamish 7 is a small application (relative to More business applications), but Microsoft still defines its structure, framework, and hierarchy, making it sincere advice: P

Is it complicated? It is not difficult to master.

User Interface - Web Business Appearance --BusinessFacade Business Rules - BusinessRules Data Access - DataAccess

This is, a strict, clear and easy-to-maintain web application. We use a user login process as an example to explore its data flow.

Web / Secure / Logon.aspx accepts user login form submission, triggered the logon.logonbutton_click event (204 lines in web / secure / logon.aspx.cs)

WEB / Secure / Logon.aspx.cs 243 lines:

CustData = (New Customersystem ()). getcustomerbyemail (LogoneMailTextBox.text, LogonpasswordTextBox.text);

BusinessFacade (Business / Facade / Customersystem.cs) implements "User Account Access Interface" logic

Where businessfacade.getcustomerbyemail () (45 lines in Business / Facade / Customersystem.cs) Defines the "Read User Information by Email" interface

Business / Facade / Customersystem.cs 58 lines:

Using (DataAccess.customers CustomersDataAccess] () {DataSet = CustomersDataAccess.loadCustomerbyemail (emaildress);}

DataAccess (DataAccess / Customers.cs) implements "User Account Data Access" logic

Where Customers.LoadCustomerbyemail () (217 lines in DataAccess / Customers.cs) Defines the "Read User Information" interface via the Email "" GetCustomerbyemail "DataAccess / Customerbyemail" DataAccess / CustomerByemail "DataAccess / CustomerByemail" Data Access / Customers.cs

DScommand.selectCommand = getloadCommand ();

DataAccess.customers.getLoadCommand () Initialize the storage procedure and parameters and returns its interface (112 lines in DataAccess / Customers.cs)

119 lines in DataAccess / Customers.cs:

LoadCommand = New SqlCommand ("getCustomerbyemail", New SqlConnection (DuwamishConfiguration.connections);

Initialize the storage process. Its database connection is obtained by the CONNECTIONSTRING attribute in Common.duwamishConfiguration.

CommON DuwamishConfiguration.cs Defines the access interface of the application configuration information (by the properties of the Access class)

Where duwamishConfiguration.Connetionstring property provides "Database Connection String Access" interface

151 lines in Common / DuwamishConfiguration.cs:

Public static string connectionstring {get {return;}}

107 lines in CommON / DuwamiSHConfiguration.cs "Database Connection String" by default value:

Dbconnectionstring = dataaccess_connectionstring_default;

The 107 lines in CommON / DuwamiSHConfiguration.cs are set by the "Database Connection String" in the "Application Profile":

Dbconnectionstring = ApplicationConfiguration.readsetting (Settings, DataAccess_Connectionstring, DataAccess_connectionstring_default);

The ApplicaitionConfiguration class in SystemFramework defines the configuration read and write interface (SystemFramework / ApplicationConfiguration.cs)

Where ApplicationConfiguration.Readsetting defines the "Read Configuration" interface

190 lines in SystemFramework / ApplicationConfiguration.cs:

public static String ReadSetting (NameValueCollection settings, String key, String defaultValue) {try {Object setting = settings [key]; return (setting == null) defaultValue:? (String) setting;} catch {return defaultValue;}}

转载请注明原文地址:https://www.9cbs.com/read-5626.html

New Post(0)