IT界討論區(58) 唔講上一份人工
實驗羊 2019-3-9 12:05:48 所以啲人問

你最多係用邊個 Design Pattern sounds like an on9 question

Ads

青花瓷 2019-3-9 12:16:43 用我上面句野答
:^(
青花瓷 2019-3-9 12:17:44 and no two patterns are the same
實驗羊 2019-3-9 12:42:27 Yes ar

Actually I use the most consistent is Singleton
i-vtec找J/屎眼數 2019-3-9 13:09:27 Singleton
:^(
手一黏便緊(UTC+9 2019-3-9 14:10:39 決定左有咩feature之後先決定用咩design pattern囉
:^(
Trinidad 2019-3-9 14:19:15 從來都唔用
:^(

鳩寫爛曲算
行到咪得囉

singelton又要factory
搞咁多做乜?
有野咪new出黎用吓囉
仁生已完 2019-3-9 14:30:06 t巴真係好正
:^(
揾食啫 2019-3-9 14:52:22
:^(
實驗羊 2019-3-9 15:00:00 唔執你手尾
:^(
實驗羊 2019-3-9 15:00:57 So you will think about which design pattern to use before actually writing?

Ads

實驗羊 2019-3-9 15:01:53 Yes ar
But even when I refractor I only follow DRY code and Single source of truth
實驗羊 2019-3-9 15:02:08 What’s wrong
Trinidad 2019-3-9 15:59:50 真係咁寫架喎
普通application 根本寫到靚一靚同諗到乜就寫乜出黎係冇分別
除非玩big data同好講performance 架啫
Trinidad 2019-3-9 16:00:31 一個大class搞哂所有野
實驗羊 2019-3-9 16:07:25 100K 月薪 and 100K lines of code
Trinidad 2019-3-9 16:08:58 singleton好多時係為寫而寫
:^(
實驗羊 2019-3-9 16:10:44 MVC need single data model wor
Trinidad 2019-3-9 16:12:48 同用唔用singleton 係兩樣野黎
我睇法係好多野用singleton 都係哂鳩氣
實驗羊 2019-3-9 16:13:37 But every app I developed always have 1 Singleton

Only 1 tho
Trinidad 2019-3-9 16:17:48 乜先
同埋你以前玩java就話冇得揀
你寫c#有static class
static class定singleton 都有排拗

Ads

手一黏便緊(UTC+9 2019-3-9 16:25:13 咪諗下寫下諗下寫下咁既feedback loop囉
:^(
唔係完全唔諗 亦唔係落左決定就永世唔改
:^(
實驗羊 2019-3-9 16:27:17 I no chance C# la
Full time iOS dev
手一黏便緊(UTC+9 2019-3-9 16:29:03 又唔完全係為寫而寫
:^(

如果有N個class 本身啲object reference chain係好精巧既
但係你要改 要跨幾層class 而你既上一手同事又唔知死左去邊
咁最簡單咪就係改某啲class做singleton
最好一定係了解成個設計意圖 然後fit入去個chain到
但係同上一手同事有不可跨越既時空距離 都唔係我可以控制到既事黎...
Trinidad 2019-3-9 16:29:11 你有backend架嘛
:^(