﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>sw commented on Design patterns in the test of time: Builder</title><description>You can embed defaults in the builders instead of putting them in the objects you construct. That keeps your actual objects clean.
Builders are priceless for building configuration too. Some examples are AutoFac's ContainerBuilder or the fluent config builders for EntLib. In these scenarios it makes a lot of sense to "feed builders into builders". Think of building a configuration for logging where you build the sub-config for formatting log entries and the like.</description><link>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment7</link><guid>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment7</guid><pubDate>Fri, 26 Oct 2012 06:14:32 GMT</pubDate></item><item><title>João P. Bragança commented on Design patterns in the test of time: Builder</title><description>Or the fact that he's constructing it. Probably tastes like cardboard.</description><link>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment6</link><guid>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment6</guid><pubDate>Fri, 26 Oct 2012 04:16:00 GMT</pubDate></item><item><title>Frisian commented on Design patterns in the test of time: Builder</title><description>I like the Builder pattern as it is popular in the Java world: http://www.informit.com/articles/article.aspx?p=1216151&amp;seqNum=2

It allows you to create immutable objects without endlessly writing constructors for all cases. All checks can be conveniently put into the build() method.

If you don't mind creating a new builder every time you want to create a new object, there is a simpler way with almost no overhead compared to getters/setters: http://egalluzzo.blogspot.de/2010/06/using-inheritance-with-fluent.html

</description><link>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment5</link><guid>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment5</guid><pubDate>Thu, 25 Oct 2012 14:02:38 GMT</pubDate></item><item><title>Euphoric commented on Design patterns in the test of time: Builder</title><description>Yes, the example is too simplified and doesn't show real power of Builder pattern.
It only shines when used in more complex scenarios or in conjunction with other patterns, like strategy. It is logical to use Builder when code specifying the construction details is actually different than the code that fetches the final result.</description><link>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment4</link><guid>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment4</guid><pubDate>Thu, 25 Oct 2012 12:48:26 GMT</pubDate></item><item><title>Mark commented on Design patterns in the test of time: Builder</title><description>I agree with Ayende. In the real world what use a cook in a pizza parlour if he doesn't know how to make an Hawaiian pizza.</description><link>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment3</link><guid>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment3</guid><pubDate>Thu, 25 Oct 2012 10:55:31 GMT</pubDate></item><item><title>Yves Reynhout commented on Design patterns in the test of time: Builder</title><description>I've been using message builders for a long time now and found they bring this to the table:
- better semantics/intent (more verb-y than noun-y),
- making a construct that is immutable, mutable for the duration of its construction,
- allow different parts of the code to contribute to the building process</description><link>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment2</link><guid>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment2</guid><pubDate>Thu, 25 Oct 2012 10:49:55 GMT</pubDate></item><item><title>Moti commented on Design patterns in the test of time: Builder</title><description>I find this pattern priceless when working with legacy code.</description><link>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment1</link><guid>http://ayende.com/159362/design-patterns-in-the-test-of-time-builder#comment1</guid><pubDate>Thu, 25 Oct 2012 10:45:34 GMT</pubDate></item></channel></rss>