builder design pattern state machine

The Builder pattern is a finite state machine!

Some weeks ago, I read the post referenced in a tweet. In short, the article provides two ways to generate the boilerplate code required by the Builder pattern: Lombok, to generate code at compile time and the Spark Eclipse plugin, to generate code at development time. However, I already wrote about the Builder pattern. And it’s a bit more complex than what’s described in the referenced post.

design pattern

The Visitor design pattern

I guess many people know about the Visitor design pattern, described in the Gang of Four’s Design Patterns: Elements of Reusable Object-Oriented Software book. The pattern itself is not very complex as many design patterns go. I’ve known Visitor since ages, but I’ve never needed it…​ yet. Java handles polymorphism natively: the method call is based upon the runtime type of the calling object, not on its compile type.

book design pattern GOF

Patterns book trinity

A design pattern in architecture and computer science is a formal way of documenting a solution to a design problem in a particular field of expertise. — Wikipedia Design patterns are a common reference in our line of work. People who discuss a pattern often draw strange looks from people who don’t about it (or who don’t know about patterns in general). Of course, there are dozens and dozens of design patterns just waiting for us to know them. IMHO, today, the three follo