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 ...
随机推荐
- SQL Server 2008数据库同步配置
以下内容转载于网络,个人做了简单的修改. 数据库同步可以是同一个服务器之间不同数据库之间数据同步,也可以是局域网内不同服务器间数据库的同步. 下面具体说一下步骤,首先我们说一下发布服 ...
- Git 一些错误的解决方法
Git初学者的个人经验记录,仅供参考 1. Pull is not possible because you have unmerged files. 症状:pull的时候 $ git pull Pu ...
- AMQ学习笔记 - 15. 实践方案:基于ActiveMQ的统一日志服务
概述 以ActiveMQ + Log4j + Spring的技术组合,实现基于消息队列的统一日志服务. 参考:Spring+Log4j+ActiveMQ实现远程记录日志——实战+分析 与参考文章的比较 ...
- 反射-Reflect
1.得到一份Class(同一个类在JVM中只有一份字节码) 三种方式:类名.class, Class.forName("全限定名");, 对象.getClass(); 基本类型 i ...
- java基础-注解Annotation原理和用法
在很多java代码中都可以看到诸如@Override.@Deprecated.@SuppressWarnings这样的字符,这些就是注解Annotation.注解最早在jdk5中被引入,现在已经成为j ...
- Centos文本方式安装情况下lvm分区的创建
作者:马 岩(Furzoom) (http://www.cnblogs.com/furzoom/)版权声明:本文的版权归作者与博客园共同所有.转载时请在明显地方注明本文的详细链接,未经作者同意请不要删 ...
- jQuery增加删除修改tab导航特效
HTML: <div class="container iden_top"> <ul> ...
- iframe整理学习笔记
朋友问了一个比较怪的问题,iframe下自适应的问题,因为很少使用iframe的原因,怀着对iframe的疑惑采用了一点点实践;以下frame表示针对的iframe元素 解决的方法:对iframe进行 ...
- Window 8.1 计时器功能及图片切换
<Canvas Margin="450,0" Width="795" Grid.Column="1"> <Image Ma ...
- thymeleaf 局部变量、属性优先级、注释
九.局部变量(local variable) 之前在th:each中遇到过局部变量 <tr th:each="prod : ${prods}"> ... </tr ...