SlideShare a Scribd company logo
ASP.NET MVC之實戰架構探討
MVC真的不是只有簡單的Model、View、Controller三層喔!
Bibby Chung
http://bibby.be
 三屆微軟最有價值專家經歷(ASP.NET)
 藍色小舖 高級專家
 twMVC 聯合創辦人之一
 目前於金融業及手機 APP 領域發展
講者簡介
Bibby Chung
http://bibby.be
2
 本投影片所包含的商標與文字皆屬原著作者所有。
 本投影片使用的圖片皆從網路搜尋。
 本著作係採用 Creative Commons 姓名標示-非商業性-相
同方式分享 3.0 台灣 (中華民國) 授權條款授權。
版權宣告
3
 Architecture Overview
 Design Principles and Patterns
 Design of the System
 ASP.NET MVC with N-Layer Architecture
 Examples of Discussion
 Final Thoughts
Agenda
4
 什麼是軟體架構設計
 軟體架構重要
 好處
 壞處
5
Architecture Overview
6
Architecture Overview
 物件導向設計(Object-Oriented Design)
 開放封閉原則(OCP)
 避免重複原则(DRY)
 單一責任原則(SRP)
7
Design Principles and Patterns
 物件導向設計(Object-Oriented Design)
 裡氏代換原則(LSP)
 相依性反向原則(DIP)
 介面分隔原則(ISP)
8
Design Principles and Patterns
 關注點分離(Separation of Concerns)
 什麼是關注點
 模組化
 隱藏細節資訊
9
Design Principles and Patterns
 命名方式(Naming Conventions)
 參考微軟的官方命名規則
 自定命名方式
 可讀性(Code Readability)
 註解
 區塊小
10
Design Principles and Patterns
 設計之前
 系統最終的目的是?
 功能需求還是非功能需求?
 專案品質要求?
 衝突與取捨
11
Design of the System
 設計之前
 有多少時間可以使用,專案開始時間專案結束時間?
 有多少的資源可以使用?
 你的系統要做多大?
 可擴充的系統需的嗎?
12
Design of the System
 第一步
 選擇你的分層策略
 決定哪些層你需要的
 未來專案如何佈署
 判斷是否您只需要一層
13
Design of the System
 第一步
 哪些物件規則是需要跨層的
 不同層如何互動
 不同層如何傳遞資料
14
Design of the System
 N-Layer
 Presentation Layer
 Business Layer
 Data Layer
15
Design of the System
 Layers
 Presentation Layer
 Services Layer
 Business Layer
 Data Layer
16
Design of the System
17
Design of the System
18
Design of the System
 Presentation Layer
 控制項
 多工
 驗證
19
Design of the System
 Business Layer
 Service Layer
 表象模式(Façade Pattern)
20
Design of the System
 Data Layer
 連線管理
 資料傳遞
 O/RM or ADO.NET
 安全性
21
Design of the System
 Cross-Cutting
 驗證身分 & 授權
 快取機制、狀態管理
 驗證
22
Design of the System
 Cross-Cutting
 設定管理
 例外處理
 日誌管理
23
Design of the System
24
ASP.NET MVC with N-Layer Architecture
 建立五個專案
 一個 ASP.NET MVC 專案
 四個 Class Library 專案
 Models 跟 Common 所有專案加入參考
 Web 加入 Services
 Services 加入 Repositories
25
Examples of Discussion
26
Examples of Discussion
27
Examples of Discussion
 這例子需要加強部分
 沒有遵守DIP(Dependency Inversion Principle)
 實作抽象
 IOC Library運用
 如何測試
 實作抽象加入測試專案
28
Examples of Discussion
29
Examples of Discussion
30
Examples of Discussion
 這是我們要的嗎?
 參考
Layered Application Guidelines
Three-Layered Services Application
31
Final Thoughts
 Blog  http://bibby.be
 Facebook  http://fb.me/bibbynet
 Plurk  http://www.plurk.com/bibbynet
32
聯絡我
Bibby Chung
http://bibby.be
http://mvc.tw
台灣 ASP.NET MVC 專業推廣團隊

More Related Content

What's hot (19)

PDF
twMVC#23 | 快速上手 Azure Functions
twMVC
 
PPTX
ASP.NET MVC 善用網路資源快速完打造網站
twMVC
 
PDF
twMVC#21 | 你所不知道的 Visual Studio
twMVC
 
PDF
twMVC#22 | 一個微信專案從0到.000的效能調教之路
twMVC
 
PDF
twMVC#24 | 開發團隊的敏捷之路(未完成)
twMVC
 
PDF
twMVC#29 | 當.Net Core 遇到AWS Lambda
twMVC
 
PDF
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
twMVC
 
PDF
twMVC#28 | visual studio 2017 新功能介紹
twMVC
 
PDF
如何在實務上使用TDD來開發 twmvc#12
twMVC
 
PDF
一小時可以打造什麼服務Plus twMVC#18
twMVC
 
PDF
輕鬆上手Asp.net web api 2.1-twMVC#14
twMVC
 
PDF
Asp.net mvc 從無到有 -twMVC#2
twMVC
 
PDF
twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程
twMVC
 
PDF
雲端環境的快取策略-Global Azure Bootcamp 2015 臺北場
twMVC
 
PDF
twMVC#22 | 什麼鬼的IOC與DI
twMVC
 
PDF
前端工程師與室內裝修師傅的相似之處-twMVC#16
twMVC
 
PDF
twMVC#23 | 一個Mobile App開發、維護與改版的愛恨之路
twMVC
 
PDF
SignalR實戰技巧 twmvc#17
twMVC
 
PDF
開發的效能與效率-twMVC#15
twMVC
 
twMVC#23 | 快速上手 Azure Functions
twMVC
 
ASP.NET MVC 善用網路資源快速完打造網站
twMVC
 
twMVC#21 | 你所不知道的 Visual Studio
twMVC
 
twMVC#22 | 一個微信專案從0到.000的效能調教之路
twMVC
 
twMVC#24 | 開發團隊的敏捷之路(未完成)
twMVC
 
twMVC#29 | 當.Net Core 遇到AWS Lambda
twMVC
 
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
twMVC
 
twMVC#28 | visual studio 2017 新功能介紹
twMVC
 
如何在實務上使用TDD來開發 twmvc#12
twMVC
 
一小時可以打造什麼服務Plus twMVC#18
twMVC
 
輕鬆上手Asp.net web api 2.1-twMVC#14
twMVC
 
Asp.net mvc 從無到有 -twMVC#2
twMVC
 
twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程
twMVC
 
雲端環境的快取策略-Global Azure Bootcamp 2015 臺北場
twMVC
 
twMVC#22 | 什麼鬼的IOC與DI
twMVC
 
前端工程師與室內裝修師傅的相似之處-twMVC#16
twMVC
 
twMVC#23 | 一個Mobile App開發、維護與改版的愛恨之路
twMVC
 
SignalR實戰技巧 twmvc#17
twMVC
 
開發的效能與效率-twMVC#15
twMVC
 

Similar to ASP.NET MVC之實戰架構探討 -twMVC#5 (20)

PDF
twMVC#03 | ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰
twMVC
 
PDF
ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3
twMVC
 
PPTX
KSDG-ASP.NET MVC 5 Overview (偽三國誌)
Bruce Chen
 
PDF
Asp.Net Mvc 1.0
Chui-Wen Chiu
 
PPTX
Asp.net mvc 基礎
Gelis Wu
 
PPSX
利用 ASP.NET MVC 提升您的 Web 應用程式
Chui-Wen Chiu
 
PPTX
Mvvm及其组件体系@杨文坚
正炎 高
 
PDF
與 Asp.net mvc 的第一次親密接觸 - twMVC#1
twMVC
 
PPTX
前端Mvc探讨及实践
enmaai
 
PPTX
ASP.NET MVC简介
Du Wanzhi
 
PDF
Single-Page Application Design Principles 101
Jollen Chen
 
PDF
twMVC#10 | ASP.NET MVC Model 的設計與使用
twMVC
 
PPTX
2014 Global Windows Bootcamp - 笑cc讓網站上雲端
Bruce Chen
 
PDF
20130823微軟雲端平台開發者日
twMVC
 
PPTX
twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC
 
PPTX
ASP.NET MVC 快速上手
Study4TW
 
PPTX
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練4
Duran Hsieh
 
PDF
Azure Machine Learning 重頭學
Ko Ko
 
PDF
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
twMVC
 
PDF
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
twMVC
 
twMVC#03 | ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰
twMVC
 
ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3
twMVC
 
KSDG-ASP.NET MVC 5 Overview (偽三國誌)
Bruce Chen
 
Asp.Net Mvc 1.0
Chui-Wen Chiu
 
Asp.net mvc 基礎
Gelis Wu
 
利用 ASP.NET MVC 提升您的 Web 應用程式
Chui-Wen Chiu
 
Mvvm及其组件体系@杨文坚
正炎 高
 
與 Asp.net mvc 的第一次親密接觸 - twMVC#1
twMVC
 
前端Mvc探讨及实践
enmaai
 
ASP.NET MVC简介
Du Wanzhi
 
Single-Page Application Design Principles 101
Jollen Chen
 
twMVC#10 | ASP.NET MVC Model 的設計與使用
twMVC
 
2014 Global Windows Bootcamp - 笑cc讓網站上雲端
Bruce Chen
 
20130823微軟雲端平台開發者日
twMVC
 
twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC
 
ASP.NET MVC 快速上手
Study4TW
 
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練4
Duran Hsieh
 
Azure Machine Learning 重頭學
Ko Ko
 
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
twMVC
 
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
twMVC
 
Ad

More from twMVC (15)

PDF
雲端上的資訊安全-Global Azure Bootcamp 2015 臺北場
twMVC
 
PDF
讓應用程式雲端化 由 Iaa s 邁向 paas 之路-Global Azure Bootcamp 2015 臺北場
twMVC
 
PDF
線上遊戲利用 Dev ops 開源工具 chef, docker, vagrant 在microsoft azure 的佈署實踐-Global Azure...
twMVC
 
PDF
Azure mobileservice
twMVC
 
PDF
樞紐分析表之數據分析與統計-twMV#C14
twMVC
 
PPTX
RWD不是你想的那樣 tw mvc#13
twMVC
 
PDF
Vs2013新功能介紹 twMVC#11
twMVC
 
PDF
架構設計入門 twMVC#11
twMVC
 
PDF
Knockout 從零開始,實戰教學 twMVC#10
twMVC
 
PDF
NFC近場通訊-twMVC#9
twMVC
 
PDF
AngularJS 開發 ASP.NET MVC -twMVC#9
twMVC
 
PDF
使用 ASP.NET MVC 開發SPA網站-微軟實戰課程日
twMVC
 
PDF
ASP.NET MVC Web API -twMVC#8
twMVC
 
PDF
超。光速 網站最佳化實戰 -twMVC#8
twMVC
 
PDF
透過測試提升軟體品質 - twMVC#7
twMVC
 
雲端上的資訊安全-Global Azure Bootcamp 2015 臺北場
twMVC
 
讓應用程式雲端化 由 Iaa s 邁向 paas 之路-Global Azure Bootcamp 2015 臺北場
twMVC
 
線上遊戲利用 Dev ops 開源工具 chef, docker, vagrant 在microsoft azure 的佈署實踐-Global Azure...
twMVC
 
Azure mobileservice
twMVC
 
樞紐分析表之數據分析與統計-twMV#C14
twMVC
 
RWD不是你想的那樣 tw mvc#13
twMVC
 
Vs2013新功能介紹 twMVC#11
twMVC
 
架構設計入門 twMVC#11
twMVC
 
Knockout 從零開始,實戰教學 twMVC#10
twMVC
 
NFC近場通訊-twMVC#9
twMVC
 
AngularJS 開發 ASP.NET MVC -twMVC#9
twMVC
 
使用 ASP.NET MVC 開發SPA網站-微軟實戰課程日
twMVC
 
ASP.NET MVC Web API -twMVC#8
twMVC
 
超。光速 網站最佳化實戰 -twMVC#8
twMVC
 
透過測試提升軟體品質 - twMVC#7
twMVC
 
Ad

ASP.NET MVC之實戰架構探討 -twMVC#5