SOLID architecture principles using simple C# examples
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的更多相关文章
- Architecture Principles
Architecture Principles - Completed Components Name Statement Rationale Implications TOGAF Principle ...
- 让姑姑不再划拳 码农也要有原则 : SOLID via C#
“姑娘,别这样.我们是有原则的.” “一个有原则的程序猿是不会写出 “摧毁地球” 这样的程序的,他们会写一个函数叫 “摧毁行星”而把地球当一个参数传进去.” “对,是时候和那些只会滚键盘的麻瓜不同了, ...
- 一年开发ASP.NET MVC4项目经验总结
一年开发ASP.NET MVC4项目所用所学技术经验总结 阅读目录 文章背景 前端所用技术摘要 后端所用技术摘要 1. 文章背景 本人2014年从Java转行到C#从事BS项目的开发,刚开始接触的是A ...
- C# 之设计原则
代码也需要有秩序,就像世界需要秩序,基于SOLID architecture principles. 一.SOLID原则 S.O.L.I.D.是一组面对面向对象设计的最佳实践的设计原则.术语来自Rob ...
- 设计模式之设计原则 C#
成为一名资深架构师首先要懂设计模式,在懂之前,要清楚设计原则,原来我就吃过这个亏,很久以前有人问我设计原则,我是一头茫然,不是只有设计模式吗?且不知设计原则就像是写书法一样,楷体就是方正,竖道有垂露等 ...
- Service Oriented Architecture and WCF 【转】
http://www.codeproject.com/Articles/515253/Service-Oriented-Architecture-and-WCF Introduction This a ...
- 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 ...
- Architecture Patterns
This chapter provides guidelines for using architecture patterns. Introduction Patterns for system a ...
- PHP的SOLID设计原则
SOLID Design Principles, 这是一个比设计模式更高级别的概念, 以构建良好代码为目标,真正掌握了就是大师级别了. 我~~~仅知晓~ /*SOLID Design Principl ...
随机推荐
- Part 97 Performance of a multithreaded program
class Program { static void Main(string[] args) { Stopwatch s = new Stopwatch(); s.Start(); EvenNumb ...
- asp.net运算符之逻辑运算符以及其他运算符
逻辑(布尔型)运算符用于对boolean型的结果的表达式进行运算,运算的结果都是boolean型.其运算结果如下所示: 运算符 运算 例子 结果 & AND(与) false&true ...
- Cocos2d-JS加速度计与加速度事件
在很多移动设备的游戏使用到了加速度计,Cocos2d-JS引擎提供了访问加速度计传感器的能力.本节我们首先介绍一下加速度计传感器,然后再介绍如何在Cocos2d-JS中访问加速度计.加速度计加速度计是 ...
- Jquery 学习二
一.事件编程 1.基本事件(以方法形式存在的) 基本语法: 原生Javascript代码中的事件绑定方式: DOM对象.事件 = 事件的处理程序 jQuery代码中的事件绑定方式: jQuery对 ...
- Linux I/O模型
同步阻塞I/O 在此种方式下,用户进程在发起一个I/O操作以后,必须等待I/O操作的完成,只有当真正完成了I/O操作以后,用户进程才能运行.Java传统的I/O模型属于此种方式. 同步非阻塞I/O 在 ...
- Makefile 基本知识
Technorati 标签: Makefile 基本知识 最常见的书写方式: CC = gcc LD = ld STRIP = strip CFLAGS := -Os -static -DEZ_O ...
- 一步一步学习C++
根据<C++ primer>第五版 总结学习心得. 在实践中,不必全面地使用C++语言的各种特性,而应根据工程的实际情况,适当取舍(譬如动态类型信息,虚拟继承.异常等特性的使用,很值得商榷 ...
- Uncaught SyntaxError: Unexpected token ILLEGAL【js错误】
应该是逗号的中英文状态错了,应该是英文状态的逗号.还有百度应用后面的逗号.college后面的冒号
- virtualbox安装centos6.5碰到的问题
今天无聊用virtualbox安装centos6.5 , 自己笔记本vm撑不住, 用公司的试试virtualbox先 安装快完成时 没有足够的内存配置kdump”(在英文界面下提示的是“insuffi ...
- 使用FormData上传文件、图片
关于FormData XMLHttpRequest Level 2添加了一个新的接口 ---- FormData 利用FormData对象,可以通过js用一些键值对来模拟一系列表单控件,可以使用XM ...