E D R , A S I H C RSS

DPSC Chapter1



1. Chapter 1

1.1. Introduction

p1

Welcome to The Design Patterns Smalltalk Companion , a companion volume to Design Patterns Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and Jogn Vlissides(Gamma, 1995). While the earlier book was not the first publication on design patterns, it has fostered a minor revolution in the software engineering world.Designers are now speaking in the language of design patterns, and we have seen a proliferation of workshops, publications, and World Wide Web sites concerning design patterns. Design patterns are now a dominant theme in object-oriented programming research and development, and a new design patterns community has emerged.

The Design Patterns Smalltalk Companion ˜ „„— ˜‹ ฑธ ™˜˜•ฉ๋‹ˆ๋‹ค. ฑ…€ Design Patterns Elements of Reusable Object-Oriented Software(•˜ DP) Erich Gamma, Richard Helm, Ralph Johnson, and Jogn Vlissides(Gamma, 1995). ˜ Žธ๋žŒ(companion, ๋ณดธฐ— Žธ๋ฆฌ•˜๋„๋ก „๋ช…•˜ฒŒ ๋งŒ๋“  ฑ…) ž…๋‹ˆ๋‹ค. •ž„œ œ„๋œ ฑ…(DP)ด ๋””žŒจ„— ด€๋ •œ ฑ…— œดˆ˜ ฑ…€ •„‹ˆง€๋งŒ, DP๋Š” †Œ”„Šธ›จ–ด —”ง€๋‹ˆ–ด๋ง˜ „„— ž‘€ ˜๋ช…„ œผฐŠต๋‹ˆ๋‹ค.  œ ๋””žด๋„ˆ๋“ค€ ๋””žŒจ„˜ –ธ–ด๋กœ •ธฐ •˜๋ฉฐ, šฐ๋ฆฌ๋Š” ๋””žŒจ„ณผ ด€๋ •œ ˆ˜๋งŽ€ workshop, œŒ๋ฌผ, ธ๋ฆฌ  ›น‚ฌŠธ๋“คญŒ” œผ๋กœ ๋Š˜–ด๋‚˜๋Š”ฑธ ๋ณด•„™”Šต๋‹ˆ๋‹ค. ๋””žŒจ„€ ฒดง€–ฅ ”„๋กœธ๋ž˜๋ฐ˜ —ฐตฌ™€ œ๋ฐœ— žˆ–ด„œ ‘š”•œ œ„˜๋ฅผ ฐ€ง€๋ฉฐ, — ๋”ฐ๋ƒˆ๋กœšด ๋””žŒจ„ปค๋ฎค๋‹ˆ‹ฐ๋“คด ๋“ฑžฅ•˜  žˆŠต๋‹ˆ๋‹ค.(emerge ๋ฅผ come up or out into view ๋˜๋Š” come to light  •๋„๋กœ •„•˜๋Š”ฒŒ ๋งžง€ •Š„นŒ.  œ ๋””žŒจ„€ ฒดง€–ฅ ”„๋กœธ๋ž˜๋ฐ˜ —ฐตฌ™€ œ๋ฐœ— žˆ–ด„œ ‘š”•œ œ„˜๋ฅผ ฐ€ง€  žˆœผ๋ฉฐ, ๋””žŒจ„ปค๋ฎค๋‹ˆ‹ฐ๋“คƒˆ๋กœด ๋“ฑžฅ•˜  žˆ๋Š” ถ”„ž…๋‹ˆ๋‹ค. ธ๋ž˜๋„ ข€ –ดƒ‰•˜ตฐ. -_-; -- „œ ๋ฐ”ฟ”๋ดค๋Š”๋ฐ –ด๋•Œ? -ƒ๋ฏผ -- DeleteMe)gogo..~ ๋‚˜‘—  •๋ฆฌ‹œ ˜„žฌ ๋ถ€—ฐ ๋ถ™€ ธ€ ‚ญ œ•˜๋˜ง€, ๋”ฐ๋กœ ๋ฐ‘— ๋นผ๋†“๋„๋ก •‹œ‹ค.

Design Patterns describes 23 design patterns for applications implemented in an object-oriented programming language. Of course, these 23 patterns do not capture all the design knowledge an object-oriented designer will ever need. Nonetheless, the patterns from the "Gang of Four"(Gamma et al.) are a well-founded starting point. They are a design-level analog to the base class libraries found in Smalltalk development environments. They do not solve all problems but provide a foundation for learning environments. They do not solve all problems but provide a foundation for learning about design patterns in general and finding specific useful architectures that can be incorporated into the solutions for a wide variety of real-world design problems. They capture an expert level of design knowledge and provide the foundation required for building elegant, maintainable, extensible object-oriented programs.

๋””žŒจ„€ ฒดง€–ฅ –ธ–ด๋กœ  œž‘๋œ ”„๋กœธ๋žจ— 23œ˜ Œจ„„  œ‹œ•ฉ๋‹ˆ๋‹ค. ๋ฌผ๋ก , 23œ˜ Œจ„ฒดง€–ฅ ๋””žด๋„ˆ๋“ค•„š”๋กœ •  ๋ชจ๋“  ๋””ž˜ ๋‚œ œ๋“ค„  „๋ถ€ žก•„๋‚ดง€๋Š” ๋ชป•ฉ๋‹ˆ๋‹ค. ธ๋Ÿผ—๋„ ๋ถˆตฌ•˜  "Gang of Four"(Gamma et al.)—„œ  œ‹œ•œ 23œ˜ Œจ„€ ‹€ ๋””ž˜ ๋“ ๋“ •œ œ๋ฐœ„ ๋ณดžฅ•ฉ๋‹ˆ๋‹ค. ด 23œ˜ Œจ„€ Smalltalk class libraries— ธฐ๋ฐ˜„•œ ๋””žˆ˜ค€(design-level) ๋ถ„„(analog)ž…๋‹ˆ๋‹ค. Œจ„„ šฉ•„œ ๋ชจ๋“  ๋ฌธ œ๋ฅผ •ฒฐ•  ˆ˜๋Š” —†ง€๋งŒ,  „๋ฐ˜  , ‹ œ ๋””ž˜‹–‘•œ ๋ฌธ œ๋“ค„ œ„•œ •ฒฐฑ…„ œ„•œ œ šฉ•œ ง€‹๋“ค˜ ธฐ๋ฐ˜„  œณต• ฒƒž…๋‹ˆ๋‹ค. ๋˜, Œจ„„ †ต•„œ  „๋ฌธฐ€ ˆ˜ค€˜ ๋””žง€‹„ จ๋“•˜ , šฐ•„•˜ , ‚ฌ›„ ด€๋ฆฌฐ€ Žธ•˜ , ™•žฅ•˜ธฐ ‰ฌšด ฒดง€–ฅ ”„๋กœธ๋žจ œ๋ฐœ— ธฐดˆ ง€‹„  œณต•˜๋Š”๋ฐ †ก†ก•œ —ญ• „ • ฒƒž…๋‹ˆ๋‹ค.

In the Smalltalk Companion, we do not add to this "base library" of patterns;rather, we present them for the Smalltalk designer and programmer, at times interpreting and expanding on the patterns where this special perspective demands it. Our goal is not to replace Design Patterns; you should read the Smalltalk Companion with Design Patterns, not instead of it. We have tried not to repeat information that is already well documented by the Gang of Four book. Instead, we refer to it requently;you should too.

Smalltalk Companion—„œ, šฐ๋ฆฌ๋Š” Œจ„˜ "base library"๋ฅผ ถ”ฐ€•˜๋Š” ฒƒ๋ณด๋‹•žœผ๋กœ š”ตฌ๋  ˆ˜ žˆ๋Š” Œจ„œผ๋กœ•Œ๋•Œ๋กœ ™•žฅ•˜  •„•„œ, „„ž๋‚˜ ”„๋กœธ๋ž˜๋จธ๋ฅผ œ„• œณต•œ‹ค.
šฐ๋ฆฌ˜ ๋ชฉ € Design Pattern„ ตฒด•˜ ค๋Š” ฒƒ•„‹ˆ๋‹ค. ๋‹‹ € Design Pattern„ ๋Œ€‹ •˜๋Š” ฒƒ•„‹ˆ๋ผ Design Patternณผ •˜ Smalltalk Companion„ –ด••œ‹ค.
šฐ๋ฆฌ๋Š” Gang of Four ฑ…—„œ ด๋ฏธ ž˜ ๋ฌธ„œ™”๋œ  •๋ณด๋Š” ๋ฐ˜๋ณต•„œ ณต๋ถ€•˜ง€ •Š๋Š”๋‹ค. ๋Œ€‹ , šฐ๋ฆฌ๋Š” žฃผ ฒƒ„ ฐธกฐ•••œ‹ค. —ฌ๋Ÿฌ๋ถ„˜•œ ธ๋ ‡ฒŒ •••œ‹ค.

Another)
Smalltalk Companion—„œ, šฐ๋ฆฌ๋Š” Œจ„˜ 'base library'๋ฅผ ถ”ฐ€•˜ง€ •ŠŠต๋‹ˆ๋‹ค. ฒƒ๋ณด๋‹ค, šฐ๋ฆฌ๋Š” base library๋“ค„ Smalltalk ˜ ด€ —„œ •„•˜ •Œ?็Œ? ™•žฅ•˜—ฌ Smalltalk ๋””žด๋„ˆ™€ ”„๋กœธ๋ž˜๋จธ๋ฅผ œ„• œณต•  ฒƒž…๋‹ˆ๋‹ค. šฐ๋ฆฌ˜ ๋ชฉ‘œ๋Š” Design Patterns„ ๋Œ€ฒด•˜ ค๋Š” ฒƒ•„‹™๋‹ˆ๋‹ค. Design Patterns ๋Œ€‹  Smalltalk Companion„ œผ๋ •˜ง€ ๋งˆ‹œ , ๋‘ ฑ…„ ฐ™œ‹‹œ˜ค. šฐ๋ฆฌ๋Š” ด๋ฏธ Gang of Four—„œ ž˜ ๋ฌธ„œ™”๋œ  •๋ณด๋ฅผ ๋ฐ˜๋ณต•˜ง€ •Š„ฒ๋‹ˆ๋‹ค. ๋Œ€‹ , šฐ๋ฆฌ๋Š” GoF๋ฅผ žฃผ ฐธกฐ•  ฒƒ , ๋…ž๋“ค —ญ‹œ ธ๋ž˜••  ฒƒž…๋‹ˆ๋‹ค. -- ๋ฌธฒด๋ฅผ œ„—ฑฐ๋ž‘ ๋งžถฐ๋ดคŒ.. „œ



1.2. 1.1 Why Design Patterns?


Learning an object-oriented language after programming in another paradigm, such as the traditional procedural style, is difficult. Learning to program and compose application in Smalltalk requires a complex set of new skills and new ways of thinking about problems(e.g Rosson & Carroll, 1990; Singley, & Alpert, 1991). Climbing the "Smalltalk Mountain" learning curve is cetainly nontrivial. Once you have reached that plateau where you feel comfortable building simple Smalltalk applications, there is still a significant distance to the expert peak.

‹ค๋ฅธ ด๋ก  …Œ๋‘๋ฆฌ•ˆ—„œ ”„๋กœธ๋žจ( „†ต  ˆฐจ‹ Šคƒ€)„ •œ ›„ ฒด ง€–ฅ –ธ–ด๋ฅผ ๋ฐฐšฐ๋Š” ฒƒ€ –ด๋ ต๋‹ค. Smalltalk •ˆ—„œ ๋ณต•ฉ๋œ ‘šฉ ”„๋กœธ๋žจ •˜๋Š” ฒƒ„ ๋ฐฐšฐ๋Š” ฒƒ€ ๋ณตžก•œ ƒˆ๋กœšด ธฐˆ ณผ ๋ฌธ œ— ๋Œ€•œ ƒˆ๋กœšด ‚ฌ  ๋ฐฉ‹„ š”ตฌ•œ‹ค.(" e.g Rosson & Carroll, 1990; Singley, & Alpert, 1991") "Smalltalk" ๋ผ๋Š” ‚ฐ„ ˜ค๋ฅด๋Š” ฒƒ€ ™•‹žˆ ‚ฌ†Œ•œ ฒƒ•„‹ˆ๋‹ค. ผ๋‹จ ๋‹‹ „‹•œ Smalltalk ‘šฉ ”„๋กœธ๋žจ„ ๋งŒ๋“œ๋Š” ๋ฐ ž‹ žˆ๋Š” ฒฝง€— ๋‹•˜‹  •ด๋„, •„ง  „๋ฌธฐ€˜ ฒฝง€™€๋Š” ๋ถ„๋ช…•œ ฐจฐ€ žˆ๋‹ค.

Smalltalk experts know many things that novices do not, at various abstraction levels and across a wide spectrum of programming and design knowledge and skills:

  • The low-level details of the syntax and semantics of the Smalltalk language
  • What is available in the form of classes, methods, and functionality in the existing base class libraries
  • How to use the specific tools of the Smalltalk interactive development environment to find and reuse existing functionality for new problems, as well as understanding programs from both static and runtime perspective
  • How to define and implement behavior in new classes and where these classes ought to reside in the existing class hierarchy
  • Which classes work well together as frameworks
  • Recurring patterns of object configurations and interactions and the sorts of problems for which these cooperating objects provide (at least partial) solutions

Smalltalk  „๋ฌธฐ€๋“ค€ —ฌ๋Ÿฌฐ€ง€ ๋‹–‘•œ ถ”ƒ  ๋‹„™€ ญ๋„“€ programmingณผ design— ๋Œ€•œ ง€‹ณผ ธฐˆ ๋ฉด—„œ ดˆ‹ž๋“ค•Œง€ ๋ชป•˜๋Š” ๋งŽ€ ฒƒ„ •Œ  žˆ๋‹ค.

  • Smalltalk˜ ๋ฌธ๋ฒ•ณผ –ธ–ดธฐ˜  €ธ‰๋‹„ (ปด“จ„—„œ˜ low-level ๋‹„) •ญ๋ชฉ— ๋Œ€•
  • ˜„กด•˜๋Š” ธฐ๋ฐ˜ class ๋ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ๋ถ€„šฉฐ€๋Šฅ•œ class, methods. ธ๋ฆฌ  ธ ๋ชจ๋“ˆ๋“ค(˜„žฌ๋Š” functionality๋ฅผ function ตฐ๋“ค ๋˜๋Š” ๋ชจ๋“ˆ  •๋„๋กœ •„‘. ƒœด ๋ฐ”๋žŒ. --;)— ๋Œ€•
  • ƒˆ๋กœšด ๋ฌธ œ๋ฅผ ฐพ  ๋ฌธ œ •ฒฐ„ œ„•œ ธฐกด˜ ๋ชจ๋“ˆ„ žฌ‚ฌšฉ•˜ธฐ œ„•ด, ๋˜๋Š”  • ฑฐ๋‚˜ ๋™ ด€  –‘ชฝ ธก๋ฉด—„œ ”„๋กœธ๋žจ„ ••˜ธฐ œ„•–ด๋–ปฒŒ Smalltalk IDE ˆด„ ‚ฌšฉ•••˜๋Š”ฐ€— ๋Œ€•
  • –ด๋–ค ด๋ž˜Šค๋“คด frameworks๋กœ„œ „œ๋กœ ž˜ ž‘๋™•˜๋Š”ง€— ๋Œ€•
  • ฒด˜ ™˜ฒฝ„ •ณผ ƒ˜ž‘šฉ, ด๋Ÿฌ•œ „œ๋กœ ˜‘ •˜๋Š” ฒด๋“ค•ฒฐ•••  ๋ฌธ œ๋“ค˜  • ฌ ๋“ฑ—„œ ๋ฐ˜๋ณต๋˜๋Š” Œจ„— ๋Œ€•

This is by no means an exhaustive list, and even novices understand and use much of the knowledge. But some items, especially the last -- recurring patterns of software design, or design patterns -- are the province of design expert.

A design pattern is a reusable implementation model or architecture that can be applied to solve a particular recurring class of problem. The pattern sometimes describes how methods in a single class or subhierarchy of classes work together; more often, it shows how multiple classes and their instances collaborate. It turns out that particular architectures reappear in different applications and systems to the extent that a generic pattern template emerges, one that experts reapply and customize to new application - and domain-specific problems. Hence, experts know how to apply design patterns to new problems to implement elegant and extensible solutions.

๋””žŒจ„€ ๋Š—†ด ๋ฐœƒ•˜๋Š” ด๋ž˜Šค ตฌ„ƒ˜ ๋ฌธ œ— •ฒฐฑ…„  œ‹œ•˜๋Š” žฌ‚ฌšฉ• ˆ˜ žˆ๋Š” ‹–‰ ๋ชจ๋ธด๋‚˜ •„‚ค…˜ด๋‹ค. ๋•Œ๋กœ Œจ„€ ๋‹จ๋… ฑฐ๋‚˜ •˜œ„ ด๋ž˜Šค ตฌกฐ—„œ –ด๋–ปฒŒ ๋งค„œ๋“œ ๋“ค•˜ ž‘šฉ•˜๋Š”ง€๋ฅผ ๋ฌ˜‚ฌ•œ‹ค.; •„๋งˆ๋„, Œจ„ƒ—„œ๋Š” ข€๋” ๋นˆ๋ฒˆžˆ ๋‹‘ ด๋ž˜Šค๋‚˜ ธ๋“ค˜ Šค„Šค˜ ˜‘ „ ๋ณด—ฌ„‹ค.

Œจ„€ ฐธฐ ๋‹ค๋ฅธ –ด”Œ๋ฆฌผ€…˜ณผ ‹œŠค…œƒ—„œ žฌ˜„๋˜๋Š” Šน๋ณ„•œ( œ •œ, ”Œ๋žซผ ข…† ธ) •„‚คƒ˜,  „๋ฌธฐ€๋“คƒˆ๋กœšด –ด”Œ๋ฆฌผ€…˜,๋ถ„•—„œ ๋ฐœƒ•˜๋Š” Šน๋ณ„•œ ๋ฌธ œ๋“ค„  œฑฐ•œ‹ค. (œ„—„œ “ฐธ oneด particular architecture™€ ๋™๋“ฑ•œ œ„˜๋กœ •„•œ ๋ฐฉ๋ฒ•. ๋‹ค๋ฅธ˜ฒฌ  œ•ˆ๋ฐ”๋žŒ-ƒ๋ฏผ

ธ๋Ÿฌ๋ฏ€๋กœ,  „๋ฌธฐ€๋“ค€ –ด๋–ปฒŒ ƒˆ๋กœšด ๋ฌธ œ— ๋Œ€•˜—ฌ  •„•˜  ™•žฅ„žˆ๋Š” •ฒฐฑ…œผ๋กœ •ˆ๋‚ด•˜๋Š” ๋””žŒจ„˜ ™œšฉ ๋ฐฉ๋ฒ•„ •Œ  žˆ๋‹ค.
(ธ๋Ÿฌ๋ฏ€๋กœ,  „๋ฌธฐ€๋“ค€ ƒˆ๋กœšด ๋ฌธ œ๋ฅผ •ฒฐ•˜ธฐ œ„•ด ๋ช…พŒ•˜  ™•žฅ„ด ๋›ฐ–ด๋‚œ ๋””žŒจ„„  šฉ•˜๋Š” ๋ฐฉ๋ฒ•„ •Œ  žˆ๋‹ค.)



In general, designers -- in numerous domains, not just software -- apply their experience with past problems and solution to new, similar problems. As Duego and Benson(1996) point out, expert designers apply what is known in cognitive psychology and artificial intelligence as case-based reasoning, remembering past cases and applying what they learned there. This is the sort of reasoning that chess masters, doctors, lawyers, and architects empoly to solve new problems. Now, design patterns allow software designers to learn from and apply the experiences of other designers as well. As in other domains, a literature of proven patterns has emerged. As a result, we can "stand on the shoulders of giants" to get us closer to the expert peak. As John Vlissies (1997) asserts, design patterns "capture expertise and make it accessible to non-experts" (p. 32).

๋””žด๋„ˆ๋“ค-†Œ”„Šธ›จ–ด—๋งŒ ตญ•œ•˜ง€ •Š€ ˆ˜๋งŽ€ ๋ถ„•—„œ-€ ธ๋“ค˜ ณผฑฐ˜ ๋ฌธ œ™€, •ด๋ฒ•— ฒฝ—˜„ ๋น„Š•œ ๋ฌธ œ—  šฉ ‹œ‚จ๋‹ค. Duego™€ Genson(1996)€  „๋ฌธ ๋””žด๋„ˆ๋“ค‚ฌ๋ก€๋ฅผ ธฐ๋ฐ˜œผ๋กœ ฒฝ—˜—„œ ง€•œ ง€˜œ•ˆ—„œ ณผฑฐ˜ ‚ฌ๋ก€๋ฅผ ธฐ–ต•˜  ธ๋“คด ๋ฐฐšดฒƒ„  šฉ‹œ‚ค๋Š” ฒƒ— ฃผ๋ชฉ•œ‹ค. (ƒ๋žต ๋ฐ ˜—ญ) ฒƒ€ ฒดŠค˜  ˆ˜, ˜‚ฌ, ๋ณ€˜‚ฌ ธ๋ฆฌ  ฑด•ฐ€๋“คƒˆ๋กœšด ๋ฌธ œ— ๋Œ€‘•˜๋Š” ถ”๋ก  ๋ฐฉ‹˜ •œ ๋ฐฉ‹ด๋‹ค. ˜„žฌ, ๋””žŒจ„€ †Œ”„Šธ›จ–ด ๋””žด๋„ˆ๋“คด ๋ฐฐ›Œ˜ฒƒ๋“คณผ ๋‹ค๋ฅธ ๋ถ„•˜ ๋””žด๋„ˆ(other designer)๋“ค˜ ฒฝ—˜๋“ค ๋ชจ๋‘๋ฅผ ฐ•ˆ•œ‹ค. ด๋Ÿฐ ๋…ธ๋ ฅ๋“ค€ ฒฐณผ œผ๋กœ, "ฑฐ˜ –ดนจ— ˜ฌ๋„œ žˆ๋Š”ฒƒ" ฐ™€ ๋ฐฉ๋ฒ•œผ๋กœ šฐ๋ฆฌ๋ฅผ ›Œ๋ฅญ•œ ๋””ž— ด๋Œˆ˜ žˆ๋‹ค. John Vlissies(1997)€ ๋””žŒจ„€ " „๋ฌธ ง€‹„ žก  ๋น„ „๋ฌธฐ€๋“คฒƒ„ šฉ•˜ธฐ ‰ฝฒŒ •ฃผ๋Š” ฒƒด๋  ‰•œ‹ค. (p. 32).

Design patterns also provide a succinct vocabulary with which to describe new designs and retrospectively explain existing ones. Patterns let us understand a design at a high level before drilling down to focus on details. They allow us to envision entire configurations of objects and classes at a large grain size and communicate these ideas to other designers by name. We can say, "Implement the database access object as a Singleton," rather than, "Let's make sure the database access class has just one instance. The class should include a class variable to keep track of the singl instance. The class should make the instance globally available but control access to it. The class should control when the instance is created and ..." Which would you prefer?

๋””žŒจ„€ ƒˆ๋กœšด Œจ„— ด€•„œ „‹•˜ฒŒ ›๋ฆฌ๋ฅผ ‘œ˜„•˜ , Œจ„€ กดžฌ•˜๋Š” ๋ชจŠต„ พธค€žˆ „ค๋ช…•œ‹ค.Œจ„€ „ธ๋ถ€๋‚ดšฉ— ๋“ค–ดฐ€ธฐ •ž„œ, ข€๋” ฐ ด€ œผ๋กœ •ด๋ฅผ • ˆ˜žˆฒŒ •œ‹ค. Œจ„€ šฐ๋ฆฌฐ€ ข€๋” ฐ ด€ —œผ๋กœ„ธ ๋‹ค๋ฅธ ๋””žด๋„ˆ๋“ค˜ ƒฐ˜ ต™˜‹œ ฒดณผ ด๋ž˜Šคฐ€ –ด๋–ปฒŒ ตฌ„ฑ๋˜–ด žˆ๋Š”ง€ ๋ฌ˜‚ฌ•œ‹ค. šฐ๋ฆฌ๋Š” "‹ธ€„ด ๋ฉ”†Œ๋“œ๋กœ ๋ฐ„ฐ ๋ฒ Šค  ‘ผ ๋ถ€๋ถ„„ ตฌ„–ˆŠต๋‹ˆ๋‹ค." ธ๋ฆฌ  "๋ฐ„ฐ ๋ฒ Šค  ‘€ ˜ง •˜๋‚˜˜ Šค„Šค๋งŒ ‘•˜๋„๋ก •Šต๋‹ˆ๋‹ค. ด๋ž˜Šค๋Š” ‹ธ€ Šค„Šค˜ ๋ฐฉ๋ฒ• ‚ฌšฉ„ œ„•„œ ด๋ž˜Šค ๋ณ€ˆ˜๋ฅผ ‚ฌšฉ• ฒƒž…๋‹ˆ๋‹ค. ด๋ž˜Šค๋Š” ‘—ญœผ๋กœ ‘—ญœผ๋กœ  ‘ฐ€๋Šฅ•œ Šค„Šค๋กœ ๋ ฒƒง€๋งŒ, ๋‚˜‘ นจ
ด๋ž˜Šค๋Š” Šค„Šคฐ€ ๋งŒ๋“ค–ดง€ ... "  ๋ง• ˆ˜ žˆŠต๋‹ˆ๋‹ค. ๋‹‹ € –ด๋–ปฒŒ „ค๋ช…•˜ Šต๋‹ˆนŒ?

กธ๋ „œ.. --; กฐ๋งŒ„ ๋งˆ € •˜ Œ -- „œ

1.3. 1.2 Why a Smalltalk Companion?


p3 ‘„๋ถ€„

Christopher Alexander and his colleagues have written extensively on the use of design patterns for living and working spaces-homes, buildings, communal areas, towns. Their work is considered the inspiration for the notion of software design patterns. In The Timeless Way of Building(1979) Alexander asserts, "Sometimes there are version of the same pattern, slightly different, in different cultures" (p.276). C++ and Smalltalk are different languages, different environments, different cultures-although the same basic pattern may be viable in both languages, each culture may give rise to different versions.

Christopher Alexander™€ ˜ œตฌ, ๋™๋ฃŒ๋“ค€ ๋””žŒจ„ณต„™œšฉณผ, ฑด•, ณต๋™ฒด˜ ตฌ„ฑ๋ฐฉ๋ฒ• นŒง€ ™•žฅ๋˜๋Š” ฒƒ— ด€•œ ธ€„ จ™”๋‹ค. —ฌธฐ—„œ ธ๋“คถ”ตฌ•˜๋Š” ๋ฐ”๋Š” ด๋Ÿฐ ๋ถ„•—  šฉ„ †ต•˜—ฌ, †Œ”„Šธ›จ–ด ๋””žŒจ„„ œ„•œ˜ ๋‹ค๋ฅธ ƒˆ๋กœšด ฐฝกฐ  ƒฐ ฆ‰, ˜ฐ„ –ปธฐœ„•œ ผ๋ ˜ ž‘—…(ถ๋ฆฌ)ด๋‹ค. The Timeless Way of Building(1979) —?? Alexander๋Š” "๋•Œ๋กœ๋Š” „œ๋กœ‹ค๋ฅธ ๋ฌธ™”ถŒ—„œ •„ฃผ •„€ ๋‹ค๋ฅดฒŒ ฐ™€ Œจ„˜ ๋ฒ„ „๋“คกดžฌ•˜ฑธ ๋ณผˆ˜ žˆ๋‹ค"(p.276) ๋  –ธธ‰•œ‹ค. C++ณผ Samlltalk๋Š” ๋น„๋ก ฐ™€ ธฐ๋ณธ Œจ„—„œ˜ œ๋ฐœ„ •ด๋„‹ค๋ฅธ –ธ–ด, ๋‹ค๋ฅธ œ๋ฐœ™˜ฒฝ, ๋‹ค๋ฅธ ๋ฌธ™”๋กœ ๋ง๋ฏธ•”•„ ฐž ๋‹ค๋ฅธ ๋ชจ–‘ƒˆ๋ฅผ ๋ณด—ฌค€๋‹ค.

The Gang of Four's Design Patterns presents design issues and solutions from a C+ perspective. It illustrates patterns for the most part with C++ code and considers issues germane to a C++ implementation. Those issue are important for C++ developres, but they also make the patterns more difficult to understand and apply for developers using other languages.

Gang of Four˜ Design Patterns € C++˜ ด€ —„œ ๋””ž˜ Šˆ™€ •ฒฐฑ…๋“ค„  œ‹œ•œ‹ค. Design Patterns๋Š” ๋Œ€๋ถ€๋ถ„ C++„ šฉ•œ Œจ„ด๋“คณผ, C++˜  šฉ(implementation)ณผ ด€๋ žˆ๋Š” Šˆ๋“ค— ด€•œ ฒฌ•ด๋ฅผ ๋‹ค๋ฃจ  žˆ๋‹ค. ธ๋Ÿฌ•œ Šˆ๋“ค€ C++ œ๋ฐœž๋“ค—ฒŒ๋Š” ๋งคšฐ ‘𔕠ง€ ๋ชจ๋ฅดง€๋งŒ, ๋‹ค๋ฅธ –ธ–ด๋“ค„ šฉ•˜  žˆ๋Š” œ๋ฐœž๋“ค—ฒŒ๋Š” žนซ ••˜  Œจ„˜  šฉ— –ด๋ ›€„ ฐ€ง€  ˜จ๋‹ค.

This book is designed to be a companion to Design Patterns, but one written from the Smalltalk perspective. One way to think of the Smalltalk Companion, then, is as a variation on a theme. We provide the same pattern as in the Gang of Four book but view them through Smalltalk glasses. (In fact, when we were trying out names for the Smalltalk Companion, someone suggested "DesignPattern asSmalltalkCompanion." However, we decided only hard-core Smalltalkers would get it.)

ฑ…€ Design Patterns — ๋Œ€•œ ง€นจ„œ, Žธ๋žŒœผ๋กœ  œž‘๋˜—ˆ๋‹ค. •˜ง€๋งŒ ด€ € Design Patternด C++ฒƒ— ๋ฐ˜•˜—ฌ ฑ…€ Smalltalk— ธฐ•œ‹ค. ธ๋ƒฅ, ฑ… Smalltalk Companion— ๋Œ€•„œ •˜๋‚˜˜ ฃผ œ(design pattern)— ด€•œ‹–‘•œ ž๋ฃŒ  •๋„๋กœ ƒฐ•คฌœผ๋ฉด •œ‹ค. šฐ๋ฆฌ๋Š” Gang of Four book—„œ˜ ฐ™€ Œจ„„  œณต•˜ง€๋งŒ, Smalltalk๋ผ๋Š” •ˆฒฝ„ †ต•„œ ๋ฐ”๋ผ๋ณผฒƒด๋‹ค. (‚ฌ‹ค, šฐ๋ฆฌฐ€ ด๋ฆ„— Samlltalk Companion„„„•Œ –ด๋–คด๋Š” "DesignPattern asSmalltalkCompanion" „-—ญžฃผ Smalltalk–ธ–ดƒ—„œ˜ ‘œ˜„๋ฒ••Œ๋ฌธฒƒ ฐ™Šต๋‹ˆ๋‹ค.-  œ•ˆ•˜ธฐ๋„ –ˆ๋‹ค. •˜ง€๋งŒ ธ๋Ÿฐ ด๋ฆ„€ hard-core Smalltalkers๋“ค๋งŒด๋ฆ„„ ๋ฐ›•„๋“คบผ๋  ƒฐ–ˆ๋‹ค.)


p 3 1.2˜ ๋งˆง€๋ง‰ ๋‹จ๋ฝ๋ถ€„ฐ ๋ฒˆ—ญ ‹œž‘•ฉ๋‹ˆ๋‹ค. --„ 

But the Smalltalk Companion goes beyond merely replicating the text of Design Patterns and plugging in Smalltalk examples whereever C++ appeared. As a result, there are numerous situations where we felt the need for additional analysis, clarification, or even minor disagreement with the original patterns. Thus, many of our discussions should apply to other object-oriented languages as well.

•˜ง€๋งŒ Smalltalk Companion€ Design Patterns ๋ฌธ„œ๋ฅผ ๋‹ˆœ•˜ฒŒ ๋ฐ˜๋ณต •˜๋Š”ฒƒ ƒ  C++ ฝ”๋“œฐ€ žˆ„ ฒฝšฐ Smalltalk ˜ˆ๋กœ ๋ฐ”พผ๋‹ค. ฒฐณผ œผ๋กœ, šฐ๋ฆฌฐ€ ถ”ฐ€ ธ ๋ถ„„, ๋ถ„๋ฅ˜, ˜€ ธฐกด˜ Œจ„— ๋Œ€•œ •„˜ ๋ถˆ˜•˜‹  ๋А๋ผ๋Š” ๋งŽ€ ƒ™ฉžˆ๋‹ค. ธ๋Ÿฌ๋ฏ€๋กœ, šฐ๋ฆฌ˜ ๋งŽ€ † ˜ฐ€ ๋‹ค๋ฅธ ฒด ง€–ฅ –ธ–ด— ž˜  šฉ๋˜••  ฒƒด๋‹ค.

Of course, we provide plenty of sample code in Smalltalk. Our examples are, for the most part, not simply Smalltalk versions of the Design Patterns examples. We often felt an alternative would be more useful than a mere translation of the C++ example.
Here in a nutshell are our goals for the Smalltalk Companion as a supplement to Design Patterns :

  • Discussion of issues specific to Smalltalk implementions of the Gang of Four's design patterns
  • Much more Smalltalk sample code
  • More Smalltalk known uses, especially from the major Smalltalk envirnoments class libraries
  • Exploring variations the patterns can embody in Smalltalk and in general
  • Many new examples, from application domains(insurance, telecommunications, etc.) and systems development (windowing systems, compilers, etc.)

๋ฌผ๋ก , šฐ๋ฆฌ๋Š” Smalltalk๋กœ๋œ „‹•œ ฝ”๋“œ๋ฅผ ๋งŽ œณต•œ‹ค. ๋Œ€๋ถ€๋ถ„—„œ, šฐ๋ฆฌ˜ ˜ˆ œ๋“ค€ Design Patterns ˜ˆ œ˜ „‹•œ Smalltalk ๋ฒ„ „€ •„‹ˆ๋‹ค. šฐ๋ฆฌ๋Š” žฃผ C++ ˜ˆ œ˜‹ˆœ•œ ๋ฒˆ—ญ ƒœผ๋กœ ข€๋” œ šฉ•˜‹ค๋Š” ฒƒ„ ๋Аผˆ๋‹ค. —ฌธฐ— „‹•œ ๋ง๋กœ Design Patterns— ๋ณดถฉ•œ Smalltalk Companion„ œ„•œ ๋ชฉ žˆ๋‹ค.

  • Gang of Four's design patterns˜ Smalltalk ตฌ˜„— ๋Œ€•œ ตฌ?…ˆๅฒต? Ÿ ˜ † ˜๋ฅผ •œ‹ค.
  • Smalltalk ƒ˜’€ ฝ”๋“œ ƒด๋‹ค.
  • Smalltalk๋ฅผ ข€๋” ž˜•Œ  ‚ฌšฉ•œ‹ค. Šนžˆ ฃผš”•œ Smalltalk ™˜ฒฝ class libraries๋“ค„ •Œ•„๋ณธ๋‹ค.
  • Smalltalk๋กœ ตฌฒด™”๋  ˆ˜ žˆ๋Š” ฒƒณผ ผ๋ฐ˜ Œจ„˜ ๋ณ€™”๋ฅผ ƒ—˜•˜ž.
  • ‘šฉ ”„๋กœธ๋žจ ˜—ญ(๋ณด—˜, Œ๋ฐฉ–ฅ †ต‹ , ๋“ฑ๋“ฑ.) ณผ ‹œŠค…œ œ๋ฐœ(œˆ๋„šฐฆˆ ‹œŠค…œ, ปดŒŒผ๋Ÿฌ, ๋“ฑ๋“ฑ.)˜ ๋งŽ€ ƒˆ๋กœšด ˜ˆ œ๋“ค„‹ค๋ฃฌ๋‹ค.


1.4. 1.3 C++ != Smalltalk(or, Smalltalk ~= C++)

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