Duwamish7 Learning Notes 1

Source: Internet
Author: User
Tags config configuration settings constructor one table serialization
Notes

Duwamish7 Learning Notes (-)
 
The Duwamish Solution has a total of 6 projects, structured into 5 tiers: the Business Facade layer (BusinessFacade), the Business Rules layer (businessrules), the Business entity layer (Common), the data Access Layer (dataaccess), the Business Presentation layer ( WEB). Another project for the Systemframework, as implies, mainly used for the entire system architecture of some configuration, tracking, log and so on.
Common project
1. Let's take a look at the DUWAMISH7 data structure, figure 1

2. The business entity encapsulation of the four most important objects in the database is Book,category,customer,order, four classes inherit from the dataset, but the class adds two properties: [ System.ComponentModel.DesignerCategory ("Code")], [SerializableAttribute], the previous property means specifying that the current class designer belongs to a category. The latter property marks the current class as a serializable class that can be invoked remotely.

class to map the fields in the tables and tables in the database, and the related error messages are also defined in the partial class.
Public Const String Email_field_not_unique = ' EMAIL not UNIQUE ';
3. Call the Builddatatables () method in the default constructor to create the table structure and add it to the dataset. Only one table is saved in the BookData, Categorydata, customerdata classes, and the Orderdata class holds 6 table information related to the order.
The tables in the dataset have one by one pairs of physical tables in the database, some have a physical table corresponding to multiple tables in the dataset, and several physical tables correspond to a table in the dataset.
The 4.Common project also has a duwamishconfiguration class that is used to get the Duwamish configuration entry in the Web.config file and inherit from the IConfigurationSectionHandler interface. The interface defines the following contract: All configuration section handlers must be implemented before they can participate in the resolution of configuration settings. The interface has only one create () method, Duwamishconfiguration class to implement the Create () method, through Namevaluesessionhander instance basehandler.create () method to populate the NameValueCollection setting, and then call the
The Applicationconfiguration.readsetting () method returns a specified configuration information.
Questions:
1.4 Business entity classes have a constructor that supports serialization, such as the BookData class.
Private BookData (SerializationInfo info, StreamingContext context): Base (info, context) {}
It is not clear that this 4 class serialization does not have a special reference object, it should be simply a "basic serialization" that is simple to add the Serializable property before the class tag it, why also define a support serialization constructor? Is it because of the inheritance of the dataset??
2. When is the system, how to call the Duwamishconfiguration class of the Create () method to obtain the relevant configuration information in the Web.config file?

MSDN Help:
1.system.configuration namespaces
Ms-help://ms. Msdnqtr.2003feb.2052/cpref/html/frlrfsystemconfiguration.htm

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.