﻿<?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>Helen commented on Design patterns in the test of time: Command</title><description>Is the way you've designed RhinoETL an implementation of the command pattern? </description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment13</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment13</guid><pubDate>Sun, 23 Dec 2012 07:42:57 GMT</pubDate></item><item><title>Yan Cui commented on Design patterns in the test of time: Command</title><description>Hey Ayende, you really should spend some time with F# if you haven't already. With first class functions, it's a much more natural way to represent and encapsulate units of computation, you can even compose/chain them together to build up more complex computations (such as the combinator-based family of parsers).

I think you'll really like it! :-)</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment12</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment12</guid><pubDate>Sat, 24 Nov 2012 23:49:06 GMT</pubDate></item><item><title>Ayende Rahien commented on Design patterns in the test of time: Command</title><description>Anonymous,
Lambdas are commands, yes. But in many cases I find it useful to wrap them in a real class, because it make it explicit how / why we capture the parameters for the command to execute.</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment11</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment11</guid><pubDate>Wed, 21 Nov 2012 06:22:47 GMT</pubDate></item><item><title>mcse3010 commented on Design patterns in the test of time: Command</title><description>Don't forget the ever popular MacroCommand where you wrap a series of commands into another command that you can then execute / unexecute as a batch... super useful, indeed.</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment10</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment10</guid><pubDate>Tue, 20 Nov 2012 17:45:04 GMT</pubDate></item><item><title>StarTrekRedneck commented on Design patterns in the test of time: Command</title><description>I completely agree. I see that very frequently the business object of importance is a process, e.g. NotifyShipping, SaveProfile, etc. And, I like how "object-izing" a process is a straight-forward modeling of what computers do: input, *processing*, output, (storage).

I like what Anonymous had to say about using delegates, although I haven't found wrapping up an external dependency in an interface to be as significant an annoyance for me. I played around with constructor-based dependency injection with delegates as declared dependencies, and I liked that a method didn't have to be tied to the delegate definition, unlike a defined interface. I used StructureMap to inject dependencies on delegates, which worked great, but part of me felt like it wasn't cohesive enough. I guess I haven't completely resolved how I feel about it yet or when and when not to do it.</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment9</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment9</guid><pubDate>Tue, 20 Nov 2012 15:06:02 GMT</pubDate></item><item><title>Anonymous commented on Design patterns in the test of time: Command</title><description>Do you consider using lambda functions and delegates as an instance of the Command pattern? If you do, then yes, I also use them heavily. They are particularly interesting because you can achieve the same as implementing a interface but not committing to a particular one at compile time. 

This is particularly useful when you can not assume a common interface for your objects (such as when they come from a third party library), and implementing several facades would be too much hassle for little benefit. Instead, you can map object methods to delegates on site and have your algorithm control the third-party objects without an explicitly interface definition.</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment8</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment8</guid><pubDate>Tue, 20 Nov 2012 14:41:09 GMT</pubDate></item><item><title>Anonymous Coward commented on Design patterns in the test of time: Command</title><description>I'd say let's not exaggerate. Command is extremely useful when you need to generate commands in one place and run them in another. It's also the only decent way I'm aware of to properly implement unlimited undo. But there are situations in which not using command yields smaller and simpler code, which wouldn't have significant benefits if using command.
</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment7</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment7</guid><pubDate>Tue, 20 Nov 2012 14:34:20 GMT</pubDate></item><item><title>Eran Stiller commented on Design patterns in the test of time: Command</title><description>Ayende - while I do agree with you that the Command pattern is very useful in the various cases you specified, I see it get abused too many times (sometimes really using it as an anti-pattern). For example, I've seen many architects design entire interfaces around the Command pattern (defining a single method which accepts a command derived object), resulting in a very generic definition and implementation - where more specifics would have greatly simplified the code and its maintainability over time.</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment6</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment6</guid><pubDate>Tue, 20 Nov 2012 14:19:27 GMT</pubDate></item><item><title>tobi commented on Design patterns in the test of time: Command</title><description>Also nice for dependency injection.</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment5</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment5</guid><pubDate>Tue, 20 Nov 2012 13:28:45 GMT</pubDate></item><item><title>Martin Doms commented on Design patterns in the test of time: Command</title><description>A nice extension of Command is CompoundCommand (or CompositeCommand, or whatever). A single command that contains an ordered list of commands. Iterate through your commands and call Execute(). Iterate backwards and call Undo(). A nice, single object responsible for a large piece of work, but still following the single responsibility principal by delegating actual meaningful work onto more granular commands.</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment4</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment4</guid><pubDate>Mon, 19 Nov 2012 20:22:24 GMT</pubDate></item><item><title>Khalid Abuhakmeh commented on Design patterns in the test of time: Command</title><description>Only when I started looking at how you used this pattern in RacoonBlog did I really get why it was so useful to me as a C# .Net developer.

The ability to unit test tasks themselves and then just confirm there existence in other places (MVC Controller) was amazing. Really helped me focus and write meaningful unit tests.

Jimmy Bogard at CodeBetter even goes as far as to turn the command pattern into a Query pattern. He encapsulates complex queries into a class that returns a dataset. </description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment3</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment3</guid><pubDate>Mon, 19 Nov 2012 13:47:05 GMT</pubDate></item><item><title>Calvin commented on Design patterns in the test of time: Command</title><description>As well as undo\redo support we've had great success combining the command pattern with the visitor pattern.  You have a selection of items and a single command which visits each item in the selection performing the action.

If each visit pushes its undo state on to a stack up can easily undo the operation again.</description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment2</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment2</guid><pubDate>Mon, 19 Nov 2012 12:52:46 GMT</pubDate></item><item><title>Frans Bouma commented on Design patterns in the test of time: Command</title><description>Added to that: you can extend commands to implement undo/redo easily, by adding a state and an 'undo' action next to the actual do action. Shameless plug: I implemented this in Algorithmia (OSS, bsd license), where I added a command implementation, which is able to undo actions by the command, and various data structures which are command aware (and thus undo aware) like graphs and lists: http://algorithmia.codeplex.com </description><link>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment1</link><guid>http://ayende.com/159873/design-patterns-in-the-test-of-time-command#comment1</guid><pubDate>Mon, 19 Nov 2012 10:20:19 GMT</pubDate></item></channel></rss>