- μλ¬Έ : http://www.industriallogic.com/pulse/20001001.html
- λ²μ κΈ μΆμ² - From νμ΄ν
μλ°λνΈν
Design Pattern μ±
μ λ°μ κ±Έμ³ λ°λ³΅μ μΌλ‘ μλͺ» μ΄ν΄λλ λ΄μ©λ€μ΄ μλλ°, λΆννκ²λ μ΄λ¬ν μ€μλ GoFμ μ€νμΌμ λͺ¨λ°©ν λ€λ₯Έ Pattern μ±
μ μ μλ€μκ²μλ λ°λ³΅μ μΌλ‘ λνλλ€.
Each GoF pattern has a section called "Structure" that contains an OMT (or for more recent works, UML) diagram. This "Structure" section title is misleading because it suggests that there is only one Structure of a Pattern, while in fact there are many structures and ways to implement each Pattern.
μ¬μ€μ κ° Patternμ ꡬννκΈ° μν μ¬λ¬κ°μ§ λ°©λ²μ΄ μλλ°, GoFμ OMT diagramμ 보λ
ΈλΌλ©΄ λ§μΉ κ° Patternμ λν λ¨ νκ°μ§ ꡬνλ§μ΄ μλ κ²μΌλ‘ μλͺ» μ΄ν΄λ μ μλ€.
But inexperienced Patterns students and users don't know this. They read the Patterns literature too quickly, often thinking that they understand a Pattern merely by understanding it's single "Structure" diagram. This is a shortcoming of the GoF Form, one which I believe is harmful to readers.
νμ§λ§, Patternμ λν κ²½νμ΄ λΆμ‘±ν νμλ€μ΄λ μ¬μ©μλ€μ μ΄ μ¬μ€μ λͺ¨λ₯΄κ³ μλ€. κ·Έλ€μ Patternμ λν μ μ λ€μ λ무 빨리 μ½λλ€. λ¨μ§ ν κ°μ Diagramλ§μ μ΄ν΄νλ κ²μΌλ‘ Patternμ μ΄ν΄νλ€κ³ μ°©κ°νλ κ²½μ°λ μ¦λ€. μ΄κ² λ°λ‘ νμκ° μκ°νκΈ°μλ λ
μλ€μκ² ν΄λ‘μ보μ΄λ GoF λ°©μμ λ¨μ μ΄λ€.
What about all those important and subtle Implementation notes that are included with each GoF Pattern? Don't those notes make it clear that a Pattern can be implemented in many ways? Answer: No, because many folks never even read the Implementation notes. They much prefer the nice, neat Structure diagrams, because they usually only take up a third of a page, and you don't have to read and think a lot to understand them.
GoF μ±
μ κ° Pattern λ§λ€ 첨λΆλμ΄ μλ ꡬνμ λν λ§€μ° μ€μνκ³ λ―Όκ°ν ν΄μ€λ€μ μ΄λ νκ°? μ΄ ν΄μ€λ€μ ν΅ν΄μ Patternμ΄ μ¬λ¬ λ°©λ²μΌλ‘ ꡬνλ μ μλ€λ μ¬μ€μ μ μλ μμκΉ? μ μ μμ κ²μ΄λ€. μλνλ©΄ λ§μ λ
μλ€μ΄ μμ ꡬνμ λν ν΄μ€ λΆλΆμ μ½μ§λ μκ³ λμ΄κ°κΈ° λλ¬Έμ΄λ€. κ·Έλ€μ λ³΄ν΅ κ°λ΅νκ³ νλ₯νκ² κ·Έλ €μ§ Structure diagramμ λ μ νΈνλλ°, κ·Έ μ΄μ λ λ³΄ν΅ Diagramμ λν λ΄μ©μ΄ μΈ νμ΄μ§ μ λ λΆλ λ°μ λμ§ μμ λΏλλ¬ μ΄κ²μ μ΄ν΄νκΈ° μν΄ λ§μ μκ°λμ κ³ λ―Όμ ν νμλ μκΈ° λλ¬Έμ΄λ€.
Diagrams are seductive, especially to engineers. Diagrams communicate a great deal in a small amount of space. But in the case of the GoF Structure Diagrams, the picture doesn't say enough. It is far more important to convey to readers that a Pattern has numerous Structures, and can be implemented in numerous ways.
μμ§λμ΄λ€μκ² μμ΄μ Diagramμ μ λ§ λΏλ¦¬μΉκΈ° νλ μ νΉμ΄λ€. νμ§λ§ Gofμ Structure diagramμ κ²½μ°μ μΆ©λΆν λ§μ λ΄μ©μ λ§ν΄μ€ μ μλ€. Patternλ€μ΄ λ€μν Structureλ₯Ό κ°μ§ μ μμΌλ©°, λ€μνκ² κ΅¬νλ μ μλ€λ κ²μ λ
μλ€μκ² μλ €μ£ΌκΈ°μ ν±μμ΄ λΆμ‘±νλ€.
I routinely ask folks to add the word "SAMPLE" to each GoF Structure diagram in the Design Patterns book. In the future, I'd much prefer to see sketches of numerous structures for each Pattern, so readers can quickly understand that there isn't just one way to implement a Pattern. But if an author will take that step, I'd suggest going even further: loose the GoF style altogether and communicate via a pattern language, rich with diagrams, strong language, code and stories.
κ²°λ‘ μ~ ν¨ν΄μ ꡬννλλ°μ κΌ νκ°μ§ ννμ λ€μ΄μ΄κ·Έλ¨κ³Ό νκ°μ§ ννμ ꡬνμ΄ μλ€λ κ²μ μλλΌλ μ΄μΌκΈ°. GoF μμμ λ€μ΄μ΄κ·Έλ¨ λν νλμ μλΌλ κ²μ κ°μ‘°.
곡λΆνλ μ
μ₯μΌλ‘μ μΈμν΄λλ§ν λ΄μ©μ΄λΌ μκ°μ΄ λλ€μ.
λΉλ¨ ν¨ν΄λ§μ΄ κ·Έλ μ§λ μμ΅λλ€. μ‘°κΈμ λ€λ₯Έ μ΄μΌκΈ°λ₯Ό ν΄λ³΄κ³ λ‘ νμ§μ. μ¬λμΌλ‘λΆν° λμ¨(derived) μ΄λ€ μ -무νμ κ²λ€μ κ·Έκ²μ λ§λ μ¬λ, λ κ·Έ μ¬λμ΄ λͺΈλ΄κ³ μλ νκ²½μ λ°μ(reflection) ν©λλ€. μλ₯Όλ€μ΄, μ€μΈκ³μμ μ§μ μ§λλ€κ³ ν΄λ΄
μλ€. κ±°κΈ°μ μλ§μ 곡λ²μ΄ μ‘΄μ¬ν©λλ€. λ νλμ 곡λ²μ μ΄μΌκΈ°νλ€κ³ ν΄λ μ€μ λ‘ ν¬μ
λλ μ¬λλ€μλ°λΌ λ€μνκ² λμ¬ μ μμ΅λλ€.(μ§λ 2002λ
1μ 8μΌ λ΄μ€μμλ μΈ‘λν λλ§λ€ λ€λ₯Έ ν μ§ κ³μ°μ΄ λμ€λκ΅°μ) μ‘°κΈλ μλ±ν μ΄μΌκΈ°λ₯Ό ν΄λ³ΌκΉμ. νλλμ λ§μμ νλμ΄κ² μ§λ§, μ±κ²½μ ν΄μνκΈ°μ λ°λΌ λ€λ¦
λλ€. λ κ·Έ νλνλμ μ±κ²½μ νλμ§λ§ κ·Έλ₯Ό λ―Ώλ μ¬λμ΄ λ°μλ€μ΄κΈ°μ λ°λΌ λ€μν΄μ§λλ€.
νλ¬Έ, λ λνμ μ΄μκ°μ μμ΄ νλμ μ¬μ€μ΄λ μ견μ μ ν λ, μ λμ μ΄λ κ²μ "λͺ
μ " λ "μ§λ¦¬" κ°μ κ² μΈμλ μμμ μκ°ν΄λ³΄λ©΄ λ΅μ μ°Ύλλ° λμμ΄ λ κ² μ
λλ€. λ€λ§, λμ 보μ΄λ ννμμλ μ΄λ₯Ό κΈλ°© μΈμ§νκΈ° μ¬μ°λ, λμ 보μ΄μ§ μλ ννμ΄κ±°λ(μλ₯Όλ€λ©΄ μ§μ), μ΅κ΄μ μΌλ‘ λ―Ώμλ§νλ€κ³ μκ°λλ 맀체μμ μ»μ μ 보λ μ΄μΌκΈ°μ λν΄ "κ²½κ³μ λ μ΄λ"λ₯Ό κΊΌλκ±°λ λ―Έμ² μμ차릴 κ²½ν©μ΄ μκ² λλ κ²½μ°λ₯Ό μ‘°μ¬νλ©΄ λκ² μ£ .
μ.. λμΉλ₯Ό μ±μ
¨λμ? μ΄ κΈλ κ·Έλ₯ κ·Έλ°κ°λ³΄λ€ νκ³ μ½μ΄μΌ νλ κΈμ€ νλμ
λλ€.
-- μ΄μ μ°
.png)