ASP. NET design pattern-Reading Notes

Source: Internet
Author: User

Chapter 1 successful applicationProgram.

The goal of Kiss isCodeKeep it concise to avoid any unnecessary complexity.

Don't ask (tell, don't ask) Principles

 

Chapter 1 Analysis Mode

The gof Design Pattern belongs to one of the following groups:Creation, structure, and Behavior. The creation design mode processes the responsibility of the constructed object. The structure design mode focuses on making the object work together to generate new functions, while the behavior design mode focuses onAlgorithmAnd Communication.

 

Chapter 4 business logic layer: Organization

Field-driven designValue Object

Value objects do not exist independently. They are usually (But not alwaysObject Attributes.

 

The following is a simple blog system sample Using ORM. It uses Castle. activerecord to encapsulate nhib.pdf, which is quite convenient to use and suitable for business scenarios that are not complex.

Activerecord

 

The following is a domain model sample.
Asppatterns. chap4.domainmodel. model here only focus on the business
Persistence is implemented by asppatterns. chap4.domainmodel. repository.
Asppatterns. chap4.domainmodel. appservice isolates the connection between the app and the domain model and coordinates the application.

Domainmodel

 

Chapter 4 business logic layer: Model

Specification (specification) mode is used to encapsulate the business logic in the Boolean algorithm outside the business entity.

Composite (combination) mode can treat a group of objects as an object instance.

In composite mode, objects can be dynamically combined into a tree or hierarchical set for use. The key here is that there is a behavior chain between them.

In the following example, the specification (specification) mode and composite (combination) mode are coincidental.LinkTogether:

Sample

 

LSP specifies that child classes must have the same behavior as their base classes.

Child types must be replaced with their base types, which means that the child type behavior must meet the expected behavior of the base type.

 

Summary of this chapter:

 

Chapter 2 data access layer

The unit of work mode can be used to process multiple repository, because some transactions will span multiple repository.

 

Chapter 4 Presentation Layer

There are many available open-source IOC containers, such as castle Windsor, spring. net, ninject, picocontainer. net, and Microsoft unity, as well as Jeremy D. Miller's structuremap.

 

The ing from a domain object to a viewmodel is a tedious task of monotonically ing objects to an object. automapper Can Help You With https://github.com/AutoMapper/AutoMapper.

 

Castle monorail is an open-source Web application framework built on the ASP. NET platform and built on the ruby rails framework.

Nvelocity is a template engine written in C # language for. Net platforms.

 

Summary

 

The book is basically read and will not be updated.

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.