Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
08/27 OOP 設計
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
crazylion
August 27, 2015
Technology
0
230
08/27 OOP 設計
講師: 遠遠
crazylion
August 27, 2015
Tweet
Share
More Decks by crazylion
See All by crazylion
IDF 使用者心理課程
crazylion
1
130
InTouch: Crossing Social Interaction with Perception
crazylion
0
290
The Twins: Lighting Design Based on Rich Movements
crazylion
0
150
HexDeck: Gamification of Tangibles for Brainstoming
crazylion
0
720
Interaction Design Paradigms
crazylion
0
210
Paradigm Construction & Manifestos in interaction design
crazylion
0
280
批判設計初探
crazylion
0
270
Generative Algorithms 第四章 - Transformation
crazylion
0
230
Generative Algorithms V2 第二章
crazylion
2
300
Other Decks in Technology
See All in Technology
持続可能な開発のためのミニマリズム
sansantech
PRO
4
600
Azure SQL Databaseでベクター検索を活用しよう
nakasho
0
120
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
SMTP完全に理解した ✉️
yamatai1212
0
110
20260129_CB_Kansai
takuyay0ne
0
160
AI時代、1年目エンジニアの悩み
jin4
1
120
Agentic Coding 実践ワークショップ
watany
41
28k
全員が「作り手」になる。職能の壁を溶かすプロトタイプ開発。
hokuo
1
620
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
66k
ゼロから始めたFindy初のモバイルアプリ開発
grandbig
2
450
[Iceberg Meetup #4] ゼロからはじめる: Apache Icebergとはなにか? / Apache Iceberg for Beginners
databricksjapan
0
530
書籍執筆での生成AIの活用
sat
PRO
1
230
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1371
200k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Speed Design
sergeychernyshev
33
1.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
Between Models and Reality
mayunak
1
170
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
160
A better future with KSS
kneath
240
18k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
370
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
49
Transcript
OOP 物件導向程式設計
OOP ⬜ 講到OOP (Object-Oriented Programming) 物件 導向程式設計 ⬜ 我們想到 …
⬜ Smalltalk,Java,C#,C++(支援) … 物件導向程式 語言(OOPL:Object-Oriented Programming Language)
OOP > OOPL ⬜ 物件導向程式語言是基於OO概念設計的語言 ⬜ 物件導向程式語言不是物件導向程式設計的全部 ⬜ 物件導向程式語言協助易於實現物件導向程式設 計
⬜ 用OOPL寫出不OO的程式 – 程序導向 ⬜ 用非OOPL寫出具OO概念的程式 ◼ (Google:javascript oop)
程序導向 & 物件導向 ⬜ 程序導向 ◼ 功能目的 ◼ 動作 ◼
程序 ◼ 工作流思考模式 (一連串函式呼叫,一連串電腦指令) ▫ UML Sequence diagram ▫ http://www.smileytech. net/school/CS471_Project_WebSite_files/OverallSequence.gif ⬜ 物件導向 ◼ 物件導向就是要基於物件阿 ~ ▫ 專注於將系統裡的各部分抽象為物件,系統為一群物件的交互作用 而運作。 ▫ 個別物件擁有各自的屬性(資料)與方法(動作行為)。 ▫ 某種角度上物件導向概念更貼近現實環境。
OOP 物件導向程式設計 物件導向是一種概念,思維,設計方式。
歷史 ⬜ 1960年代 Kristen Nygaard & Ole-Johan Dahl 物件導向之父 ⬜
An Object is anything to which a concept applies. It is an instance of a concept. ⬜ 宏觀:電視、手機、汽車 … ⬜ 微觀:螢幕、按鍵、輪胎、零組件 … ⬜ 抽象概念:會議、訂購行為 …
源起 ⬜ 程序導向程式設計面臨靈活性,重用性,擴充性 與維護等難題。 ⬜ 物件導向程式設計:將系統各部分視為獨立個體 相互協作。 ◼ 積木 ⬜
類比於現實生活的映射,更容易理解。便於分析、 設計與管理。-- 譬喻法
基本理論 ⬜ 類別 (Class) ◼ 類別(class)是藍圖,規格書,模板。定義該物的屬性(資 料)與方法(動作行為)。 ⬜ 物件 (Object)
◼ 物件(object)是類別的一個實例。 物件 → 類別 (抽象化) 類別 → 物件 (實例化)
基本理論 1 ⬜ 封裝 (Encapsulation) ◼ 資料隱藏 ◼ 降低能見度 →
減低依賴性 (低耦合) ⬜ 繼承 (Inheritance) ◼ Reuse 程式碼重用 ◼ 多重繼承 ⬜ 多型 (Polymorphism) ◼ 同名異式 ◼ 相同名稱的方法可以有不同的程式碼。 ◼ 覆寫 Override
基本理論 2 ⬜ 介面 (Interface) ◼ 描述不同類別的共通行為。 ◼ 規範、規格(開發角度)
進階理論 ⬜ 抽象方法 ⬜ Design Pattern
學習OOP ⬜ 初步可選定一物件導向程式語言學起 ⬜ 建立概念 ⬜ 練習系統分析抽象化 ⬜ 日常生活觀察映射 –
譬喻法
參考資料 ⬜ 不受侷限,多點想像。 ⬜ http://blog.roodo. com/rocksaying/archives/4963259.html ⬜ http://www.kenming.idv. tw/ac_eb_af_cu_af_eo_eu_ascci_a_c_carpad_a