<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4886862742658249219</id><updated>2011-04-21T12:19:31.266-07:00</updated><category term='Design Pattern'/><category term='Test Driven Design'/><category term='MVP'/><category term='Reflection C#'/><category term='Presenter First'/><category term='TDD'/><category term='Event Sourcing'/><category term='DSL'/><category term='GUI'/><category term='Martin Fowler'/><title type='text'>GutZofter Development</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-6241015749255135803</id><published>2007-09-01T05:55:00.001-07:00</published><updated>2007-09-01T17:29:58.088-07:00</updated><title type='text'>Running Tests</title><content type='html'>When separating your unit tests into their own directory you have to do something like this, when you want to run all your tests from the eclipse plug-in RDT:

class TestRequireFinder
 def _load(file_name)
  require File.expand_path(File.dirname(__FILE__)) +'/' + file_name
 end
end

test = TestRequireFinder.new&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-6241015749255135803?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/6241015749255135803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=6241015749255135803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/6241015749255135803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/6241015749255135803'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/09/running-tests.html' title='Running Tests'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-1928888549960531187</id><published>2007-06-11T12:17:00.000-07:00</published><updated>2007-06-11T12:18:24.127-07:00</updated><title type='text'>Nerdification</title><content type='html'>I had to do this. Nothing Better to do.

&lt;a href="http://www.nerdtests.com/nq_ref.html"&gt;
&lt;img src="http://www.nerdtests.com/images/badge/6604d40e4c0c621a.gif" alt="I am nerdier than 81% of all people. Are you a nerd? Click here to find out!"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-1928888549960531187?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/1928888549960531187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=1928888549960531187' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/1928888549960531187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/1928888549960531187'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/06/nerdification.html' title='Nerdification'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-991604967661359026</id><published>2007-05-30T14:02:00.000-07:00</published><updated>2007-05-30T14:15:45.120-07:00</updated><title type='text'>Imposing Design (was Re: [TDD] Re: Wandering through layers of software)</title><content type='html'>[snipstart]

--- In testdrivendevelopment@yahoogroups.com, "Kelly Anderson" &amp;lt;kellycoinguy@...&amp;gt; wrote:
&amp;gt;
&amp;gt; My TDD code throws more exceptions generally... so I'd really like to
&amp;gt; hear more about your thoughts on this subject.
&amp;gt;

[snipend]

Using the example as shown in: What is Exceptional? [126], The Pragmatic Programmer (converted from java to C#).&lt;div face="Courier New" size="10pt" color="black" style=""&gt;&lt;div face="Courier New" size="10pt" color="black" style=""&gt;&lt;p&gt;        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="teal"&gt;TextReader&lt;/font&gt; ipstream;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; open_passwd()
        {
            &lt;font color="blue"&gt;try&lt;/font&gt;
            {
                ipstream = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;StreamReader&lt;/font&gt;(&lt;font color="maroon"&gt;@"..\etc\passwd"&lt;/font&gt;);
            }
            &lt;font color="blue"&gt;catch&lt;/font&gt;(&lt;font color="teal"&gt;Exception&lt;/font&gt;)
            {
                &lt;font color="blue"&gt;throw&lt;/font&gt; &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;FileNotFoundException&lt;/font&gt;(&lt;font color="maroon"&gt;"No Password File Found"&lt;/font&gt;);
            }
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;bool&lt;/font&gt; open_user_file(&lt;font color="blue"&gt;string&lt;/font&gt; fname)
        {
            &lt;font color="blue"&gt;if&lt;/font&gt; (!&lt;font color="teal"&gt;File&lt;/font&gt;.Exists(fname))
                &lt;font color="blue"&gt;return&lt;/font&gt; &lt;font color="blue"&gt;false&lt;/font&gt;; &lt;/p&gt;&lt;p&gt;            ipstream = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;StreamReader&lt;/font&gt;(fname);&lt;/p&gt;&lt;p&gt;            &lt;font color="blue"&gt;return&lt;/font&gt; &lt;font color="blue"&gt;true&lt;/font&gt;;
        }&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div face="Courier New" size="10pt" color="black" style=""&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; OpenUserFile(&lt;font color="blue"&gt;string&lt;/font&gt; fname)
        {
            &lt;font color="blue"&gt;if&lt;/font&gt; (!&lt;font color="teal"&gt;File&lt;/font&gt;.Exists(fname))
            {
                Fire_FileDoesNotExistEvent();
                &lt;font color="blue"&gt;return&lt;/font&gt;;
            } &lt;/p&gt;&lt;p&gt;            ipstream = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;StreamReader&lt;/font&gt;(fname);
        } &lt;/p&gt;&lt;/div&gt;&lt;p&gt;The method open_passwd has a dependency on &lt;font color="maroon"&gt;passwd &lt;/font&gt;file. The second method is not dependent on a specific file. (In my opinion both methods are ripe to be refactored). Would you have written either of these methods with TDD/Refactoring. The point is that because of that dependency on the first method it has to have some way to communicate to the client that the part of the contract it is responsible for cannot be fulfilled. Also I am not saying that when you write code you shouldn't ever throw an exception.
&lt;/p&gt;&lt;p&gt;As far as I have been able to determine there are only three standard ways objects can communicate in an OOP methodology.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Exception Message (first method)&lt;/li&gt;&lt;li&gt;Command Message (second method).&lt;/li&gt;&lt;li&gt;Event Message (third method).&lt;/li&gt;&lt;/ol&gt;It is the third communication channel that for me is showing a lot of promise. It is the publish/subscribe pattern. The first two message type are hierarchical in nature, in other words you need the client to control those methods. While the third is collaborative. The method fires the event and forgets. The method does not care that a file does not exist. AND the client that called the third method does not have to be the one to handle the event message.

When I first started on these groups I asked a question concerning an example Michael Feather's had concerning writing unit tests (A stack object). Ron Jeffries and others were kind enough to help me through the example, but one of the things that didn't sit well with me was that in explaining it to me Ron didn't bother with using the exception handling (Exception Message) he instead used the 'Command Message' (Query on state {IsEmpty})and then if IsEmpty == true then don't pop from stack.

Now I want  to create a contrived example. let us say we have a form with a button that when we click it it will use one of our (3) methods. Also if no file is found it will need to shutdown the system (Crash, Don't Trash [120], The Pragmatic Programmer)

Now if you look in LoadFileForm class. Which of the click methods would you like to use? There is a lot of associated machinery that you have to add, every time you use the first two messages types. The first two message types create these dependencies for handling exceptions. The client really only is responsible for opening text files. Not handling errors.

If you look at the unit tests you can see I was able to remove the SystemShutDown object from the constructor when using event messages. Also I was able to Subscribe a private method that also verified that the event was actually fired. In a normal application I really would have followed the Presenter First pattern. The final component then would have two presenters. These would wire up the form to the TextFileOpener and the TextFileOpener to SystemShutDown object. Because the Presenters are mappers. these three objects can change without affecting each other, because they initiate communication with each other via event messages. And anybody can subscribe to these events.

I am not saying this type of programming &lt;a href="http://www.martinfowler.com/eaaDev/EventCollaboration.html"&gt;Event Collaboration&lt;/a&gt; is a 'Silver Bullet'. But it is more along the lines of BDD. Other objects processing because of some other objects behavior. 

&lt;div style="font-family: Courier New; font-size: 10pt; color: black;"&gt;&lt;p&gt;&lt;font color="blue"&gt;using&lt;/font&gt; System;
&lt;font color="blue"&gt;using&lt;/font&gt; System.IO;
&lt;font color="blue"&gt;using&lt;/font&gt; NUnit.Framework; &lt;/p&gt;&lt;p&gt;&lt;font color="blue"&gt;namespace&lt;/font&gt; UnitTestAlarmSystem
{
    [&lt;font color="teal"&gt;TestFixture&lt;/font&gt;]
    &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;class&lt;/font&gt; &lt;font color="teal"&gt;Test_FileOpener_NoExceptions&lt;/font&gt;
    {
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="blue"&gt;const&lt;/font&gt; &lt;font color="blue"&gt;string&lt;/font&gt; FILE_NAME = &lt;font color="maroon"&gt;"Tester"&lt;/font&gt;;
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="teal"&gt;TextFileOpener&lt;/font&gt; textFileOpener;
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="teal"&gt;ShutDownSystem&lt;/font&gt; shutDownSystem;
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="blue"&gt;bool&lt;/font&gt; isNoFile; &lt;/p&gt;&lt;p&gt;        [&lt;font color="teal"&gt;TestFixtureSetUp&lt;/font&gt;]
        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; TestFixtureSetUp()
        {
            textFileOpener = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;TextFileOpener&lt;/font&gt;();
            shutDownSystem = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;ShutDownSystem&lt;/font&gt;();
        } &lt;/p&gt;&lt;p&gt;        [&lt;font color="teal"&gt;TestFixtureTearDown&lt;/font&gt;]
        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; TestFixtureTearDown()
        {
            shutDownSystem = &lt;font color="blue"&gt;null&lt;/font&gt;;
            textFileOpener = &lt;font color="blue"&gt;null&lt;/font&gt;;
        } &lt;/p&gt;&lt;p&gt;        [&lt;font color="teal"&gt;Test&lt;/font&gt;]
        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; TestExceptionMessagesNoFile()
        {
            &lt;font color="teal"&gt;LoadFileForm&lt;/font&gt; form = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;LoadFileForm&lt;/font&gt;(textFileOpener, shutDownSystem);
            form.ButtonClickException();
            &lt;font color="teal"&gt;Assert&lt;/font&gt;.IsTrue(form.IsException);
        } &lt;/p&gt;&lt;p&gt;        [&lt;font color="teal"&gt;Test&lt;/font&gt;]
        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; TestCommandMessageNoFile()
        {
            &lt;font color="teal"&gt;LoadFileForm&lt;/font&gt; form = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;LoadFileForm&lt;/font&gt;(textFileOpener, shutDownSystem);
            form.SetFileName(FILE_NAME);
            form.ButtonClickCommand();
            &lt;font color="teal"&gt;Assert&lt;/font&gt;.IsTrue(form.IsCommand);
        } &lt;/p&gt;&lt;p&gt;        [&lt;font color="teal"&gt;Test&lt;/font&gt;]
        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; TestEventMessageNoFile()
        {
            isNoFile = &lt;font color="blue"&gt;false&lt;/font&gt;;
            textFileOpener.WhenLoadFile += &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;EventHandler&lt;/font&gt;(shutDownSystem.WhenNoFileHandler);
            textFileOpener.WhenLoadFile += &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;EventHandler&lt;/font&gt;(WhenNoFileHandler); &lt;/p&gt;&lt;p&gt;            &lt;font color="teal"&gt;LoadFileForm&lt;/font&gt; form = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;LoadFileForm&lt;/font&gt;(textFileOpener);
            form.SetFileName(FILE_NAME);
            form.ButtonClickEvent();
            &lt;font color="teal"&gt;Assert&lt;/font&gt;.IsTrue(isNoFile);
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; WhenNoFileHandler(&lt;font color="blue"&gt;object&lt;/font&gt; sender, &lt;font color="teal"&gt;EventArgs&lt;/font&gt; e)
        {
            isNoFile = &lt;font color="blue"&gt;true&lt;/font&gt;;
        }
    } &lt;/p&gt;&lt;p&gt;    &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;class&lt;/font&gt; &lt;font color="teal"&gt;LoadFileForm&lt;/font&gt;
    {
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="teal"&gt;TextFileOpener&lt;/font&gt; textFileOpener;
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="teal"&gt;ShutDownSystem&lt;/font&gt; shutDownSystem;
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="blue"&gt;string&lt;/font&gt; mFileName;
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="blue"&gt;bool&lt;/font&gt; isCommand = &lt;font color="blue"&gt;false&lt;/font&gt;;
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="blue"&gt;bool&lt;/font&gt; isException = &lt;font color="blue"&gt;false&lt;/font&gt;; &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; LoadFileForm(&lt;font color="teal"&gt;TextFileOpener&lt;/font&gt; opener, &lt;font color="teal"&gt;ShutDownSystem&lt;/font&gt; shutDown)
        {
            textFileOpener = opener;
            shutDownSystem = shutDown;
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; LoadFileForm(&lt;font color="teal"&gt;TextFileOpener&lt;/font&gt; opener)
        {
            textFileOpener = opener;
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;bool&lt;/font&gt; IsException
        {
            &lt;font color="blue"&gt;get&lt;/font&gt; { &lt;font color="blue"&gt;return&lt;/font&gt; isException; }
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;bool&lt;/font&gt; IsCommand
        {
            &lt;font color="blue"&gt;get&lt;/font&gt; { &lt;font color="blue"&gt;return&lt;/font&gt; isCommand; }
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; ButtonClickException()
        {
            &lt;font color="blue"&gt;try&lt;/font&gt;
            {
                textFileOpener.open_passwd();
                &lt;font color="green"&gt;//Process file&lt;/font&gt;
            }
            &lt;font color="blue"&gt;catch&lt;/font&gt; (&lt;font color="teal"&gt;Exception&lt;/font&gt; ex)
            {
                isException = &lt;font color="blue"&gt;true&lt;/font&gt;;
                shutDownSystem.SetException(ex.Message); &lt;/p&gt;&lt;p&gt;                shutDownSystem.Execute();
            }
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; ButtonClickCommand()
        {
            &lt;font color="blue"&gt;bool&lt;/font&gt; fileOpenResult = textFileOpener.open_user_file(mFileName); &lt;/p&gt;&lt;p&gt;            &lt;font color="blue"&gt;if&lt;/font&gt; (fileOpenResult)
            {
                &lt;font color="green"&gt;//Process file&lt;/font&gt;
            }
            &lt;font color="blue"&gt;else&lt;/font&gt;
            {
                isCommand = &lt;font color="blue"&gt;true&lt;/font&gt;;
                shutDownSystem.SetException(&lt;font color="maroon"&gt;"No File Found {Command}"&lt;/font&gt;);
                shutDownSystem.Execute();
            }
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; ButtonClickEvent()
        {
            textFileOpener.OpenUserFile(mFileName);
            &lt;font color="green"&gt;//Process file&lt;/font&gt;
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; SetFileName(&lt;font color="blue"&gt;string&lt;/font&gt; file_NAME)
        {
            mFileName = file_NAME;
        }
    } &lt;/p&gt;&lt;p&gt;    &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;class&lt;/font&gt; &lt;font color="teal"&gt;ShutDownSystem&lt;/font&gt;
    {
        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="blue"&gt;string&lt;/font&gt; mException; &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; Execute()
        {
            &lt;font color="teal"&gt;Console&lt;/font&gt;.WriteLine(mException);
            &lt;font color="green"&gt;//Shut Down Logic&lt;/font&gt;
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; WhenNoFileHandler(&lt;font color="blue"&gt;object&lt;/font&gt; sender, &lt;font color="teal"&gt;EventArgs&lt;/font&gt; e)
        {
            &lt;font color="teal"&gt;Console&lt;/font&gt;.WriteLine(&lt;font color="maroon"&gt;"No File Found {Event}"&lt;/font&gt;);
            &lt;font color="green"&gt;//Shut Down Logic&lt;/font&gt;
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; SetException(&lt;font color="blue"&gt;string&lt;/font&gt; exceptionMessage)
        {
            mException = exceptionMessage;
        }
    } &lt;/p&gt;&lt;p&gt;    &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;class&lt;/font&gt; &lt;font color="teal"&gt;TextFileOpener&lt;/font&gt;
    {
        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;event&lt;/font&gt; &lt;font color="teal"&gt;EventHandler&lt;/font&gt; WhenLoadFile; &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="teal"&gt;TextReader&lt;/font&gt; ipstream;
&lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="teal"&gt;TextReader&lt;/font&gt; Ipstream
        {
            &lt;font color="blue"&gt;get&lt;/font&gt; { &lt;font color="blue"&gt;return&lt;/font&gt; ipstream; }
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; open_passwd()
        {
            &lt;font color="blue"&gt;try&lt;/font&gt;
            {
                ipstream = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;StreamReader&lt;/font&gt;(&lt;font color="maroon"&gt;@"..\etc\passwd"&lt;/font&gt;);
            }
            &lt;font color="blue"&gt;catch&lt;/font&gt; (&lt;font color="teal"&gt;Exception&lt;/font&gt;)
            {
                &lt;font color="blue"&gt;throw&lt;/font&gt; &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;FileNotFoundException&lt;/font&gt;(&lt;font color="maroon"&gt;"No File Found {Exception}"&lt;/font&gt;);
            }
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;bool&lt;/font&gt; open_user_file(&lt;font color="blue"&gt;string&lt;/font&gt; fname)
        {
            &lt;font color="blue"&gt;if&lt;/font&gt; (!&lt;font color="teal"&gt;File&lt;/font&gt;.Exists(fname))
                &lt;font color="blue"&gt;return&lt;/font&gt; &lt;font color="blue"&gt;false&lt;/font&gt;; &lt;/p&gt;&lt;p&gt;            ipstream = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;StreamReader&lt;/font&gt;(fname);&lt;/p&gt;&lt;p&gt;            &lt;font color="blue"&gt;return&lt;/font&gt; &lt;font color="blue"&gt;true&lt;/font&gt;;
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;public&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; OpenUserFile(&lt;font color="blue"&gt;string&lt;/font&gt; fname)
        {
            &lt;font color="blue"&gt;if&lt;/font&gt; (!&lt;font color="teal"&gt;File&lt;/font&gt;.Exists(fname))
            {
                Fire_FileDoesNotExistEvent();
                &lt;font color="blue"&gt;return&lt;/font&gt;;
            } &lt;/p&gt;&lt;p&gt;            ipstream = &lt;font color="blue"&gt;new&lt;/font&gt; &lt;font color="teal"&gt;StreamReader&lt;/font&gt;(fname);
        } &lt;/p&gt;&lt;p&gt;        &lt;font color="blue"&gt;private&lt;/font&gt; &lt;font color="blue"&gt;void&lt;/font&gt; Fire_FileDoesNotExistEvent()
        {
            &lt;font color="blue"&gt;if&lt;/font&gt; (WhenLoadFile != &lt;font color="blue"&gt;null&lt;/font&gt;)
                WhenLoadFile.Invoke(&lt;font color="blue"&gt;null&lt;/font&gt;, &lt;font color="blue"&gt;null&lt;/font&gt;);
        }
    }
}&lt;/p&gt;&lt;/div&gt;

&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-991604967661359026?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/991604967661359026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=991604967661359026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/991604967661359026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/991604967661359026'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/05/imposing-design-was-re-tdd-re-wandering.html' title='Imposing Design (was Re: [TDD] Re: Wandering through layers of software)'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-7182122920564283371</id><published>2007-05-29T14:20:00.000-07:00</published><updated>2007-05-29T14:25:18.520-07:00</updated><title type='text'>User Story Spike</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Spike:&lt;/span&gt;&lt;br style="font-family: verdana;"&gt;&lt;ul style="font-family: verdana;"&gt;&lt;li&gt;Need to refine what I know about ASP.Net with Presenter First.&lt;/li&gt;&lt;li&gt;Need to refine SQL Server 2000 with DAL&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: verdana;"&gt;Story1:&lt;/span&gt;&lt;br style="font-family: verdana;"&gt;&lt;ul style="font-family: verdana;"&gt;&lt;li&gt;    Customer submits an application.&lt;/li&gt;&lt;li&gt;    Application is Validated and stored.&lt;/li&gt;&lt;li&gt;    Customer is notified of application status via e-mail.&lt;/li&gt;&lt;/ul&gt;&lt;br style="font-family: verdana;"&gt;&lt;span style="font-family: verdana;"&gt;Story2:&lt;/span&gt;&lt;br style="font-family: verdana;"&gt;&lt;ul style="font-family: verdana;"&gt;&lt;li&gt;    Application is sent to manual processor via workload balancing (?).&lt;/li&gt;&lt;li&gt;    The application is processed (Approved/Rejected) by manual processor.&lt;/li&gt;&lt;li&gt;    Customer is notified of application status via e-mail.&lt;/li&gt;&lt;/ul&gt;&lt;br style="font-family: verdana;"&gt;&lt;span style="font-family: verdana;"&gt;Story3:&lt;/span&gt;&lt;br style="font-family: verdana;"&gt;&lt;ul style="font-family: verdana;"&gt;&lt;li&gt;    Manager needs to verify application statuses for all manual processors.&lt;/li&gt;&lt;li&gt;    Manager can re-assign workload of manual processors.&lt;/li&gt;&lt;/ul&gt;&lt;br style="font-family: verdana;"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-7182122920564283371?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/7182122920564283371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=7182122920564283371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/7182122920564283371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/7182122920564283371'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/05/user-story-spike.html' title='User Story Spike'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-2814269528946627156</id><published>2007-05-29T14:18:00.000-07:00</published><updated>2007-05-29T14:20:01.270-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Event Sourcing'/><category scheme='http://www.blogger.com/atom/ns#' term='Martin Fowler'/><title type='text'>Event Sourcing Revisit</title><content type='html'>Ah... Encapsulates Application State as derived from event/command messages. Pretty sweet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-2814269528946627156?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/2814269528946627156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=2814269528946627156' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/2814269528946627156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/2814269528946627156'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/05/event-sourcing-revisit.html' title='Event Sourcing Revisit'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-5331541306966536011</id><published>2007-05-27T17:31:00.000-07:00</published><updated>2007-05-27T17:35:01.182-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Event Sourcing'/><category scheme='http://www.blogger.com/atom/ns#' term='Martin Fowler'/><title type='text'>Event Sourcing</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Was looking over event sourcing. I'm still trying to scratch my head. Will Keep plowing ahead and leave more remarks
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-5331541306966536011?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/5331541306966536011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=5331541306966536011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/5331541306966536011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/5331541306966536011'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/05/event-sourcing.html' title='Event Sourcing'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-8963015825371155749</id><published>2007-05-07T10:06:00.000-07:00</published><updated>2007-05-07T10:22:23.116-07:00</updated><title type='text'></title><content type='html'>&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: teal;"&gt;SubmissionModelLayer&lt;/span&gt; : &lt;span style="color: teal;"&gt;SubmissionModel&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;event&lt;/span&gt; &lt;span style="color: teal;"&gt;EventHandler&lt;/span&gt; SubmissionCompleteEvent;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;event&lt;/span&gt; &lt;span style="color: teal;"&gt;EventHandler&lt;/span&gt; SubmissionIncompleteEvent;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: teal;"&gt;SubmittedApplication&lt;/span&gt; mApplication;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: teal;"&gt;ServiceLocater&lt;/span&gt; mLocater;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; SubmissionModelLayer(&lt;span style="color: teal;"&gt;ServiceLocater&lt;/span&gt; locater)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mLocater = locater;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; SubmitApplication(&lt;span style="color: teal;"&gt;SubmittedApplication&lt;/span&gt; application)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mApplication = application;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mApplication.ValidateApplication(mLocater.GetValidationService());&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt;(IsNotValidSubmisssion())&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mApplication.StoreApplication(mLocater.GetDataService());&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt;(IsNotStoredSubmission())&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mApplication.NotifyCustomer(mLocater.GetMessageService());&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (IsNotNotifiedSubmission())&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Fire_CompleteEvent();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; IsNotNotifiedSubmission()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!mApplication.IsCustomerNotified)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Fire_InCompleteEvent();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; IsNotStoredSubmission()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!mApplication.IsStored)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Fire_InCompleteEvent();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; IsNotValidSubmisssion()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!mApplication.IsValid)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Fire_InCompleteEvent();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Fire_InCompleteEvent()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (SubmissionIncompleteEvent != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SubmissionIncompleteEvent.Invoke(&lt;span style="color: blue;"&gt;null&lt;/span&gt;, &lt;span style="color: teal;"&gt;EventArgs&lt;/span&gt;.Empty);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Fire_CompleteEvent()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (SubmissionCompleteEvent != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SubmissionCompleteEvent.Invoke(&lt;span style="color: blue;"&gt;null&lt;/span&gt;, &lt;span style="color: teal;"&gt;EventArgs&lt;/span&gt;.Empty);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-8963015825371155749?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/8963015825371155749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=8963015825371155749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/8963015825371155749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/8963015825371155749'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/05/public-class-submissionmodellayer.html' title=''/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-5346676056125420730</id><published>2007-05-04T20:27:00.000-07:00</published><updated>2007-05-04T21:18:19.533-07:00</updated><title type='text'>Encapsulation in the Model</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_PEIIJFYNwd0/Rjv_5StT4wI/AAAAAAAAABE/w1W6oCn24xc/s1600-h/SubmissionModel+Code.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_PEIIJFYNwd0/Rjv_5StT4wI/AAAAAAAAABE/w1W6oCn24xc/s400/SubmissionModel+Code.bmp" alt="" id="BLOGGER_PHOTO_ID_5060919966020395778" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;Looking at the above code you can see that the submission service is injected into the application. Encapsulation is more than just hiding data, but also is about protecting the client from having to know more than it needs to. I know it sounds like I said the same thing, but when writing the code if you focus more on hiding data than protecting the client then you might run into something like the following:&lt;/span&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_PEIIJFYNwd0/RjwEzCtT4yI/AAAAAAAAABU/yvcOPoAk8ds/s1600-h/SubmissionModel+Code+Hiding.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_PEIIJFYNwd0/RjwEzCtT4yI/AAAAAAAAABU/yvcOPoAk8ds/s400/SubmissionModel+Code+Hiding.bmp" alt="" id="BLOGGER_PHOTO_ID_5060925356204352290" border="0" /&gt;&lt;/a&gt;
&lt;span style="font-family:verdana;"&gt;The code needs to extract a boolean value from the validator then pass it back into the application. The original code did all this in the application object.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-5346676056125420730?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/5346676056125420730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/5346676056125420730'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/05/encapsulation-in-model.html' title='Encapsulation in the Model'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_PEIIJFYNwd0/Rjv_5StT4wI/AAAAAAAAABE/w1W6oCn24xc/s72-c/SubmissionModel+Code.bmp' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-156800221510642830</id><published>2007-05-04T20:21:00.000-07:00</published><updated>2007-05-04T21:21:32.637-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Presenter First'/><title type='text'>Presenter First Events</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_PEIIJFYNwd0/Rjv5PCtT4tI/AAAAAAAAAAs/9IqMGAMtqTw/s1600-h/Activity.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_PEIIJFYNwd0/Rjv5PCtT4tI/AAAAAAAAAAs/9IqMGAMtqTw/s400/Activity.bmp" alt="" id="BLOGGER_PHOTO_ID_5060912643101156050" border="0" /&gt;&lt;/a&gt;
&lt;span style="font-family:verdana;"&gt;To keep track of the presenter first event connection, use a sequence diagram.

The diagram is driven from &lt;a href="http://atomicobject.com/pages/Presenter+First"&gt;Atomic Object's Ruby Code&lt;/a&gt;.

&lt;/span&gt;&lt;img src="file:///C:/DOCUME%7E1/JGUTIE%7E1.JD-/LOCALS%7E1/Temp/moz-screenshot-2.jpg" alt="" /&gt;&lt;img src="file:///C:/DOCUME%7E1/JGUTIE%7E1.JD-/LOCALS%7E1/Temp/moz-screenshot-3.jpg" alt="" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-156800221510642830?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/156800221510642830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=156800221510642830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/156800221510642830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/156800221510642830'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/05/presenter-first-events.html' title='Presenter First Events'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_PEIIJFYNwd0/Rjv5PCtT4tI/AAAAAAAAAAs/9IqMGAMtqTw/s72-c/Activity.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-521241776747388961</id><published>2007-04-28T08:10:00.000-07:00</published><updated>2007-05-04T21:19:24.289-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVP'/><category scheme='http://www.blogger.com/atom/ns#' term='Martin Fowler'/><category scheme='http://www.blogger.com/atom/ns#' term='GUI'/><category scheme='http://www.blogger.com/atom/ns#' term='Presenter First'/><title type='text'>New Stab At Presenter First</title><content type='html'>Presenter First: Mappers. Plain and simple. Maps events to actions/commands required on the injected objects in the presenter.
&lt;ul&gt;&lt;li&gt;Benefit is that all the models and views can be isolated from each other so that they can change on their own. Views especially don't need to know about models.&lt;/li&gt;&lt;/ul&gt;Something else, It seems to me an event aggregator could replace all the presenters with only one presenter and store all actions/commands in a table. Need only to pass all models and views into aggregator. Need to define the mechanics for this refactoring.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-521241776747388961?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/521241776747388961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=521241776747388961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/521241776747388961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/521241776747388961'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/04/presenter-first-mappers.html' title='New Stab At Presenter First'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-307657860964135932</id><published>2007-04-27T22:32:00.000-07:00</published><updated>2007-04-27T22:48:27.362-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Test Driven Design'/><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><title type='text'>Intention Driven Design</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;People who use code to communicate their ideas of software design should give their unit tests along with their implemented code. To me that only seems to be polite. If you’re going to be on a discussion group that has its main focus to be unit testing, you should give examples in unit tests. Give me your intention not your implementation. I really don’t care if you used a long or an integer to implement a counter inside your implementation. If unit testing is the documentation of the code and no other documentation is needed, why is so much implementation used in examples?&lt;/span&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-307657860964135932?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/307657860964135932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=307657860964135932' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/307657860964135932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/307657860964135932'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/04/intention-driven-design.html' title='Intention Driven Design'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-6506677120827267270</id><published>2007-04-11T20:42:00.000-07:00</published><updated>2007-04-13T15:19:40.511-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='DSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Martin Fowler'/><category scheme='http://www.blogger.com/atom/ns#' term='GUI'/><category scheme='http://www.blogger.com/atom/ns#' term='Presenter First'/><title type='text'>Presenter First #2 (Application Data)</title><content type='html'>Normally there are &lt;a href="http://martinfowler.com/eaaDev/uiArchs.html"&gt;3 data states&lt;/a&gt; in Presenter First design.
&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Record State&lt;/span&gt;. The persistent data store residing in the Data Layer. This could include RDBMS, XML, or text flat files.
&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Session State&lt;/span&gt;. Stored in-memory within application. Usually Data Transfer Objects.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Screen State&lt;/span&gt;. Data stored in the view.&lt;/li&gt;&lt;/ul&gt;It is very important the &lt;span style="font-weight: bold;"&gt;Session State&lt;/span&gt; and the &lt;span style="font-weight: bold;"&gt;Screen State&lt;/span&gt; remain synchronized. That is where the presenter object comes into play. The session data becomes dirty and generates an event to the Presenter. In my implementation the Presenter would then query the view for actiontype, check if view is in dirty state,  if dirty retrieve DTO from view. Presenter would then pass DTO to the Domain Service to save the DTO information. Code Example follows:

&lt;pre&gt;&lt;b&gt;public class ReformatAction : CommandAction
{
public ReformatAction(ViewAggregator viewAggregator,
 DomainService domainService) : base(viewAggregator, domainService){}

public override void Execute()
    {
     string formatModuleName = ViewAggregator.GetSelectedModuleName();
        ModuleDTO moduleDTO = ViewAggregator.GetModule();

        if (ViewAggregator.IsDirty)
             Service.SetModule(moduleDTO);
        ViewAggregator.SetModule(Service.GetModule(formatModuleName));
    }
}
&lt;/b&gt;&lt;/pre&gt;
This code example is the wiring between the view and domain. It is a command object. It pulls the module name from the view, pulls the module, if view is dirty then save module, reload saved module to view. The formating comes from where? See what happens in the service:

&lt;pre&gt;&lt;b&gt;      public void SetModule(ModuleDTO module)
     {
          mModuleTable[module.GetModuleName()] = module.GetBody();
     }
&lt;/b&gt;&lt;/pre&gt;
So we see that it is all done in the service. But you say  your unformatting and saving the unformatted int the module table. Correct. Look at this piece:

&lt;pre&gt;&lt;b&gt;        public string GetBody()
      {
          ModuleUnformatter mu = new ModuleUnformatter(mBody);
          mu.UnformatModule();

          return mBody = mu.Module;
      }

      public string GetFormattedBody()
      {
          ModuleFormatter mf = new ModuleFormatter(mBody);
          mf.FormatBody();
          return mf.Module;
      }
&lt;/b&gt;&lt;/pre&gt;
 &lt;p&gt;Ask yourself why didn’t I just transfer the formatted directly into the text box…&lt;/p&gt;Next Post #3: How to utilize command pattern so that the Presenter holds no instance of Domain or View and is nothing but command messages and event messages.
&lt;p&gt;
Post #4: Either Mocking and Unit Testing Presenter First or Event Handling.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-6506677120827267270?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/6506677120827267270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=6506677120827267270' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/6506677120827267270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/6506677120827267270'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/04/presenter-first-2-application-data.html' title='Presenter First #2 (Application Data)'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-4493661374222402757</id><published>2007-04-11T16:59:00.000-07:00</published><updated>2007-05-04T21:28:15.856-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Martin Fowler'/><category scheme='http://www.blogger.com/atom/ns#' term='Reflection C#'/><title type='text'>DSL</title><content type='html'>&lt;div style="text-align: left;"&gt;Just got done finishing my implementation of Martin Fowler's 2 pass build reader for DSLs:
&lt;ul&gt;&lt;li&gt;&lt;a href="http://martinfowler.com/articles/languageWorkbench.html"&gt;Language Workbenches&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://martinfowler.com/articles/codeGenDsl.html"&gt;Code Generation DSL&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;I wish he would have added the reflection code. It really sucked trying to figure out all the reflection for dynamic assembly. Phew...got it anyway. Works sweet!&lt;/div&gt;
Did run across CodeDom. This will generate code. The next step would be to generate the dynamic assembly with CodeDom. Some how I want to use this after loading up the reader strategy. Looks like some abstraction is required. Refactor...Refactor.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-4493661374222402757?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/4493661374222402757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=4493661374222402757' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/4493661374222402757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/4493661374222402757'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/04/dsl.html' title='DSL'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-774114974857513429</id><published>2007-04-08T22:40:00.000-07:00</published><updated>2007-05-04T21:36:47.276-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='MVP'/><category scheme='http://www.blogger.com/atom/ns#' term='GUI'/><category scheme='http://www.blogger.com/atom/ns#' term='Presenter First'/><title type='text'>Presenter First</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Presenter First is a pattern that includes &lt;/span&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;Event Mapper&lt;/span&gt;&lt;span style="font-family: verdana;"&gt; (Presenter), &lt;/span&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;Domain &lt;/span&gt;&lt;span style="font-family: verdana;"&gt;(Model), and &lt;/span&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;Server &lt;/span&gt;&lt;span style="font-family: verdana;"&gt;(View) objects.&lt;/span&gt;
&lt;div style="text-align: center; font-family: verdana;"&gt;&lt;img src="file:///C:/DOCUME%7E1/JGUTIE%7E1.JD-/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" /&gt;&lt;img src="file:///C:/DOCUME%7E1/JGUTIE%7E1.JD-/LOCALS%7E1/Temp/moz-screenshot-1.jpg" alt="" /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_PEIIJFYNwd0/RhnZdS_fi9I/AAAAAAAAAAM/ucqoGu6JJs4/s1600-h/MVP.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_PEIIJFYNwd0/RhnZdS_fi9I/AAAAAAAAAAM/ucqoGu6JJs4/s320/MVP.JPG" alt="" id="BLOGGER_PHOTO_ID_5051307554410302418" border="0" /&gt;&lt;/a&gt;Figure 1.

&lt;div style="text-align: left;"&gt;The key point when designing with this pattern is to remember to keep the presenter stateless.

Don't do any data manipulation in the event handling. Do it all in the Domain.
Example:

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_PEIIJFYNwd0/RjwJmCtT4zI/AAAAAAAAABc/g6r0WvEqaVc/s1600-h/DomainService+No+Logic.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp1.blogger.com/_PEIIJFYNwd0/RjwJmCtT4zI/AAAAAAAAABc/g6r0WvEqaVc/s400/DomainService+No+Logic.bmp" alt="" id="BLOGGER_PHOTO_ID_5060930630424191794" border="0" /&gt;&lt;/a&gt;







&lt;/div&gt;&lt;/div&gt;&lt;span style="font-family: verdana;"&gt;You notice in the correct code you are using command messages to transfer the data around from Server (viewService) to Domain (domainService) and vice versus. All I am doing is wiring up the Server to to the Domain and Domain to Server.&lt;/span&gt;

&lt;span style="font-family: verdana;"&gt;Next Post #2: How to utilize command pattern so that the Presenter holds no instance of Domain or View.&lt;/span&gt;

&lt;span style="font-family: verdana;"&gt;Post #3: Encapsulation worth the effort for Presenter First?&lt;/span&gt;

&lt;span style="font-family: verdana;"&gt;Post #4: Either Mocking and Unit Testing Presenter First or Event Handling.&lt;/span&gt;

&lt;span style="font-family: verdana;"&gt;References:&lt;/span&gt;

&lt;span style="font-family: verdana;"&gt;AtomicObject&lt;/span&gt;
&lt;span style="font-family: verdana;"&gt;Marting Fowler&lt;/span&gt;
&lt;span style="font-family: verdana;"&gt;Brian Marick&lt;/span&gt;
&lt;span style="font-family: verdana;"&gt;Michael Feathers&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-774114974857513429?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/774114974857513429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=774114974857513429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/774114974857513429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/774114974857513429'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/04/presenter-first.html' title='Presenter First'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_PEIIJFYNwd0/RhnZdS_fi9I/AAAAAAAAAAM/ucqoGu6JJs4/s72-c/MVP.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4886862742658249219.post-9024921771049533634</id><published>2007-03-24T17:52:00.000-07:00</published><updated>2007-03-24T17:53:03.163-07:00</updated><title type='text'>TaDA!</title><content type='html'>Just started this blog and wanted to get some content out there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4886862742658249219-9024921771049533634?l=gutzofter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gutzofter.blogspot.com/feeds/9024921771049533634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4886862742658249219&amp;postID=9024921771049533634' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/9024921771049533634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4886862742658249219/posts/default/9024921771049533634'/><link rel='alternate' type='text/html' href='http://gutzofter.blogspot.com/2007/03/tada.html' title='TaDA!'/><author><name>gutzoft</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
