Just My Life & My Work

Posts tagged ‘architecture’

糟糕的API製作

一年前也就是2017/1/27的紀錄,我經手一個幼稚園案子,我以為只要負責開發App的部分即可,所以報價非常的親民,因為對方是我非常好的老闆朋友。不過最後證實,這個案子讓我公司虧錢,時間成本多出3倍,為了斬斷所有牽絆,在卡卡頓頓開發一年後,宣布不再接手維護。

以下就描述我身為軟體架構師觀察到的問題:

API開發

此案不明原因分成三個人⋯⋯

  • A創造規格人(實作原型)
  • B建立架構人(實作雛形)
  • C開發實作人(實作成品)

幼稚園案子.gif

照理說,ABC要同一人才是!因為每個人的邏輯思考不同,若分為三個人接續製作,最後成果極度可能四不像,那可是會大大增加開發成本!

(繼續閱讀…)

廣告

MVC與MVP

已經寫超過三年半的iOS App,一直以為自己對MVC很熟,但其實不然,畢竟我一直不是用正規的MVC來實作,相信大多數的iOS App開發者也有類似的煩惱XD~

不過沒有寫得很標準,其實不會怎樣,大不了專案難以維護,接手你程式的工程師想要翻桌,這是每位稱職工程師的必經之路!於是我們會學習會成長,然後寫出更好的架構來。

最近技術委員會決議要統一iOS和Android的專案程式架構,由我們最資深的工程師楊大決定從MAC進展到MVP

MVC與MVP.gif

有了這張對照圖,就能很清楚MVC與MVP的差別!最關鍵的地方就在View和Model不互通有無的三角戀情。

(繼續閱讀…)

[圖解] 台北車站立體導覽圖

九年前搭捷運以來,回台中的家時必停留在台北車站,原本就有台鐵北捷,陸續又蓋好高鐵北轉,讓整個台北車站結構變得十分複雜。老實說,到現在我還是沒有記熟這四個交通互轉時的路線,但是有了這張高人設計師所畫的圖解台北車站立體導覽圖,我便可在腦海裡浮現立體圖,就算趕時間也能不慌不忙地走到目的地月台。

台北車站立體導覽圖

上圖可點擊放大喔~

實在很佩服設計師,能把極其複雜的北車結構畫得如此清晰,他還有畫些其它的捷運站。

台北車站每日運量高達32萬人次零號出口畫了這張表格,一目了然地知道台北捷運2015年08月運量前20名

台北捷運2015年08月運量前20名

跟我一樣喜歡旅遊、美食的朋友可參考:台北吃、喝、玩、樂-逍遙遊(可點擊)

.

.

參考:捷運車站立體導覽圖

[iOS][Watch OS] Watch OS 1 與 Watch OS 2 架構

才剛結束的2015年WWDC,宣布了Watch OS的誕生,而且馬上就是Watch OS 2!這跟過去一年的Watch OS 1有著非常大的差別,不過為了簡單起見,我們就先直接瞭解關鍵的差異,也就是Watch OS 1 與 Watch OS 2 架構

Watch OS 1架構可以參考我先前寫的Watch App Architecture

architecture watch OS

乍看之下只是把WatchKit Extension從iPhone移轉到Apple Watch,可是事實上要做的功夫可是很多很大~

(繼續閱讀…)

[iOS] Watch App Architecture

在瞭解Watch App目標架構後,我們想進一步瞭解:

  • Apple Watch與iPhone溝通
  • Watch App的運行流程
  • ViewController的生命週期

Apple Watch與iPhone溝通

Watch iPhone commucation

包含兩部分:Watch appWatchKit extension。Watch app在Watch上運行,只包含Storyboard和Resource;WatchKit extension在iPhone上運行,與對應的iPhone App在一起。當使用者點擊Watch App後,與Watch配對的iPhone會啟動WatchKit extension,然後與Watch建立連接,於是兩者可以溝通(如獲取資料等)。

(繼續閱讀…)

[iOS] Apple Watch 目標架構

開發Watch App時,所要注意的角色有三個,因為Watch App無法獨自運行,需要透過iOS App來啟動與操作它,而彼此溝通的橋樑則是WatchKit Extension。我們可以很清楚地從下圖得知三個角色的關係:

watch app target structure

使用Xcode 6.2開發Watch App時,原本的專案就是iOS App,操作順序:New->Target->Apple Watch->WatchKit App,便會同時產生WatchKit App與WatchKit Extension到專案中。WatchKit App僅含Storyboards與Resources,WatchKit Extension則含WatchKit Code與Resource。

new target watchkit app

據知未來Watch App可獨立運行,就讓我們拭目以待吧!

參考:Apple Watch开发初探

[Xamarin][iOS] 深度了解專案:電話字 (Sample Project: Phoneword)

承接範例專案:電話字 (Sample Project: Phoneword),再來就是解釋它怎麼運作,包含Xamarin介面C#程式碼,還有很重要的是Xamarin.iOS Application的剖析。

Xamarin iOS Application03

  • References – Contains the assemblies required to build and run the application. If we expand the directory, we’ll see references to .NET assemblies such as System , System.Core, and System.Xml , as well as a reference to Xamarin’s Xamarin.iOS assembly.
  • Components – The Components directory houses ready-made features from the Xamarin Components store , a public marketplace for Xamarin code. This is similar to the NuGet Gallery for those familiar with Visual Studio. For more information on Xamarin Components, refer to the Xamarin Components walkthrough .
  • Resources – The Resources folder stores icons, launch images, and other media. Xamarin has a separate guide for Working with Resources that explores the role of this directory further.
  • Main.cs – This contains the main entry point of the application. To start the application, we pass in the name of the main application class, the AppDelegate .
  • AppDelegate.cs – This file contains the main application class and is responsible for creating the Window, building the user interface, and listening to events from the operating system.
  • MainStoryboard.storyboard – The Storyboard contains the visual design of the application’s user interface. Storyboard files open in a graphical editor called the iOS Designer.
  • Phoneword_iOSViewController.cs – The View Controller powers the screen (View) that a user sees and touches. The View Controller is responsible for handling interactions between the user and the View.
  • Phoneword_iOSViewController.designer.cs – The designer.cs is an auto-generated file that serves as the glue between controls in the View and their code representations in the View Controller. Because this is an internal plumbing file, the IDE will overwrite any manual changes and most of the time we can ignore this file. For more information on the relationship between the visual Designer and the backing code, refer to the Introduction to the iOS Designer guide.
  • Info.plist – Info.plist is where we set application properties such as the application name, icons, launch images, and more. This is a powerful file and a thorough introduction to it is available in theWorking with Property Lists guide.
  • Entitlements.plist – The entitlements property list lets us specify application capabilities (also called App Store Technologies) such as iCloud, PassKit, and more. More information on theEntitlements.plist can be found in the Working with Property Lists guide. For a general introduction to entitlements, refer to the Device Provisioning guide.

看起來和Xcode裡的檔案架構很類似呢!學習來格外輕鬆~

(繼續閱讀…)

標籤雲

%d 位部落客按了讚: