SlideShare a Scribd company logo
1 of 33
Download to read offline
動手打造 Application Framework
kevin@kuicker.org
Framework 集成
2
http://mvc.tw
 每個人心裡想的都不一樣。
 或許沒有一個真正的範圍!
What is the Application Framework?
3
我以為
你以為 他以為
http://mvc.tw
What I would like to say is..
4
 有誰了解全部內容?
 講我覺得重要的
 講白話一點
 70 內分鐘講得清楚的
 個人的想法,與大家分享
全部的內容
講述的內容
http://mvc.tw
Why do we need Application Framework?
5
 複雜的企業邏輯,不會因
此變得簡單。
 Application Framework 帶
來的是清晰,不是簡化。
簡化
清晰
http://mvc.tw
Library Framework
類別庫 集成
You call Library. Framework calls you.
Your project’s Tools. Your project’s Life.
一組包含在類別裡能被程式呼叫的方法,
每次的呼叫將完成特定工作並回傳控制。
包含抽象設計與內建行為,程式需要透
過子類別或是插入程式的方式,在執行
期特定的時點呼叫你的程式。
Library vs. Framework
6
放下既有的技術定義,先用簡單的方法了解。
Lifecycle 系統生命周期
7
http://mvc.tw
Lifecycle : Running
8
 執行中
專案程式執行在 Application Framework 建立的服務之上
http://mvc.tw
Lifecycle : Action
9
 狀態
Running
 動作
啟動 Start
停止 Stop
http://mvc.tw
Lifecycle : Circle
10
生命周期形成封閉的迴圈
http://mvc.tw
Lifecycle : Full Circle
11
完整的生命周期
http://mvc.tw
Lifecycle : State
 穩定狀態
Permanent State
 已停止 Stopped
 執行中 Running
 已暫停 Suspended
 過渡狀態
Transition State
 啟動中 Starting
 停止中 Stopping
 恢復中 Resuming
 暫停中 Suspending
12
生命周期就是,系統一連串狀態的改變與處理
http://mvc.tw
Lifecycle : Sequence
13
由封閉的迴圈,改從循序的角度了解系統狀態的變化
http://mvc.tw
Lifecycle : Start
14
 內建 Builtin
 外掛 Plugin
http://mvc.tw
Lifecycle : Stop
15
反序停止 Plugin, Builtin
Builtin & Plugin
16
http://mvc.tw
 已知的被動服務
 Framework 提供每一個內建服務介面,定義服務內容
 專案程式主動使用內建功能
 常以靜態類別與方法提供,例如:Auditor.Success(..)
 實作組件是否載入,不影響專案運作
Builtin 內建
17
http://mvc.tw
 未知的主動服務
 Framework 提供外掛統一介面,定義管控方式
 專案程式被動享受外掛服務
 另開執行緒,或執行於獨有的 AppDomain 裡
 實作組件是否載入,不影響專案運作
Plugin 外掛
18
http://mvc.tw
Builtin Plugin
已知的 未知的
被動的 主動的
介面定義服務內容 介面定義管控方式
不同介面 共同介面
以靜態類別與方法提供 執行緒或獨有的 AppDomain
例如:Audit 稽核 例如:AD 帳號同步程式
Builtin vs. Plugin
19
Kuicker
20
http://mvc.tw
Kuicker : Execution Order
 Hosting & Kernel
 讀取定義檔 Configurable
 收集組件 Assembly
 解析類別 Reflection
 附加生命周期處理 Event
 載入內建服務 Log, Audit
 載入外掛服務 Pluginable
21
http://mvc.tw
Kuicker : Hosting & Kernel
22
http://mvc.tw
 1. ConfigurationSectionHandler (deprecated)
System.Configuration.IConfigurationSectionHandler
 2. ConfigurationSection
System.Configuration.ConfigurationSection
Kuicker : Configurable
23
http://mvc.tw
 AppDomain Assemblies
 APP_CODE Assemblies
 Folder
 bin >> AppDomain Assemblies
 {special folder} >>
Kuicker : Assembly
24
http://mvc.tw
 如果外掛組件放在 bin 裡,調整 bin 的組件將會觸發系
統重啟,這是否就失去外掛的意義?
 如果外掛組件放在特定目錄裡,讀取特定目錄裡的組件會有
額外授權需求,這不利於一般化的部署。
 我們真的需要具有熱插拔的系統嗎?
Kuicker : 熱插拔的系統
25
http://mvc.tw
 制定 Builtin 服務內容與 Plugin 管控方式並定義介面
 Kernel 主動收集組件裡的實作特定介面的類別
 內建外掛執行順序採 FIFO,生命周期附加程序以核心優先
 外掛錯誤處理,以不影響主程式為原則
 類別提供 Self-Description 自我描述
Kuicker : Reflection
26
http://mvc.tw
Kuicker : Event
 核心事件
 BuiltinStart, PluginStart
 PluginStop, BuiltinStop
 非核心事件
 BeforeStart, AfterStop
 BeforeBuiltinStart,
AfterBuiltinStart
 BeforePluginStart,
AfterPluginStart
 BeforeStop, AfterStop
 實作方式
 Event Handler
 Type or Instance
Level?
 Attach / Detach or
Implemented Interface?
27
http://mvc.tw
Kuicker : Log
 Apache logging services
log4j
log4net
log4php
log4cxx
Chainsaw
 log4j Family
log4plsql
log4js
log4c
log4javascript
log4perl
28
Log 機制的發展,逐漸向 log4j 收斂 (個人認為)
http://mvc.tw
 Send Message, Error Control, Application Domain
 Proxy, Gateway, Queue, Remoting, Socket
 Priority, Sleep
 Interrupt, Dependency
 Out-of-Process / In-Process
 Worker / Job, Load / Unload
 Synchronous / Asynchronous
Kuicker : Pluginable
29
30
Kuick >> Kuicker
http://mvc.tw
好活動需要支持
感謝 KKTIX 贊助 twMVC 活動報名平台
31
http://mvc.tw
好課程需要支持
32
http://skilltree.my
謝謝各位
• 本投影片所包含的商標與文字皆屬原著作者所有。
• 本投影片使用的圖片皆從網路搜尋。
• 本著作係採用姓名標示-非商業性-相同方式分享 3.0 台灣授權。閱讀本授權條款,請到
http://creativecommons.org/licenses/by-nc-sa/3.0/tw/,或寫信至Creative Commons, 444 Castro
Street, Suite 900, Mountain View, California, 94041, USA.
h t t p : / / m v c . t w

More Related Content

What's hot

What's hot (19)

twMVC#19 | opserver監控服務的解決
twMVC#19 | opserver監控服務的解決twMVC#19 | opserver監控服務的解決
twMVC#19 | opserver監控服務的解決
 
twMVC#22 | 一個微信專案從0到.000的效能調教之路
twMVC#22 | 一個微信專案從0到.000的效能調教之路twMVC#22 | 一個微信專案從0到.000的效能調教之路
twMVC#22 | 一個微信專案從0到.000的效能調教之路
 
twMVC#28 | visual studio 2017 新功能介紹
twMVC#28 | visual studio 2017 新功能介紹twMVC#28 | visual studio 2017 新功能介紹
twMVC#28 | visual studio 2017 新功能介紹
 
MVC實戰分享 分頁與排序相關技巧-tw mvc#13
MVC實戰分享 分頁與排序相關技巧-tw mvc#13MVC實戰分享 分頁與排序相關技巧-tw mvc#13
MVC實戰分享 分頁與排序相關技巧-tw mvc#13
 
twMVC#29 -Learning Machine Learning with Movie Recommendation
twMVC#29 -Learning Machine Learning with Movie RecommendationtwMVC#29 -Learning Machine Learning with Movie Recommendation
twMVC#29 -Learning Machine Learning with Movie Recommendation
 
Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2
 
twMVC#19 | 微信公眾平台申請與wechat api 開發血淚史
twMVC#19 | 微信公眾平台申請與wechat api 開發血淚史twMVC#19 | 微信公眾平台申請與wechat api 開發血淚史
twMVC#19 | 微信公眾平台申請與wechat api 開發血淚史
 
開發的效能與效率-twMVC#15
開發的效能與效率-twMVC#15開發的效能與效率-twMVC#15
開發的效能與效率-twMVC#15
 
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
 
twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程
twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程
twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程
 
如何在實務上使用TDD來開發 twmvc#12
如何在實務上使用TDD來開發 twmvc#12如何在實務上使用TDD來開發 twmvc#12
如何在實務上使用TDD來開發 twmvc#12
 
twMVC#22 | 什麼鬼的IOC與DI
twMVC#22 | 什麼鬼的IOC與DItwMVC#22 | 什麼鬼的IOC與DI
twMVC#22 | 什麼鬼的IOC與DI
 
twMVC#24 | 開發團隊的敏捷之路(未完成)
twMVC#24 | 開發團隊的敏捷之路(未完成)twMVC#24 | 開發團隊的敏捷之路(未完成)
twMVC#24 | 開發團隊的敏捷之路(未完成)
 
twMVC#31沒有 hdd 的網站重構 webform to mvc
twMVC#31沒有 hdd 的網站重構 webform to mvctwMVC#31沒有 hdd 的網站重構 webform to mvc
twMVC#31沒有 hdd 的網站重構 webform to mvc
 
Vs2013新功能介紹 twMVC#11
Vs2013新功能介紹 twMVC#11Vs2013新功能介紹 twMVC#11
Vs2013新功能介紹 twMVC#11
 
twMVC#23 | 一個Mobile App開發、維護與改版的愛恨之路
twMVC#23 | 一個Mobile App開發、維護與改版的愛恨之路twMVC#23 | 一個Mobile App開發、維護與改版的愛恨之路
twMVC#23 | 一個Mobile App開發、維護與改版的愛恨之路
 
SignalR實戰技巧 twmvc#17
SignalR實戰技巧 twmvc#17 SignalR實戰技巧 twmvc#17
SignalR實戰技巧 twmvc#17
 
ASP.NET MVC 善用網路資源快速完打造網站
ASP.NET MVC 善用網路資源快速完打造網站ASP.NET MVC 善用網路資源快速完打造網站
ASP.NET MVC 善用網路資源快速完打造網站
 
ASP.NET MVC Model 的設計與使用 twMVC#10
ASP.NET MVC Model 的設計與使用 twMVC#10ASP.NET MVC Model 的設計與使用 twMVC#10
ASP.NET MVC Model 的設計與使用 twMVC#10
 

Viewers also liked

MongoDB for Time Series Data: Schema Design
MongoDB for Time Series Data: Schema DesignMongoDB for Time Series Data: Schema Design
MongoDB for Time Series Data: Schema Design
MongoDB
 

Viewers also liked (20)

線上遊戲利用 Dev ops 開源工具 chef, docker, vagrant 在microsoft azure 的佈署實踐-Global Azure...
線上遊戲利用 Dev ops 開源工具 chef, docker, vagrant 在microsoft azure 的佈署實踐-Global Azure...線上遊戲利用 Dev ops 開源工具 chef, docker, vagrant 在microsoft azure 的佈署實踐-Global Azure...
線上遊戲利用 Dev ops 開源工具 chef, docker, vagrant 在microsoft azure 的佈署實踐-Global Azure...
 
Node.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deploymentNode.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deployment
 
雲端環境的快取策略-Global Azure Bootcamp 2015 臺北場
雲端環境的快取策略-Global Azure Bootcamp 2015 臺北場雲端環境的快取策略-Global Azure Bootcamp 2015 臺北場
雲端環境的快取策略-Global Azure Bootcamp 2015 臺北場
 
Azure mobileservice
Azure mobileservice Azure mobileservice
Azure mobileservice
 
雲端上的資訊安全-Global Azure Bootcamp 2015 臺北場
雲端上的資訊安全-Global Azure Bootcamp 2015 臺北場雲端上的資訊安全-Global Azure Bootcamp 2015 臺北場
雲端上的資訊安全-Global Azure Bootcamp 2015 臺北場
 
讓應用程式雲端化 由 Iaa s 邁向 paas 之路-Global Azure Bootcamp 2015 臺北場
讓應用程式雲端化 由 Iaa s 邁向 paas 之路-Global Azure Bootcamp 2015 臺北場讓應用程式雲端化 由 Iaa s 邁向 paas 之路-Global Azure Bootcamp 2015 臺北場
讓應用程式雲端化 由 Iaa s 邁向 paas 之路-Global Azure Bootcamp 2015 臺北場
 
前端工程師與室內裝修師傅的相似之處-twMVC#16
前端工程師與室內裝修師傅的相似之處-twMVC#16前端工程師與室內裝修師傅的相似之處-twMVC#16
前端工程師與室內裝修師傅的相似之處-twMVC#16
 
Unit test and ui testing with cucumber
Unit test and ui testing with cucumberUnit test and ui testing with cucumber
Unit test and ui testing with cucumber
 
技術單兵作戰及團隊開發流程差異
技術單兵作戰及團隊開發流程差異技術單兵作戰及團隊開發流程差異
技術單兵作戰及團隊開發流程差異
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
Migrating from RDBMS to MongoDB
Migrating from RDBMS to MongoDBMigrating from RDBMS to MongoDB
Migrating from RDBMS to MongoDB
 
You will learn RxJS in 2017
You will learn RxJS in 2017You will learn RxJS in 2017
You will learn RxJS in 2017
 
Bootstrap4 與他的好搭檔
Bootstrap4 與他的好搭檔Bootstrap4 與他的好搭檔
Bootstrap4 與他的好搭檔
 
Grid - 新時代的排版利器
Grid - 新時代的排版利器Grid - 新時代的排版利器
Grid - 新時代的排版利器
 
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]
 
MongoDB for Time Series Data: Schema Design
MongoDB for Time Series Data: Schema DesignMongoDB for Time Series Data: Schema Design
MongoDB for Time Series Data: Schema Design
 
PWA 與 Service Worker
PWA 與 Service WorkerPWA 與 Service Worker
PWA 與 Service Worker
 
Git 經驗分享
Git 經驗分享Git 經驗分享
Git 經驗分享
 
[系列活動] 手把手的深度學習實務
[系列活動] 手把手的深度學習實務[系列活動] 手把手的深度學習實務
[系列活動] 手把手的深度學習實務
 
[朝陽科大] D3.js 資料視覺化入門
[朝陽科大] D3.js 資料視覺化入門 [朝陽科大] D3.js 資料視覺化入門
[朝陽科大] D3.js 資料視覺化入門
 

Similar to 動手打造 application framework-twMVC#15

Wxpython In Action
Wxpython In ActionWxpython In Action
Wxpython In Action
智锋 范
 
Asp.net mvc網站的從無到有
Asp.net mvc網站的從無到有Asp.net mvc網站的從無到有
Asp.net mvc網站的從無到有
Wade Huang
 
自动化运维管理
自动化运维管理自动化运维管理
自动化运维管理
frankwsj
 
深入研究雲端應用程式平台-AppFabric
深入研究雲端應用程式平台-AppFabric深入研究雲端應用程式平台-AppFabric
深入研究雲端應用程式平台-AppFabric
John Chang
 

Similar to 動手打造 application framework-twMVC#15 (20)

Wxpython In Action
Wxpython In ActionWxpython In Action
Wxpython In Action
 
twMVC#31網站上線了然後呢
twMVC#31網站上線了然後呢twMVC#31網站上線了然後呢
twMVC#31網站上線了然後呢
 
Asp.net mvc網站的從無到有
Asp.net mvc網站的從無到有Asp.net mvc網站的從無到有
Asp.net mvc網站的從無到有
 
Flex 4.5 action custom component development
Flex 4.5 action custom component developmentFlex 4.5 action custom component development
Flex 4.5 action custom component development
 
自动化运维管理
自动化运维管理自动化运维管理
自动化运维管理
 
twMVC#06 | Wiindows市集應用程式 開發心得分享
twMVC#06 | Wiindows市集應用程式 開發心得分享twMVC#06 | Wiindows市集應用程式 開發心得分享
twMVC#06 | Wiindows市集應用程式 開發心得分享
 
Windows 市集應用程式 開發心得分享 -twMVC#6
Windows 市集應用程式 開發心得分享 -twMVC#6Windows 市集應用程式 開發心得分享 -twMVC#6
Windows 市集應用程式 開發心得分享 -twMVC#6
 
twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC#01 | ASP.NET MVC 的第一次親密接觸twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC#01 | ASP.NET MVC 的第一次親密接觸
 
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
 
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
 
Windows 與 Azure 的容器旅程 @ Ignite Mini 2016
Windows 與 Azure 的容器旅程 @ Ignite Mini 2016Windows 與 Azure 的容器旅程 @ Ignite Mini 2016
Windows 與 Azure 的容器旅程 @ Ignite Mini 2016
 
twMVC#18 | 專案分層架構
twMVC#18 | 專案分層架構twMVC#18 | 專案分層架構
twMVC#18 | 專案分層架構
 
Clipper@datacon.2019.tw
Clipper@datacon.2019.twClipper@datacon.2019.tw
Clipper@datacon.2019.tw
 
深入浅出 V cloud director
深入浅出 V cloud director深入浅出 V cloud director
深入浅出 V cloud director
 
Azure Functions
Azure FunctionsAzure Functions
Azure Functions
 
Exodus2 大局观
Exodus2 大局观Exodus2 大局观
Exodus2 大局观
 
深入研究雲端應用程式平台-AppFabric
深入研究雲端應用程式平台-AppFabric深入研究雲端應用程式平台-AppFabric
深入研究雲端應用程式平台-AppFabric
 
How to replace linux system call by module
How to replace linux system call by moduleHow to replace linux system call by module
How to replace linux system call by module
 
Envrionment as a code with vagrant & chef
Envrionment as a code with vagrant & chefEnvrionment as a code with vagrant & chef
Envrionment as a code with vagrant & chef
 
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC#30 | 你應該瞭解的 container-on-azure-二三事twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
 

More from twMVC

樞紐分析表之數據分析與統計-twMV#C14
樞紐分析表之數據分析與統計-twMV#C14樞紐分析表之數據分析與統計-twMV#C14
樞紐分析表之數據分析與統計-twMV#C14
twMVC
 
20130823微軟雲端平台開發者日
20130823微軟雲端平台開發者日20130823微軟雲端平台開發者日
20130823微軟雲端平台開發者日
twMVC
 

More from twMVC (12)

TypeScript-twmvc#16
TypeScript-twmvc#16TypeScript-twmvc#16
TypeScript-twmvc#16
 
樞紐分析表之數據分析與統計-twMV#C14
樞紐分析表之數據分析與統計-twMV#C14樞紐分析表之數據分析與統計-twMV#C14
樞紐分析表之數據分析與統計-twMV#C14
 
RWD不是你想的那樣 tw mvc#13
RWD不是你想的那樣 tw mvc#13RWD不是你想的那樣 tw mvc#13
RWD不是你想的那樣 tw mvc#13
 
架構設計入門 twMVC#11
架構設計入門 twMVC#11架構設計入門 twMVC#11
架構設計入門 twMVC#11
 
Knockout 從零開始,實戰教學 twMVC#10
Knockout 從零開始,實戰教學 twMVC#10Knockout 從零開始,實戰教學 twMVC#10
Knockout 從零開始,實戰教學 twMVC#10
 
20130823微軟雲端平台開發者日
20130823微軟雲端平台開發者日20130823微軟雲端平台開發者日
20130823微軟雲端平台開發者日
 
NFC近場通訊-twMVC#9
NFC近場通訊-twMVC#9NFC近場通訊-twMVC#9
NFC近場通訊-twMVC#9
 
AngularJS 開發 ASP.NET MVC -twMVC#9
AngularJS 開發 ASP.NET MVC -twMVC#9AngularJS 開發 ASP.NET MVC -twMVC#9
AngularJS 開發 ASP.NET MVC -twMVC#9
 
使用 ASP.NET MVC 開發SPA網站-微軟實戰課程日
使用 ASP.NET MVC 開發SPA網站-微軟實戰課程日使用 ASP.NET MVC 開發SPA網站-微軟實戰課程日
使用 ASP.NET MVC 開發SPA網站-微軟實戰課程日
 
ASP.NET MVC Web API -twMVC#8
ASP.NET MVC Web API -twMVC#8ASP.NET MVC Web API -twMVC#8
ASP.NET MVC Web API -twMVC#8
 
超。光速 網站最佳化實戰 -twMVC#8
超。光速 網站最佳化實戰 -twMVC#8超。光速 網站最佳化實戰 -twMVC#8
超。光速 網站最佳化實戰 -twMVC#8
 
透過測試提升軟體品質 - twMVC#7
透過測試提升軟體品質 - twMVC#7透過測試提升軟體品質 - twMVC#7
透過測試提升軟體品質 - twMVC#7
 

動手打造 application framework-twMVC#15