转:http://www.codeproject.com/Articles/703634/SOLID-architecture-principles-using-simple-Csharp?msg=4729987#xx4729987xx

http://www.codeproject.com/Articles/28309/Design-pattern-FAQ-Part-1-Training

S stands for SRP (Single responsibility principle):- A class should take care of only one responsibility.

O stands for OCP (Open closed principle):- Extension should be preferred over modification.

L stands for LSP (Liskov substitution principle):- A parent class object should be able to refer child objects seamlessly during runtime polymorphism.

I stands for ISP (Interface segregation principle):- Client should not be forced to use a interface if it does not need it.

D stands for DIP (Dependency inversion principle) :- High level modules should not depend on low level modules but should depend on abstraction.

There are three basic classifications of patterns Creational, Structural, and Behavioral patterns.

Creational Patterns

• Abstract Factory:- Creates an instance of several families of classes 
• Builder: - Separates object construction from its representation 
• Factory Method:- Creates an instance of several derived classes 
• Prototype:- A fully initialized instance to be copied or cloned 
• Singleton:- A class in which only a single instance can exist

Note: - The best way to remember Creational pattern is by remembering ABFPS (Abraham Became First President of States).
Structural Patterns

• Adapter:-Match interfaces of different classes . 
• Bridge:-Separates an object’s abstraction from its implementation. 
• Composite:-A tree structure of simple and composite objects. 
• Decorator:-Add responsibilities to objects dynamically. 
• Façade:-A single class that represents an entire subsystem.
• Flyweight:-A fine-grained instance used for efficient sharing. 
• Proxy:-An object representing another object.

• Mediator:-Defines simplified communication between classes.
• Memento:-Capture and restore an object's internal state. 
• Interpreter:- A way to include language elements in a program.
• Iterator:-Sequentially access the elements of a collection. 
• Chain of Resp: - A way of passing a request between a chain of objects.
• Command:-Encapsulate a command request as an object. 
• State:-Alter an object's behavior when its state changes. 
• Strategy:-Encapsulates an algorithm inside a class. 
• Observer: - A way of notifying change to a number of classes. 
• Template Method:-Defer the exact steps of an algorithm to a subclass. 
• Visitor:-Defines a new operation to a class without change.

SOLID architecture principles using simple C# examples的更多相关文章

  1. Architecture Principles

    Architecture Principles - Completed Components Name Statement Rationale Implications TOGAF Principle ...

  2. 让姑姑不再划拳 码农也要有原则 : SOLID via C#

    “姑娘,别这样.我们是有原则的.” “一个有原则的程序猿是不会写出 “摧毁地球” 这样的程序的,他们会写一个函数叫 “摧毁行星”而把地球当一个参数传进去.” “对,是时候和那些只会滚键盘的麻瓜不同了, ...

  3. 一年开发ASP.NET MVC4项目经验总结

    一年开发ASP.NET MVC4项目所用所学技术经验总结 阅读目录 文章背景 前端所用技术摘要 后端所用技术摘要 1. 文章背景 本人2014年从Java转行到C#从事BS项目的开发,刚开始接触的是A ...

  4. C# 之设计原则

    代码也需要有秩序,就像世界需要秩序,基于SOLID architecture principles. 一.SOLID原则 S.O.L.I.D.是一组面对面向对象设计的最佳实践的设计原则.术语来自Rob ...

  5. 设计模式之设计原则 C#

    成为一名资深架构师首先要懂设计模式,在懂之前,要清楚设计原则,原来我就吃过这个亏,很久以前有人问我设计原则,我是一头茫然,不是只有设计模式吗?且不知设计原则就像是写书法一样,楷体就是方正,竖道有垂露等 ...

  6. Service Oriented Architecture and WCF 【转】

    http://www.codeproject.com/Articles/515253/Service-Oriented-Architecture-and-WCF Introduction This a ...

  7. Optimizing subroutine calls based on architecture level of called subroutine

    A technique is provided for generating stubs. A processing circuit receives a call to a called funct ...

  8. Architecture Patterns

    This chapter provides guidelines for using architecture patterns. Introduction Patterns for system a ...

  9. PHP的SOLID设计原则

    SOLID Design Principles, 这是一个比设计模式更高级别的概念, 以构建良好代码为目标,真正掌握了就是大师级别了. 我~~~仅知晓~ /*SOLID Design Principl ...

随机推荐

  1. MySQL之连接数据库的两种方法

    方法一: package DB; import java.sql.Connection; import java.sql.DriverManager; public class Conn { // 定 ...

  2. JAVA之网页截屏

    先吐槽一下下: 表示接近两个月没有敲代码了,现在看一下代码都感觉有点生了.三天打鱼两天晒网是不行的,再说我本来就有“健忘症”,真的是木有办法啊 ̄へ ̄.我一直信奉一句话:“勤能补拙”,它也是我学习路上的 ...

  3. js 平滑定位

    <script type="text/javascript"> function intval(v){ v = parseInt(v); return isNaN(v) ...

  4. 总结一下block的几种常用方法

    一.block的简单介绍 block相当于一个参数,有参数的名,有参数的值,有参数的使用,当使用block的时候,它又相当于一个函数,会回调函数体. 声明:void (^block)(void); 实 ...

  5. Cocos2d-JS特效

    Cocos2d-JS提供了很多特效,这些特效事实上属于间隔动作,特效类cc.GridAction类,也称为网格动作,它的类图如下图所示. 网格动作类图 网格动作cc.GridAction它有两个主要的 ...

  6. Cocos2d-x文本菜单

    文本菜单是菜单项只是显示文本,文本菜单类包括了MenuItemLabel.MenuItemFont和MenuItemAtlasFont.MenuItemLabel是个抽象类,具体使用的时候是使用Men ...

  7. asp.net 小技巧

    文字用一个label标签包起来,设置一个属性:for,其for的值要和复选框的id相同. <p> 1.通过点击文字,就选中复选框</p> <p>文字用一个label ...

  8. 20140215-搭建phonegap开发环境

    1.安装jdk,配置环境变量 a)设置 JAVA_HOME =E:\SetUpFiles\win8.1\Java\jdk1.6.0_45 b)设置PATH=E:\SetUpFiles\win8.1\J ...

  9. EXT中的iconCls 图标加载

    刚刚遇到了个奇怪的问题. 我用 在主页面用TAB autoLoad:{url:link, nocache: true, scripts:true} 加载页面Student.jsp, 郁闷,FF可以正常 ...

  10. Php 与 Json

    PHP与JSON 在PHP中存在两个与JSON相关的函数: json_encode($array或$object)函数:把一个数组或对象转化为JSON格式的字符串 json_decode($json, ...