﻿<?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>Mark Seemann commented on Design patterns in the test of time: Flyweight</title><description>@Jason Meckley, notice that I wrote "Singleton lifestyle" - not "Singleton pattern". It's not the same thing.</description><link>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment5</link><guid>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment5</guid><pubDate>Fri, 16 Nov 2012 08:40:26 GMT</pubDate></item><item><title>James McKay commented on Design patterns in the test of time: Flyweight</title><description>The thing about the Flyweight pattern is that it's pretty easy to understand, has a low cost to implementing it, doesn't tend to suffer much abuse, and usually gives significant benefits in terms of memory use in particular. I could also foresee some situations where it could be quite tricky to retro-fit it at a later date if necessary. With that in mind, I'd have thought that it would be good to keep it in mind as a possibility when first writing your code, rather than waiting till your profiler demands it.

I personally think the oft-quoted dictum, "Premature optimisation is the root of all evil" should be taken with a pinch of salt. A failure to optimise your code is actually a form of technical debt, and an optimisation is only premature if the size of that debt is small compared to the cost of implementing it, or compared to other performance bottlenecks elsewhere. I'm not entirely convinced that this is generally the case in situations where a Flyweight is up for consideration.</description><link>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment4</link><guid>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment4</guid><pubDate>Wed, 14 Nov 2012 22:15:25 GMT</pubDate></item><item><title>sukru commented on Design patterns in the test of time: Flyweight</title><description>I used this for a text-mining project, after exhausting first the 32-bits heap, then (after targeting 64-bits mode) the virtual memory. It really sped up the calculations by at least 10-fold (by not trashing items to swap).</description><link>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment3</link><guid>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment3</guid><pubDate>Wed, 14 Nov 2012 13:19:11 GMT</pubDate></item><item><title>Jason Meckley commented on Design patterns in the test of time: Flyweight</title><description>@Mark, no singleton is just that a singleton, flyweight is something else entirely. It's also comparing apples and oranges. IoC Containers are an entire framework that utilizes multiple patterns. the inner workings of an IoC may utilize flyweight, but that is agnostic about how the IoC is consumed by the application itself. From the calling codes point of view an IoC container acts as a registry or factory.</description><link>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment2</link><guid>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment2</guid><pubDate>Wed, 14 Nov 2012 13:11:42 GMT</pubDate></item><item><title>Mark Seemann commented on Design patterns in the test of time: Flyweight</title><description>Another example of flyweight is the Singleton lifestyle that many DI Containers (e.g. Castle Windsor) offer.</description><link>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment1</link><guid>http://ayende.com/159713/design-patterns-in-the-test-of-time-flyweight#comment1</guid><pubDate>Wed, 14 Nov 2012 11:44:57 GMT</pubDate></item></channel></rss>