<?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 on: RE: Presentation Model Question</title>
	<atom:link href="http://lostechies.com/joeybeninghove/2007/09/30/re-presentation-model-question/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/joeybeninghove/2007/09/30/re-presentation-model-question/</link>
	<description>Just another LosTechies site</description>
	<lastBuildDate>Fri, 15 Oct 2010 23:08:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Colin Jack</title>
		<link>http://lostechies.com/joeybeninghove/2007/09/30/re-presentation-model-question/#comment-38</link>
		<dc:creator>Colin Jack</dc:creator>
		<pubDate>Mon, 19 Nov 2007 17:25:05 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joeydotnet/archive/2007/09/29/re-presentation-model-question.aspx#comment-38</guid>
		<description>&gt; Lets make an Open Source Project that can do 
this!  Anyone else in?

I&#039;d certainly like to be involved in an open source project for this, it definitely seems like something people will find useful.

&gt; This kind of logic would most likely be 
&gt; encapsulated  in some sort of specification *in the &gt; domain* that perhaps is injected, if necessary, into &gt; the mapper implementation itself.

I&#039;m confused, why would you inject this in? Do the DTO&#039;s not have a dependency on the domain so why would you be injecting them in?

&gt;This definitely makes them easier to swap and and 
&gt; extend (i.e. decorators, etc..) if necessary

Just interested, why would you want to extend/replace the mapper?</description>
		<content:encoded><![CDATA[<p>> Lets make an Open Source Project that can do<br />
this!  Anyone else in?</p>
<p>I&#8217;d certainly like to be involved in an open source project for this, it definitely seems like something people will find useful.</p>
<p>> This kind of logic would most likely be<br />
> encapsulated  in some sort of specification *in the > domain* that perhaps is injected, if necessary, into > the mapper implementation itself.</p>
<p>I&#8217;m confused, why would you inject this in? Do the DTO&#8217;s not have a dependency on the domain so why would you be injecting them in?</p>
<p>>This definitely makes them easier to swap and and<br />
> extend (i.e. decorators, etc..) if necessary</p>
<p>Just interested, why would you want to extend/replace the mapper?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joeyDotNet</title>
		<link>http://lostechies.com/joeybeninghove/2007/09/30/re-presentation-model-question/#comment-37</link>
		<dc:creator>joeyDotNet</dc:creator>
		<pubDate>Mon, 01 Oct 2007 19:21:52 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joeydotnet/archive/2007/09/29/re-presentation-model-question.aspx#comment-37</guid>
		<description>&gt; &quot;Curious wouldn&#039;t this simply be a Specification or Constraint object since it is a predicate evaluation within the Domain.&quot;

Indeed.  The examples I gave were just to merely point out that the mappers would need to have at least enough &quot;smarts&quot; to communicate with the domain in some way.  This kind of logic would most likely be encapsulated in some sort of specification *in the domain* that perhaps is injected, if necessary, into the mapper implementation itself.

&gt; &quot;Couldn&#039;t this be achieved by using Spring.Net&quot;

If you&#039;re talking about managing the mapper *implementations* in an IoC container, then yes, those are already managed via my IoC container (Windsor).  This definitely makes them easier to swap and and extend (i.e. decorators, etc..) if necessary.

Right now my &quot;service&quot; implementations get injected with the appropriate mappers as necessary and the service methods take care of invoking the mapper when needed to translate to/from the domain/dto.

&gt; &quot;giving the DTO an aspect when it&#039;s behaving this way etc.  Use this mapping?&quot;

Could you elaborate on this?</description>
		<content:encoded><![CDATA[<p>> &#8220;Curious wouldn&#8217;t this simply be a Specification or Constraint object since it is a predicate evaluation within the Domain.&#8221;</p>
<p>Indeed.  The examples I gave were just to merely point out that the mappers would need to have at least enough &#8220;smarts&#8221; to communicate with the domain in some way.  This kind of logic would most likely be encapsulated in some sort of specification *in the domain* that perhaps is injected, if necessary, into the mapper implementation itself.</p>
<p>> &#8220;Couldn&#8217;t this be achieved by using Spring.Net&#8221;</p>
<p>If you&#8217;re talking about managing the mapper *implementations* in an IoC container, then yes, those are already managed via my IoC container (Windsor).  This definitely makes them easier to swap and and extend (i.e. decorators, etc..) if necessary.</p>
<p>Right now my &#8220;service&#8221; implementations get injected with the appropriate mappers as necessary and the service methods take care of invoking the mapper when needed to translate to/from the domain/dto.</p>
<p>> &#8220;giving the DTO an aspect when it&#8217;s behaving this way etc.  Use this mapping?&#8221;</p>
<p>Could you elaborate on this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Ocampo</title>
		<link>http://lostechies.com/joeybeninghove/2007/09/30/re-presentation-model-question/#comment-36</link>
		<dc:creator>Joe Ocampo</dc:creator>
		<pubDate>Mon, 01 Oct 2007 18:57:50 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joeydotnet/archive/2007/09/29/re-presentation-model-question.aspx#comment-36</guid>
		<description>&gt;  Like, &quot;CheckoutButtonShouldBeEnabled&quot; might be set based on an IsReadyForCheckout method on your Order domain object or maybe it uses a service call to make that determination, etc.

Curious wouldn&#039;t this simply be a Specification or Constraint object since it is a predicate evaluation within the Domain.

&gt;For the most part, I like my mappers to stay pretty dumb, but I am looking for a more elegant solution for dealing with &quot;smart mappers&quot;.

Couldn&#039;t this be achieved by using Spring.Net and giving the DTO an aspect when it&#039;s behaving this way etc.  Use this mapping?
</description>
		<content:encoded><![CDATA[<p>>  Like, &#8220;CheckoutButtonShouldBeEnabled&#8221; might be set based on an IsReadyForCheckout method on your Order domain object or maybe it uses a service call to make that determination, etc.</p>
<p>Curious wouldn&#8217;t this simply be a Specification or Constraint object since it is a predicate evaluation within the Domain.</p>
<p>>For the most part, I like my mappers to stay pretty dumb, but I am looking for a more elegant solution for dealing with &#8220;smart mappers&#8221;.</p>
<p>Couldn&#8217;t this be achieved by using Spring.Net and giving the DTO an aspect when it&#8217;s behaving this way etc.  Use this mapping?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joeyDotNet</title>
		<link>http://lostechies.com/joeybeninghove/2007/09/30/re-presentation-model-question/#comment-35</link>
		<dc:creator>joeyDotNet</dc:creator>
		<pubDate>Mon, 01 Oct 2007 17:18:56 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joeydotnet/archive/2007/09/29/re-presentation-model-question.aspx#comment-35</guid>
		<description>@Ben,
Yeah, I haven&#039;t attempted a codegen approach to this problem yet.  Like Jeremy said, I often do have properties on some of my DTOs like &quot;FreeOptionShouldBeEnabled&quot;, &quot;ShouldAllowQuantityToBeUpdated&quot;, etc. which I&#039;ve found fits nicely in the presentation model.  

The interesting part for these scenarios is that most likely the value that gets assigned to these screen-specific attributes is based on 1 or more business rules that are encapsulated in the domain.  Like, &quot;CheckoutButtonShouldBeEnabled&quot; might be set based on an IsReadyForCheckout method on your Order domain object or maybe it uses a service call to make that determination, etc.  Either way, the implementation of that logic stays nicely separated from the presentation layer itself.

One thing I&#039;m still mulling over is the fact that sometimes your domain-dto mappers have to be &quot;smart enough&quot; to at least know which domain object or service to call in order to set the appropriate DTO values.  For the most part, I like my mappers to stay pretty dumb, but I am looking for a more elegant solution for dealing with &quot;smart mappers&quot;.</description>
		<content:encoded><![CDATA[<p>@Ben,<br />
Yeah, I haven&#8217;t attempted a codegen approach to this problem yet.  Like Jeremy said, I often do have properties on some of my DTOs like &#8220;FreeOptionShouldBeEnabled&#8221;, &#8220;ShouldAllowQuantityToBeUpdated&#8221;, etc. which I&#8217;ve found fits nicely in the presentation model.  </p>
<p>The interesting part for these scenarios is that most likely the value that gets assigned to these screen-specific attributes is based on 1 or more business rules that are encapsulated in the domain.  Like, &#8220;CheckoutButtonShouldBeEnabled&#8221; might be set based on an IsReadyForCheckout method on your Order domain object or maybe it uses a service call to make that determination, etc.  Either way, the implementation of that logic stays nicely separated from the presentation layer itself.</p>
<p>One thing I&#8217;m still mulling over is the fact that sometimes your domain-dto mappers have to be &#8220;smart enough&#8221; to at least know which domain object or service to call in order to set the appropriate DTO values.  For the most part, I like my mappers to stay pretty dumb, but I am looking for a more elegant solution for dealing with &#8220;smart mappers&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://lostechies.com/joeybeninghove/2007/09/30/re-presentation-model-question/#comment-34</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Mon, 01 Oct 2007 17:00:40 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joeydotnet/archive/2007/09/29/re-presentation-model-question.aspx#comment-34</guid>
		<description>@Ben,

The main reason to split off a separate Presentation Model from the Domain Model is because the two things need to be different.  Like using a Presentation Model as a flattener, or keeping extra state that only pertains to the view like &quot;ThisButtonEnabled&quot; or &quot;SizeOfTheSuchAndSuch.&quot;  I&#039;m not too sure that a codegen approach gets you too much here.</description>
		<content:encoded><![CDATA[<p>@Ben,</p>
<p>The main reason to split off a separate Presentation Model from the Domain Model is because the two things need to be different.  Like using a Presentation Model as a flattener, or keeping extra state that only pertains to the view like &#8220;ThisButtonEnabled&#8221; or &#8220;SizeOfTheSuchAndSuch.&#8221;  I&#8217;m not too sure that a codegen approach gets you too much here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Scheirman</title>
		<link>http://lostechies.com/joeybeninghove/2007/09/30/re-presentation-model-question/#comment-33</link>
		<dc:creator>Ben Scheirman</dc:creator>
		<pubDate>Mon, 01 Oct 2007 16:25:37 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joeydotnet/archive/2007/09/29/re-presentation-model-question.aspx#comment-33</guid>
		<description>I&#039;m currently using a domain entity &lt;-&gt; DTO approach (mirrored) but I&#039;m using SubSonic to generate my code, so I just modified the templates to allow marshalling/mapping between the two.

In this scenario, it&#039;s dead simple, but then again doesn&#039;t add a whole lot of value.

I&#039;m really interested to see if the Presentation Model is more fitting for what I&#039;m trying to do.</description>
		<content:encoded><![CDATA[<p>I&#8217;m currently using a domain entity < -> DTO approach (mirrored) but I&#8217;m using SubSonic to generate my code, so I just modified the templates to allow marshalling/mapping between the two.</p>
<p>In this scenario, it&#8217;s dead simple, but then again doesn&#8217;t add a whole lot of value.</p>
<p>I&#8217;m really interested to see if the Presentation Model is more fitting for what I&#8217;m trying to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Ocampo</title>
		<link>http://lostechies.com/joeybeninghove/2007/09/30/re-presentation-model-question/#comment-32</link>
		<dc:creator>Joe Ocampo</dc:creator>
		<pubDate>Sun, 30 Sep 2007 02:58:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joeydotnet/archive/2007/09/29/re-presentation-model-question.aspx#comment-32</guid>
		<description>&gt;Unfortunately, I don&#039;t know of any decent frameworks out there that can tackle this problem of domain-presentation mapping the same way, say NHibernate, solves the object-relational mapping problem.

I don&#039;t either!  I usually have to make my own.  Lets make an Open Source Project that can do this!  Anyone else in?</description>
		<content:encoded><![CDATA[<p>>Unfortunately, I don&#8217;t know of any decent frameworks out there that can tackle this problem of domain-presentation mapping the same way, say NHibernate, solves the object-relational mapping problem.</p>
<p>I don&#8217;t either!  I usually have to make my own.  Lets make an Open Source Project that can do this!  Anyone else in?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
