<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Mind-driven development</title>
	<atom:link href="http://www.minddriven.de/index.php/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://www.minddriven.de</link>
	<description>Matthias Jauernig -- .NET technology, architecture and design</description>
	<lastBuildDate>Wed, 01 Sep 2010 07:39:40 +0200</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>Comment on Some thoughts on Event-Based Components by Ralf Westphal</title>
		<link>http://www.minddriven.de/index.php/technology/development/event-based-components/comment-page-1#comment-6286</link>
		<dc:creator>Ralf Westphal</dc:creator>
		<pubDate>Wed, 01 Sep 2010 07:39:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=886#comment-6286</guid>
		<description>Thx, Matthias, for your review of EBC. I mostly concurr with your opinion. In a couple points I beg to differ, though:

Interfaces as formal contracts are not missing from EBC. Right to the contrary! You can still define the offerings of an EBC component like your DataAccessComponent using an interface. And that´s even better than with IBC. Because in order to specify an IBC completely (like your BusinessClient) you´d need to list all exported interfaces as well as all imported interfaces. In your case that would be IBusinessClient + IDataAccessComponent.

In the EBC world the specification of the BusinessClient component would be just IBusinessClient.

I deem this an advantage over IBC. Specifications are more compact.

You´re right in that the current bindings are a bit cumbersome. EBC surely would benefit from generating them from some DSL.

However I find in my daily EBC practise that this drawback is only minimal compared to what is gained from EBC.

a) EBC &quot;require&quot; you to clearly separate domain functionality from code that just composes such functionality. It is a very helpful separation of concerns.

b) The difficult to read binding code usually is not very long. Due to the ease with which you can design on different levels of abstractions (compared to IBC) EBC boards are kept quite small.
In addition it is recommended to keep the design sketches with your code. They are a &quot;poor mans DSL&quot; until there is a designer tool. If you do that look at them to understand your software, not the wiring code in the boards. It´s a common mistake to stay glued to the code instead of using diagrams. With UML I understand why people do that; diagrams and code quickly get out of sync because it´s hard to translate from diagram into code. But that´s different with EBC. The translation is trivial. Thus the code is in sync with the diagram. And changes should flow from the diagram/design to the code.

So EBC fosters a less ad hoc, less cowboy programmer way of software development. Look at the cumbersome wiring code as a feature instead of a bug ;-) It´s a constant reminder to program in a clean way. Yes, that takes some getting used to it... but my experience is that´s worthwhile.

c) Although the wiring code is kinda hard to read it in fact is simple. It´s so regular... Once you develop an eye for it, it´s not that hard to comprehend anymore. I deem this simplicity very important. It makes software more predictable in its form. And that helps evolving it.

d) EBC very explicitly deal with dependencies. The only dependencies left are concentrated in board. And these board don´t have any domain functionality on them. So highly dependent code is simple. And complicated code is independent. That´s in accordance with all good principles of software development. Dependencies are the developers bane -  penning them up in a few places thus is a great help.

Finally one word about topological dependencies as I termed them: They make IBC dependent on how functionality is grouped. If component C needs functions f() and g() it´s dependent on them. Maybe that cannot be avoided. But why in all the world should C also be dependent on f() and g() being lumped together on an interface?

As long as that´s the case C has two reasons to change (which is against the SRP): it needs to change if new domain requirements come up regarding its domain responsibility; and it needs to change if f() and g() are rearranged onto different interfaces for whatever reason. That´s bad.

-Ralf

PS: I suggest all interested in EBC to have a look at EBC 2.0. It´s a whole different view on how to carve out components from requirements. And the beauty of it: the nasty request/response communication simply goes away... :-)

PPS: Just for the record: I´m not advovating giving up IBC altogether! Even EBC rely on them for defining EBC boards. But also beyond that IBC are of value. Don´t try to throw them away. They can be of great use within EBC parts/actions (atomic EBC components).</description>
		<content:encoded><![CDATA[<p>Thx, Matthias, for your review of EBC. I mostly concurr with your opinion. In a couple points I beg to differ, though:</p>
<p>Interfaces as formal contracts are not missing from EBC. Right to the contrary! You can still define the offerings of an EBC component like your DataAccessComponent using an interface. And that´s even better than with IBC. Because in order to specify an IBC completely (like your BusinessClient) you´d need to list all exported interfaces as well as all imported interfaces. In your case that would be IBusinessClient + IDataAccessComponent.</p>
<p>In the EBC world the specification of the BusinessClient component would be just IBusinessClient.</p>
<p>I deem this an advantage over IBC. Specifications are more compact.</p>
<p>You´re right in that the current bindings are a bit cumbersome. EBC surely would benefit from generating them from some DSL.</p>
<p>However I find in my daily EBC practise that this drawback is only minimal compared to what is gained from EBC.</p>
<p>a) EBC &#8220;require&#8221; you to clearly separate domain functionality from code that just composes such functionality. It is a very helpful separation of concerns.</p>
<p>b) The difficult to read binding code usually is not very long. Due to the ease with which you can design on different levels of abstractions (compared to IBC) EBC boards are kept quite small.<br />
In addition it is recommended to keep the design sketches with your code. They are a &#8220;poor mans DSL&#8221; until there is a designer tool. If you do that look at them to understand your software, not the wiring code in the boards. It´s a common mistake to stay glued to the code instead of using diagrams. With UML I understand why people do that; diagrams and code quickly get out of sync because it´s hard to translate from diagram into code. But that´s different with EBC. The translation is trivial. Thus the code is in sync with the diagram. And changes should flow from the diagram/design to the code.</p>
<p>So EBC fosters a less ad hoc, less cowboy programmer way of software development. Look at the cumbersome wiring code as a feature instead of a bug <img src='http://www.minddriven.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  It´s a constant reminder to program in a clean way. Yes, that takes some getting used to it&#8230; but my experience is that´s worthwhile.</p>
<p>c) Although the wiring code is kinda hard to read it in fact is simple. It´s so regular&#8230; Once you develop an eye for it, it´s not that hard to comprehend anymore. I deem this simplicity very important. It makes software more predictable in its form. And that helps evolving it.</p>
<p>d) EBC very explicitly deal with dependencies. The only dependencies left are concentrated in board. And these board don´t have any domain functionality on them. So highly dependent code is simple. And complicated code is independent. That´s in accordance with all good principles of software development. Dependencies are the developers bane &#8211;  penning them up in a few places thus is a great help.</p>
<p>Finally one word about topological dependencies as I termed them: They make IBC dependent on how functionality is grouped. If component C needs functions f() and g() it´s dependent on them. Maybe that cannot be avoided. But why in all the world should C also be dependent on f() and g() being lumped together on an interface?</p>
<p>As long as that´s the case C has two reasons to change (which is against the SRP): it needs to change if new domain requirements come up regarding its domain responsibility; and it needs to change if f() and g() are rearranged onto different interfaces for whatever reason. That´s bad.</p>
<p>-Ralf</p>
<p>PS: I suggest all interested in EBC to have a look at EBC 2.0. It´s a whole different view on how to carve out components from requirements. And the beauty of it: the nasty request/response communication simply goes away&#8230; <img src='http://www.minddriven.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>PPS: Just for the record: I´m not advovating giving up IBC altogether! Even EBC rely on them for defining EBC boards. But also beyond that IBC are of value. Don´t try to throw them away. They can be of great use within EBC parts/actions (atomic EBC components).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple message-based Event Aggregator/Broker by Gope</title>
		<link>http://www.minddriven.de/index.php/technology/development/design-patterns/event-broker-implementation/comment-page-1#comment-6285</link>
		<dc:creator>Gope</dc:creator>
		<pubDate>Wed, 01 Sep 2010 07:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=1023#comment-6285</guid>
		<description>@DanielT: How would you subscribe then to a specific message like CustomerChangedMessage? Your solution defeats the whole purpose of a Pub/Sub System.

Regards
Gope</description>
		<content:encoded><![CDATA[<p>@DanielT: How would you subscribe then to a specific message like CustomerChangedMessage? Your solution defeats the whole purpose of a Pub/Sub System.</p>
<p>Regards<br />
Gope</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple message-based Event Aggregator/Broker by DanielT</title>
		<link>http://www.minddriven.de/index.php/technology/development/design-patterns/event-broker-implementation/comment-page-1#comment-6283</link>
		<dc:creator>DanielT</dc:creator>
		<pubDate>Mon, 30 Aug 2010 13:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=1023#comment-6283</guid>
		<description>I don&#039;t understand why you want to make all Message-Types implement IMessage. It&#039;s not necessary.

If I just delete all the &quot;where TMessage : IMessage&quot; statements, everything works just as well, but now I can do things like

            var broker = new EventBroker();

            using (var subscription = broker.Subscribe(s =&gt; Console.WriteLine(s)))
            {
                broker.Publish(&quot;Hello!&quot;);
                broker.Publish(&quot;World!&quot;);
            }

            broker.Publish(&quot;just kidding...&quot;);</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand why you want to make all Message-Types implement IMessage. It&#8217;s not necessary.</p>
<p>If I just delete all the &#8220;where TMessage : IMessage&#8221; statements, everything works just as well, but now I can do things like</p>
<p>            var broker = new EventBroker();</p>
<p>            using (var subscription = broker.Subscribe(s =&gt; Console.WriteLine(s)))<br />
            {<br />
                broker.Publish(&#8220;Hello!&#8221;);<br />
                broker.Publish(&#8220;World!&#8221;);<br />
            }</p>
<p>            broker.Publish(&#8220;just kidding&#8230;&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Latch me if you can! by MatthiasJ</title>
		<link>http://www.minddriven.de/index.php/technology/development/design-patterns/latch-design-pattern/comment-page-1#comment-6278</link>
		<dc:creator>MatthiasJ</dc:creator>
		<pubDate>Fri, 27 Aug 2010 15:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=968#comment-6278</guid>
		<description>Nice to see people doing some re-engineering on this.

Currently I&#039;m not sure if I would like this (while I like Rx). Can you show a concrete example of the usage?</description>
		<content:encoded><![CDATA[<p>Nice to see people doing some re-engineering on this.</p>
<p>Currently I&#8217;m not sure if I would like this (while I like Rx). Can you show a concrete example of the usage?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Latch me if you can! by James</title>
		<link>http://www.minddriven.de/index.php/technology/development/design-patterns/latch-design-pattern/comment-page-1#comment-6277</link>
		<dc:creator>James</dc:creator>
		<pubDate>Fri, 27 Aug 2010 10:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=968#comment-6277</guid>
		<description>This can be done quite neatly in Rx

http://enumeratethis.com/2010/08/27/latch-design-pattern-in-rx/</description>
		<content:encoded><![CDATA[<p>This can be done quite neatly in Rx</p>
<p><a href="http://enumeratethis.com/2010/08/27/latch-design-pattern-in-rx/" rel="nofollow">http://enumeratethis.com/2010/08/27/latch-design-pattern-in-rx/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Some thoughts on Event-Based Components by Johannes</title>
		<link>http://www.minddriven.de/index.php/technology/development/event-based-components/comment-page-1#comment-6267</link>
		<dc:creator>Johannes</dc:creator>
		<pubDate>Mon, 23 Aug 2010 18:51:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=886#comment-6267</guid>
		<description>In fact, Ralf is currently working on a &quot;DI container&quot; for EBCs: http://ebcbinder.codeplex.com/

I totally agree to the lag of overview:
We are using the image of electronic circuits, which includes the components (== classes), the output-pins (== events) and the input-pins (== methods). The solder would be the EBC binder.

But we are still missing a circuit board! It would give us an overview of the connected (or faulty connected) pins. I’m thinking of a designer like the one for the Windows Workflow foundation... This could be the missed tool.

I’m going to watch the progress of EBC. Let’s see if it can join the club of the standard design patterns.</description>
		<content:encoded><![CDATA[<p>In fact, Ralf is currently working on a &#8220;DI container&#8221; for EBCs: <a href="http://ebcbinder.codeplex.com/" rel="nofollow">http://ebcbinder.codeplex.com/</a></p>
<p>I totally agree to the lag of overview:<br />
We are using the image of electronic circuits, which includes the components (== classes), the output-pins (== events) and the input-pins (== methods). The solder would be the EBC binder.</p>
<p>But we are still missing a circuit board! It would give us an overview of the connected (or faulty connected) pins. I’m thinking of a designer like the one for the Windows Workflow foundation&#8230; This could be the missed tool.</p>
<p>I’m going to watch the progress of EBC. Let’s see if it can join the club of the standard design patterns.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Property Memento pattern by MatthiasJ</title>
		<link>http://www.minddriven.de/index.php/technology/development/design-patterns/property-memento-pattern/comment-page-1#comment-6253</link>
		<dc:creator>MatthiasJ</dc:creator>
		<pubDate>Sun, 15 Aug 2010 15:25:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=975#comment-6253</guid>
		<description>Hi there,

Thanks for your comments.

@AJ: thanks for clarification. Now I&#039;m searching for a new name... Any suggestions? ;-)

@James: thanks for your alternative implementation. But I still prefer the initial code. The get/set of the property value is a responsibility of the PropertyMemento class, so I prefer not to provide these actions from the outside. 

Another thing I&#039;m currently not really happy with is the implicit nature of the using() syntax. It&#039;s not very intention revealing. I think I will make another blog post on this during the next week.

Again, thanks for your input!</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>Thanks for your comments.</p>
<p>@AJ: thanks for clarification. Now I&#8217;m searching for a new name&#8230; Any suggestions? <img src='http://www.minddriven.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>@James: thanks for your alternative implementation. But I still prefer the initial code. The get/set of the property value is a responsibility of the PropertyMemento class, so I prefer not to provide these actions from the outside. </p>
<p>Another thing I&#8217;m currently not really happy with is the implicit nature of the using() syntax. It&#8217;s not very intention revealing. I think I will make another blog post on this during the next week.</p>
<p>Again, thanks for your input!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Property Memento pattern by James Curran</title>
		<link>http://www.minddriven.de/index.php/technology/development/design-patterns/property-memento-pattern/comment-page-1#comment-6250</link>
		<dc:creator>James Curran</dc:creator>
		<pubDate>Wed, 11 Aug 2010 18:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=975#comment-6250</guid>
		<description>Let&#039;s try, for the moment, changing the definition of GetAutoSizeMemento to this:

 private PropertyMemento GetAutoSizeMemento(  
     Control control, bool tempValue)  
 {  
     return new PropertyMemento(  
         control, 
         () =&gt; control.AutoSize, 
         value =&gt; control.AutoSize = value,
         tempValue);  
 } 

Then we can reduce the definition of PropertyMemento to just this:

public class PropertyMemento : IDisposable  
            where TClass : class 
{  
    private readonly TProperty _originalPropertyValue;  
    private readonly TClass _classInstance;
    private readonly Func _propertyGetter;
    private readonly Action _propertySetter;

public PropertyMemento(TClass classInstance, 
                       Func propertyGetter,
                       Action propertySetter)  
{  
     _classInstance = classInstance;
     _propertyGetter = propertyGetter;
     _propertySetter = propertySetter;
     _originalPropertyValue = _propertyGetter(); 
 }  

 public PropertyMemento(TClass memberObject,
     Func propertyGetter,
     Action propertySetter,
     TProperty tempValue)
    : this(memberObject, propertyGetter, propertySetter)  
 {  
     _propertySetter(tempValue);  
 }  

 public void Dispose()  
 {
     _propertySetter(_originalPropertyValue);  
 }  
} 

and complete elininate the need for ReflectionHelper  (and reflection in general)</description>
		<content:encoded><![CDATA[<p>Let&#8217;s try, for the moment, changing the definition of GetAutoSizeMemento to this:</p>
<p> private PropertyMemento GetAutoSizeMemento(<br />
     Control control, bool tempValue)<br />
 {<br />
     return new PropertyMemento(<br />
         control,<br />
         () =&gt; control.AutoSize,<br />
         value =&gt; control.AutoSize = value,<br />
         tempValue);<br />
 } </p>
<p>Then we can reduce the definition of PropertyMemento to just this:</p>
<p>public class PropertyMemento : IDisposable<br />
            where TClass : class<br />
{<br />
    private readonly TProperty _originalPropertyValue;<br />
    private readonly TClass _classInstance;<br />
    private readonly Func _propertyGetter;<br />
    private readonly Action _propertySetter;</p>
<p>public PropertyMemento(TClass classInstance,<br />
                       Func propertyGetter,<br />
                       Action propertySetter)<br />
{<br />
     _classInstance = classInstance;<br />
     _propertyGetter = propertyGetter;<br />
     _propertySetter = propertySetter;<br />
     _originalPropertyValue = _propertyGetter();<br />
 }  </p>
<p> public PropertyMemento(TClass memberObject,<br />
     Func propertyGetter,<br />
     Action propertySetter,<br />
     TProperty tempValue)<br />
    : this(memberObject, propertyGetter, propertySetter)<br />
 {<br />
     _propertySetter(tempValue);<br />
 }  </p>
<p> public void Dispose()<br />
 {<br />
     _propertySetter(_originalPropertyValue);<br />
 }<br />
} </p>
<p>and complete elininate the need for ReflectionHelper  (and reflection in general)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Property Memento pattern by AJ.NET</title>
		<link>http://www.minddriven.de/index.php/technology/development/design-patterns/property-memento-pattern/comment-page-1#comment-6249</link>
		<dc:creator>AJ.NET</dc:creator>
		<pubDate>Wed, 11 Aug 2010 14:43:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=975#comment-6249</guid>
		<description>The idea to capture some property values to restore them at a later point comes in handy in certain use cases. I&#039;d prefer to set the temporary values within the code block rather than in GetXyMemento(), but that&#039;s a matter of taste. Anyway, nice work.


I do have my doubts about the justification of calling this a &quot;property memento&quot;, though. Your citation of the Memento pattern cuts a little short (and wikipedia even got the definition of &quot;opaque&quot; wrong :-( ); the GoF-Definition is somewhat better:

&quot;Intent: Without violating encapsulation, capture and externalize an object&#039;s internal state so that the object can be restored to this state later.&quot; 
http://www.c2.com/cgi/wiki?MementoPattern

My concern is that the Memento pattern clearly favors a black box approach for the object. Saving and restoring some property values on the other hand is equaly clearly a white box approach, as you need to be aware of any side effects between save and restore. And the value of a property is _not_ akin to the state of an object. It provides merely a representation (glimps, reflection, if you like) of a certain aspect of the internal state of the surrounding object. 

Very theoretical mussings, I know. But that&#039;s what you asked for ;-)

Again: I won&#039;t disqualify your approach per se, it&#039;s probably even more simple and efficient than a true Memento. I just wouldn&#039;t call it &quot;Memento&quot;.</description>
		<content:encoded><![CDATA[<p>The idea to capture some property values to restore them at a later point comes in handy in certain use cases. I&#8217;d prefer to set the temporary values within the code block rather than in GetXyMemento(), but that&#8217;s a matter of taste. Anyway, nice work.</p>
<p>I do have my doubts about the justification of calling this a &#8220;property memento&#8221;, though. Your citation of the Memento pattern cuts a little short (and wikipedia even got the definition of &#8220;opaque&#8221; wrong <img src='http://www.minddriven.de/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  ); the GoF-Definition is somewhat better:</p>
<p>&#8220;Intent: Without violating encapsulation, capture and externalize an object&#8217;s internal state so that the object can be restored to this state later.&#8221;<br />
<a href="http://www.c2.com/cgi/wiki?MementoPattern" rel="nofollow">http://www.c2.com/cgi/wiki?MementoPattern</a></p>
<p>My concern is that the Memento pattern clearly favors a black box approach for the object. Saving and restoring some property values on the other hand is equaly clearly a white box approach, as you need to be aware of any side effects between save and restore. And the value of a property is _not_ akin to the state of an object. It provides merely a representation (glimps, reflection, if you like) of a certain aspect of the internal state of the surrounding object. </p>
<p>Very theoretical mussings, I know. But that&#8217;s what you asked for <img src='http://www.minddriven.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Again: I won&#8217;t disqualify your approach per se, it&#8217;s probably even more simple and efficient than a true Memento. I just wouldn&#8217;t call it &#8220;Memento&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Latch me if you can! by MatthiasJ</title>
		<link>http://www.minddriven.de/index.php/technology/development/design-patterns/latch-design-pattern/comment-page-1#comment-6209</link>
		<dc:creator>MatthiasJ</dc:creator>
		<pubDate>Thu, 05 Aug 2010 08:02:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.minddriven.de/?p=968#comment-6209</guid>
		<description>Thanks for the hint. I&#039;ve edited my post and code accordingly.
Cheers, Matthias</description>
		<content:encoded><![CDATA[<p>Thanks for the hint. I&#8217;ve edited my post and code accordingly.<br />
Cheers, Matthias</p>
]]></content:encoded>
	</item>
</channel>
</rss>
