此系列更新《Python Real World Data Science》的閱讀摘記,每周六更新。
全書介紹Python在數據科學領域中的應用,分為四模塊:
- Python 基礎
- 數據分析
- 數據挖掘
- 機器學習
本文為系列第二篇,介紹python基礎。
Module 1 Python Fundamentals
Chapter 2 Object-oriented Design
Object
是Data
和Behavior
的集合
面向對象是復雜系統建模的一種方式,軟件開發時遵循的某種風格。
OOA 或者 OOE(Object-Oriented Analysis/Exploration)
- 分析問題,找出
Object
和它們之間的關系Interaction
- What needs to be done
- 系統需要滿足的一系列要求
OOD (Object-Oriented Design)
- 實現細節,對象命名,行為(類,接口)
- how things should be done
OOP(Object-Oriented Programming)
- 寫代碼
上述三個過程可能會互相混淆——迭代式開發
UML(Unified Modeling Language)
- 溝通
- 記錄設計決定
- Attributes
- Behaviors
example of uml
Interface
- 隱藏細節(抽象)
- 封裝接口:其它對象與之互動的唯一途徑
- try placing yourself in the object's shoes
Composition & Inheritance
- 層次化的抽象