My bad to leave this place empty for almost two months. Perhaps just an excuse, work do exploded to fill all your available time.
Another dive into design pattern
Now this semester I am taking George ‘s Modern Software Design Course (without attending any lecture as this is surprisingly a day-time course ), which has one of the focuses in Design Pattern. George is the best instructor at HKUCS I ever known, taught me basics of OO (0396), software engineering (0297) to testing (0403). Only in later courses I could share his insights.
Like most junior programmers, I know design pattern is important and one knows it only by coding. However, we may not understand this idea clearly enough.
I do agree on George, that design pattern is a great advance in software engineering. It is a form of Knowledge sharing.
No, for sure we are not trying to apply as many design pattern as possible to call it a good design, which is a popular myth. As Jeff Atwood wrote, this add complexity in the opposite. With patterns the code ought to be simpler.
But still it is true that there are many problems that are recurring and solutions should be readily available.
Also as I started to work in the industry, I understand the best thing of Design Pattern is about communication. when you say”Builder pattern”, everyone reasonably technical (a few) understand immediately. This is crucial as effective communication is always the most expensive thing in a software company.
For sure, when most people dont even have the chance to code, there is no point to discuss any design patterns. However it is important for everyone who is going to implement a reasonably-sized application.
Design Pattern is not only about OO, also not about memorizing the 23 patterns of GOF. It is about the idea.
There are much more, like Architectural pattern. As covered in the course partly, I am reading Elemental Design Pattern. One of the point is it is backed by mathematics, rho calculus to be exact.
I also read a bit on Enterprise Integration Patterns when I was introduced Apache Camel months ago. Both books are influential and interesting enough to add to any good developer’s reading list. (bad developers don’t read)
There are other critics to design pattern and follows deserve a look.
Design pattern and Language
Again, Jeff Atwood. He claimed that excessive reliance on design patterns show the failure of language.
Meanwhile, the design pattern concept can still be useful to identify the problem and solution, before we talk about the actual implementation. Most of the time boilerplate is a by-product in some implementation but not the flaw of the pattern. Framework should also be taken into considerations. For example, singleton can be easily achieved with Spring in JAVA.
Origin of design pattern
When I was reading Peopleware (I was just skimming through the chapters on office environment since I know it too well from my painful real life experience), I come up with this name.
Alexander grew up in England and started his education in sciences. In 1954, he was awarded the top open scholarship toTrinity College, Cambridge University in chemistry and physics, and went on to read mathematics. He earned a Bachelor’s degree in Architecture and a Master’s degree in Mathematics. He took his doctorate at Harvard (the first Ph.D. in Architecture ever awarded at Harvard University), and was elected fellow at Harvard. During the same period he worked at MIT in transportation theory and in computer science, and worked at Harvard in cognition and cognitive studies.
wow. It is the kind of polymath that I always adore. Architecture, Computer science and Cognitive science interest me enough.
Everyone know Gang of Four’s classics Design Pattern. However, not everyone know the book, and the Design Patterns concept itself originated from Christopher Alexander, notably his book A Pattern Language
There is a fundamental gap between the the concepts of GOF and Christopher.
Christopher’s idea is about
How can you distribute responsibility for design through all levels of a large hierarchy, while still maintaining consistency and harmony of overall design?
while GOF, or modern meaning of design pattern is about discover and consolidate existing patterns, such that recurring problem can be solved easier.
I do agree this difference is important and Christopher’s idea is still undervalued, even 10 years after Mark Dominus’s saying “We need to take a fresh look to Christopher Alexander”
Will share more after I finish the course and the books.