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.0979 sec