設計模式中組合大於繼承原則帶來的好處

這裏寫一個例子: 在某家公司裏的員工分爲經理,工作者和銷售者 使用繼承的方式 代碼參考:https://gitee.com/constfafa/designpattern_demo.git下的designpattern_demo/src/main/java/com/hfi/compositereuse/extend 使用組合的方式 代碼參考: https://gitee.com/constfafa
相關文章
相關標籤/搜索