iT邦幫忙

2023 iThome 鐵人賽

DAY 5
0
Cloud Native

The Journey of ASP.NET and Beyond系列 第 5

The Way to .NET Core: Web API Overlook

  • 分享至 

  • xImage
  •  

Now this is not the end. It is not even the beginning of the end. But it is, perhaps, the end of the beginning. Winston Churchill

  旅程過了四天,終於可見Web API之門映入眼簾,通往.NET之道也終於到了最後一哩路,在其不遠處有著可瞭望至Web API整體之俯瞰處,於正式入門前,先至彼處望其布局吧。於俯瞰處見其整體布局,從大門之入口開始,向後延伸是其樞紐,控制之區,通四面八方,有運貨人在其中,運至物流服務之區,其區又有驛站,可於其流通其貨至資料庫,如此往復,形成如今之Web API。

入口 The Program


  Web API之入口處,Web API之萬物由其開始,此處亦是各服務註冊之處。
https://ithelp.ithome.com.tw/upload/images/20230923/20151244oHY4CZGxqy.png

控制區 The Controller


  ASP.NET Core支援使用控制器或使用最少的API來建立Web API。Web API中的「控制器」都衍生自類別 ControllerBase。控制器會根據每個要求啟動和處置。Web API之樞紐處,可處理各個請求,並交付需處之事於服務之區,最終等待服務之業務完成後,給予最合適之回應。

運貨人 The DTO


  全名乃資料傳輸物件者,乃使資料得以於物件及物件或層及層之間相互流通,其用意在於結合諸多事物,並使其具體而清晰。

服務區 The Service


  運貨人載物而至服務區,執行控制區本需執行之各種業務,以減輕控制區之負擔,又負責與驛站傳達欲與資料庫流通之資料。

驛站 The Model


  服務區與資料庫之窗口,服務區欲流通之資料,需經驛站處理,方可流通,其中驛站亦紀錄資料庫所需之格式。

The overlook of Web API
https://ithelp.ithome.com.tw/upload/images/20230923/20151244KpCXg4XwjG.jpg


上一篇
The Way to .NET Core: The Circulation Corporation
下一篇
ASP.NET Core Web API: Way to Database
系列文
The Journey of ASP.NET and Beyond30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言