Studying Design Patterns

실리콘·2023년 3월 2일
0

Design Patterns (1994) -GoF is a big book.
It is more of a catalog then a textbook to read. It introduces 23 most commonly used design patterns.
(btw, If you are interested, buy the book and read it. It is also available in Google Books as ebook.)

We are a team of 1~2 yr junior devs, so faced w/ a 450 page book, my study group was overwhelmed. Thankfully, there is a Guide to readers section, which tells you some of the approaches you can take to this book. You can read the 8 most basic patterns: Abstract Factory, Adapter, Composite, Decorator, Factory Method, Observer, Strategy, Template Method. Or follow w/ ch2 case study, which introduces total of 8 patterns, w/ 4 of them also included in Guide to Readers section. Or you can start from one pattern and propagate to other related patterns.

But whichever apporach you take, the end result you want is this: When a problem arises in your daily SW development, you can think of patterns that can solve this problems. You may need to adapt it a bit, like mixing a few patterns together or being smart w/ your implementation. But the key thing is you have a instant pattern match to your problem you can build on.

Our group took the case study route. It was because we wanted to see an actual example of design patterns application. But I don't think it was the optimal way.

The upside of this choice is that it gives you some place to start on the book. It is a 450 page book, w/ about 350 pages being catalog of popular software Design Patterns. Unless you are experienced in both SW and reading, it can be overwhelming. It was for me.

But there was also downside. While reading through [ch2, A Case Study: Designing a Document Editor], we realized the book is 30 yrs old. So the case study was not relatable albeit being a good example. Also, you have to read 50 page of detailed explanations, so it is some reading. A single pattern catalog takes ~12 pages (i think), so if you wish you could have read at least 4 more patterns.

There are also some augmentations you can take, like accompany an online course in the language of your choice. This book came out 30 yrs ago. The example screenshots are old. C++ is old. I mean it is still used extensively, but there can be better examples. If you are doing web dev or ML, C++ is probably not what you would learn. All the catalogs are also in C++. But then again, it also means there are many good online courses in Java, JS, Python, Rust etc.

Now it is the last week of this study, and I think I at least indexed the 8 patterns mentally. Starting from these 8 patterns, I can stem from it as needed, checking out related patterns.

===
This was my 2nd study at this company, following Refactoring 2nd ed by Martin Fowler. We studied a subsection each week, met at lunch and discussed points.

profile
software engineer

0개의 댓글