E D R , A S I H C RSS

Gof Structure Diagram Considered Harmful

There's a mistake that's repeated throughout the Design Patterns book, and unfortunately, the mistake is being repeated by new patterns authors who ape the GoF style.

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일 뉴스에서는 측량할때마다 다른 토지 계산이 나오더군요) 조금더 엉뚱한 이야기를 해볼까요. 하나님의 말씀은 하나이겠지만, 성경은 해석하기에 따라 다릅니다. 또 그 하나하나의 성경은 하나지만 그를 믿는 사람이 받아들이기에 따라 다양해집니다.

학문, 더 넓혀서 살아감에 있어 하나의 사실이나 의견을 접할때, 절대적이란 것은 "명제" 나 "진리" 같은 것 외에는 없음을 생각해보면 답을 찾는데 도움이 될 것 입니다. 다만, 눈에 보이는 형태에서는 이를 금방 인지하기 쉬우나, 눈에 보이지 않는 형태이거나(예를들면 지식), 습관적으로 믿을만하다고 생각되는 매체에서 얻은 정보나 이야기에 대해 "경계의 레이더"를 꺼놓거나 미처 알아차릴 경황이 없게 되는 경우를 조심하면 되겠죠.

아.. 눈치를 채셨나요? 이 글도 그냥 그런가보다 하고 읽어야 하는 글중 하나입니다. :) -- 이선우


ForeverStudent 여야 함을 생각하게 된다는. --1002

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:18
Processing time 0.0371 sec