---
tags: Design Pattern
---
# Design Pattern General Concept List
---
### generics and templates (static polymorphism)
The main difference is that <font color="#f00">generics</font> cannot accept non-type template arguments while <font color="#f00">templates</font> can.
---
### object orientation (dynamic polymorphism)
透過 object orientation 我們可以面對object命令而不是對更細項得操作,讓程式有比較好的維護性、可重用性以及可擴展性。因為 object 是封裝的,所以除非接口發生變化,否則object內部的改動不會影響與外界的溝通。
Through object orientation, we can face object commands instead of operating on more detailed items, so that the program has better maintainability, reusability and scalability. Because the object is encapsulated, unless the interface changes, changes inside the object will not affect communication with the outside world.
---
### static typing vs dynamic typing
static typing再給予值之前需要宣告他的資料類型,而dynamic typing不用;但省略這個步驟的dynamic typing雖然很方便,但有可能在某些時候產生小錯誤。
Static typing needs to declare its data type before assigning a value, but dynamic typing does not. Although dynamic typing that omits this step is very convenient, it may cause small errors in some cases.