“Strive for beauty and elegance in every aspect of your work.”
Summary: Simple functional programming techniques in Scala make certain OOP design patterns, such as the Strategy Pattern, obsolete.
The OOP Strategy Pattern
Wikipedia describes the Strategy Pattern with this UML diagram:
This page titled, “What I wish I knew when learning Haskell” has this interesting section on monads. I agree with his statement that there’s no sense in studying monads; you just need to write a lot of code, and then you’ll see when you need a monad. That is, studying monads is like studying OOP design patterns when you don’t need them; they’re interesting to learn, but until you need them and use them you won’t really understand them.
Summary: The Law of Demeter is discussed using Java source code examples.
Whenever you talk to a good, experienced programmer, they will tell you that "loosely coupled" classes are very important to good software design.
The Law of Demeter for functions (or methods, in Java) attempts to minimize coupling between classes in any program. In short, the intent of this "law" is to prevent you from reaching into an object to gain access to a third object's methods. The Law of Demeter is often described this way:
I've recently started writing a series of articles on Design Patterns in Java, i.e., Design Patterns explained using Java source code examples. Although it will take me a little while to create each design pattern example, this page will eventually contain links to all of those examples.
If you're not familiar with software design patterns, they're described on Wikipedia like this:
The Chain of Responsibility Pattern is a design pattern whose intent is to avoid coupling the sender of a request to its receivers by giving more than one object a chance to handle a request. The Chain of Responsibility works like this:
I have used GRASP in one context in this blog, but the GRASP I'm interested in today refers to Craig Larman's General Responsibility and Assignment Patterns. I saw those first referenced in Larman's book titled "Applying UML and Patterns". Larman's home page is one big page, but what the heck, he's a good author.
For those in need, here's a step-by-step tutorial on asking a girl for a date.
On a more serious note (or not) the following link contains some nice interaction design patterns, or what we call "Web UI" design patterns. Kudos to Martijn van Welie; if I had to be Siskel and Ebert I woudn't disagree with much of anything here.
Here's a heart-warming story of a dog sharing her love on my birthday.