Forgot your password?
typodupeerror

+ - The Blind Builder: Alternative to Bloch Builder, for highly-extendable classes->

Submitted by aliteralmind
aliteralmind (1811938) writes "I have been greatly influenced by Joshua Bloch's Effective Java (2nd edition), probably more so than with any programming book I've read. In particular, his Builder Pattern (item 2) has had the greatest effect on me. I have gotten farther in the past couple of months since discovering this book, than in my past decade of programming. Despite this, I am still finding myself hitting the same wall: Extending classes with self-returning method-chains is at best discouraging, and at worst a nightmare--especially when generics come into play, and especially with self-referential generics, such as Comparable<T extends Comparable<T>>. As a result, I have created what I call "The Blind Builder", which is a replacement for the Bloch Builder, for a very specialized situation: for use in classes that are highly-reusable, and intended for extending and sub-extending many times over. Not to say in any way that this pattern is "better", just that in this particular situation it does provide some advantages. The biggest is how it decouples the to-be-built class from its builder, allowing it to be extended without having to extend its builder. Another benefit is that, aside from a single character, The Blind Builder is used in exactly the same way as the Bloch Builder. This pattern is thoroughly documented, and is presented in a question-and-answer format."
Link to Original Source

From Sharp minds come... pointed heads. -- Bryan Sparrowhawk

Working...