Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design Patterns in Smalltalk

It is often said that design patterns are mostly used in statically typed languages like C++ and Java, which I also agree. But in this article Robert Martin wrote

What a strange thing to say. Smalltalk, a dynamic language, played a significant role.

Since I don't have experience in Smalltalk I would like to ask if patterns like Strategy or Visitor are much used in Smalltalk? I don't think you need them in a "dynamic language"

like image 531
gefei Avatar asked Dec 02 '22 10:12

gefei


1 Answers

The Visitor pattern (as well as many others) is broadly used in Smalltalk. For instance the parsing and compilation of Smalltalk methods uses visitors. Code coloring and formatting are also typical examples. There are many other cases and the reason I mention these is because method compilation happens dynamically inside the development environment (for instance, the compiler is able to modify itself while running and acquire the changes immediately).

like image 151
Leandro Caniglia Avatar answered Dec 09 '22 15:12

Leandro Caniglia