IT界討論區(58) 唔講上一份人工

1001 回覆
6 Like 0 Dislike
2019-03-09 16:29:52
Right, but I’m just curious of the approach.

My personal experience is design pattern shows up after I finished writing the code, rather than I write code following the design pattern.
2019-03-09 16:30:38
My backend can just node js no need Singleton or even EN framework simpler than simple
2019-03-09 16:30:50
的確係
但我覺得本身singleton個原意同現實上用法都好大差距
普遍用法都係鳩寫singleton然後唔thread safe

我寧願事鳩旦new
2019-03-09 16:32:47
你諗太多了
design pattern只係幫助
你去design一個solution出黎嗰陣係要解決個問題而唔係完美咁fit any design pattern
a hard coded app is a gd app if it fits user requirement
2019-03-09 16:32:58
Agger
我諗既野唔係直接諗用咩design pattern
而係諗點樣令下一手同事睇得明 為此有咩細節要改 當中可能包 亦可能唔包design pattern

Design pattern呢個term與其話係一個目標 不如話係一個總結
唔係比你預先去朝住佢黎行 而係你行到一定距離個時可以用黎對比下 睇下有冇啟發令你行得更好
2019-03-09 16:52:36
唔係諗太多
係最近有條友問我用得最多嘅Design Pattern係乜,所以想做吓Reality Check係我唔識定條友離地。

不過咁諗好似係我Get錯個問題。
2019-03-09 16:54:38
interview問呢啲九成都係吹水題
識吹好過識做
2019-03-09 16:55:49
咁係你做啲工閪啫
有management exp in team/project/vendor係幾重要的
佢冇問錯
2019-03-09 17:13:18
下次直接叫佢收嗲算
2019-03-09 17:14:47
Management好重要但IT部唔過50人嘅公司講Methodology真心浪費時間
2019-03-09 17:16:45
咁又唔係
agile一向ideal係team of size 4-10ppl only
2019-03-09 17:18:29
But that’s 4-10 working on same project wor

If whole IT dept 10 people then...
2019-03-09 18:17:08
我諗佢都係想認識下你啫 你咪講下對design pattern既睇法
2019-03-09 18:18:42
My real design pattern = google -> stackoverflow
2019-03-09 18:19:43
呢個係workflow喎
2019-03-09 20:11:50
我依家寫code
多數係DI framework加埋immutable object
再無特別用GOF Design pattern

都係個句
有真正需求先會諗用邊種design
2019-03-09 20:23:46
我通常問自己
個object 有無changeable state?
如果有要點樣handle multiple thread access?
如果無係咪一定要Singleton?(e.g. Java static method class,aka helper class, aka I-dont-know-where-to-put-those-methods class)
仲有無alternative?
例如我10個Java application 10個都要求用Spring
會唔會用DI+immutable object?
定真係可以new object 算?

Singleton 無問題
只係我通常用唔到
2019-03-09 20:25:52
可能佢隨口問
睇你知唔知咩叫Design Pattern
你照直答你用過咩咪算
2019-03-09 20:45:58
問題係我嚴格嚟講乜都冇用過
2019-03-09 22:36:58
無用過都好合理
望下SI 一堆爛code
又有同你講咩Design Pattern 咩
一樣未死得
2019-03-09 23:02:54
以前都被人問過用邊隻 pattern 多,我答佢我真係無背 pattern 名
宜家我仲用得少,寫到咁複雜,最後其實都唔需要咁 flexible
2019-03-10 00:11:57
好既design係可以分清每一層layer of abstraction
每次改code我只係concern一個layer,而唔使擔心搞到其他layer,我個腦唔會cognitive overload

唔好既design就係某一d layer既logic depend on 幾個layer之前/後既野
例如reporting layer 直接query database 拎user資料

singelton本身都冇問題 只係如果唔同layer都access呢個class,而又係mutable 就會出事
2019-03-10 00:14:37
我in都有俾人問design pattern
但其實應該點答?
睇完wiki個list,頂啲技巧咁細微可能呢度用左啲嗰度用左過啲,有啲直情寫過code就會掂到架啦,好空泛喎
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞