Skip to content
Ider

沉淀我所学习,累积我所见闻,分享我所体验

Primary Navigation Menu
Menu
  • Home
  • About Ider
    • Who Ider?
    • Why Ider?
    • How Ider?
    • Where Ider?
    • What Ider?

Object-Oriented

2016-12-31
31 December
On December 31, 2016
In Design Patterns(设计模式), Reading Notes(阅而后知), Software Engineering(软件工程)

面向对象开发原则:S.O.L.I.D.

solid-oop_wall-skills

一开始学编程的时候,都是在学习程序语言,觉得学好了这门语言就可以写好程序;渐渐地发现算法和数据结构更加的重要,因为语言只是细胞,要依附这些行程肉体才能产生作用;但到了实际生产应用的时候,又会察觉整个好像缺少灵魂,常常只能像僵尸般往一个方向前进,缺少驱动力来动态调整,这力量就来自各种设计模式和开发原则。

经历了越多开发中的痛楚,也越来越发觉“S.O.L.I.D.”开发原则只用几句话所概括出来的真谛和内涵。它们对于软件开发是如此有意义,当然具体的实现依然还是依赖于那些基于需求形成的数据结构和算法,只是利用这些开发原则作为灵魂,让程序走得更远更自由。

 

Single Responsibility Principle(SRP)

A class should have one, and only one, reason to change.

Open Closed Principle(OCP)

You should be able to extend a classes behavior, without modifying it.

Liskov Substitution Principle(LSP)

Derived classes must be substitutable for their base classes.

Interface Segregation Principle(ISP)

Make fine grained interfaces that are client specific.

Dependency Inversion Principle(DIP)

Depend on abstractions, not on concretions.

 

References:
  1. ArticleS.UncleBob.PrinciplesOfOod
  2. SOLID (object-oriented design) – Wikipedia
  3. S is for the Single Responsibility Principle
  4. O is for the Open/Closed Principle
  5. L is for the Liskov Substitution Principle
  6. I is for the Interface Segregation Principle
  7. D is for the Dependency Inversion Principle

(后5个是基于Android开发对这些原则做的阐述)

Facebook
Twitter
LinkedIn
RSS
ZhiHu

Recent Posts

  • 三年居家工作感受
  • Pixel Watch智能手表和Pixel 5, 6 Pro 及 7 Pro手机
  • 我拥有过的无线耳机
  • 毕业工作一个月,我差点被开除
  • 我拥有过的移动硬盘
  • ProtoBuf 2.0 method count optimization for android development
  • 面过100场行为面试后

Categories

  • Algorithm Analysis(算法分析)
  • Article Collection(聚宝收藏)
  • Data Structures(数据结构)
  • Design Patterns(设计模式)
  • English Posts(英文写作)
  • Front Interface(界面构想)
  • IT Products(数码产品)
  • Knowledge Base(心得笔库)
  • Language Tips(语言初试)
  • Mathematical Theory(数学理论)
  • Mobile Development(移动开发)
  • Programming Life(程序人生)
  • Reading Notes(阅而后知)
  • Software Engineering(软件工程)
  • Special Tricks(奇技妙招)
  • Tangential Speech(漫话杂谈)

Tags

Aero Android API Bash Binary Search Bitwise Operation Book C/C++ Career Chrome Conference CSS Debug Device DOM Extension Framework Game Gradle Hearthstone HTML Initialization Intellij Interview iOS Java JavaScript jQuery Keyword Language Issues Mac Microsoft Mobile Modifier Objective-C PHP Principle Reference Regular Expression Static String Tools Tutorial UI XML

Blogroll

  • Ahmed's Blog
  • Gert Lombard's Blog
  • Gordon Luk
  • Jack & Allison
  • 开发部落

Archives

Designed using Chromatic. Powered by WordPress.