<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: What is a View in Domain Driven Design?</title>
	<atom:link href="http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/</link>
	<description>Just another Wordpress.com weblog</description>
	<lastBuildDate>Thu, 25 Jun 2009 05:26:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: llwqthcvtkm</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-913</link>
		<dc:creator>llwqthcvtkm</dc:creator>
		<pubDate>Thu, 25 Jun 2009 05:26:09 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-913</guid>
		<description>hAG4Cr  &lt;a href=&quot;http://khxgfuarkozb.com/&quot; rel=&quot;nofollow&quot;&gt;khxgfuarkozb&lt;/a&gt;, [url=http://caulbcdciszx.com/]caulbcdciszx[/url], [link=http://eygdzymhywue.com/]eygdzymhywue[/link], http://xgmdeqhyjaqk.com/</description>
		<content:encoded><![CDATA[<p>hAG4Cr  <a href="http://khxgfuarkozb.com/" rel="nofollow">khxgfuarkozb</a>, [url=http://caulbcdciszx.com/]caulbcdciszx[/url], [link=http://eygdzymhywue.com/]eygdzymhywue[/link], <a href="http://xgmdeqhyjaqk.com/" rel="nofollow">http://xgmdeqhyjaqk.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nude</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-912</link>
		<dc:creator>nude</dc:creator>
		<pubDate>Tue, 07 Apr 2009 04:49:29 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-912</guid>
		<description>&lt;a href=&quot;http://eduardoshi.masjedblog.ir/&quot; rel=&quot;nofollow&quot;&gt;emmanuelle chriqui nude&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p><a href="http://eduardoshi.masjedblog.ir/" rel="nofollow">emmanuelle chriqui nude</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nude</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-911</link>
		<dc:creator>nude</dc:creator>
		<pubDate>Sun, 22 Mar 2009 19:47:50 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-911</guid>
		<description>&lt;a href=&quot;http://alexiabrac.openspace.co.nz/&quot; rel=&quot;nofollow&quot;&gt;tea leoni nude&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p><a href="http://alexiabrac.openspace.co.nz/" rel="nofollow">tea leoni nude</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Born 2 Code .NET &#187; Blog Archive &#187; DDD - The list</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-403</link>
		<dc:creator>Born 2 Code .NET &#187; Blog Archive &#187; DDD - The list</dc:creator>
		<pubDate>Mon, 20 Aug 2007 10:34:53 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-403</guid>
		<description>[...] What is a View in Domain Driven Design? [...]</description>
		<content:encoded><![CDATA[<p>[...] What is a View in Domain Driven Design? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Angel "Java" Lopez : Enlaces y Recursos Domain-Driven Design</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-12</link>
		<dc:creator>Angel "Java" Lopez : Enlaces y Recursos Domain-Driven Design</dc:creator>
		<pubDate>Sat, 09 Dec 2006 09:19:31 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-12</guid>
		<description>[...] Avoiding Anemic Domain Models with Hibernatehttp://wrschneider.blogspot.com/2005/01/avoiding-anemic-domain-models-with.htmlWhat is a View in Domain Driven Design?http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Avoiding Anemic Domain Models with Hibernatehttp://wrschneider.blogspot.com/2005/01/avoiding-anemic-domain-models-with.htmlWhat is a View in Domain Driven Design?http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bert Hooyman</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-8</link>
		<dc:creator>Bert Hooyman</dc:creator>
		<pubDate>Mon, 28 Aug 2006 13:18:03 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-8</guid>
		<description>&lt;i&gt;what is the data type of an element in hotelList?&lt;/i&gt; As this is a return value from hotelRepository it is a collection of objects of type Hotel.

&lt;i&gt;Doesn’t it take a lot of code to turn the projection into valid SQL?&lt;/i&gt; A valid concern. The classical approach is to put the ORM in an XML file and interpret it over and over again. That is potentially more time-consuming than actually generating SQL. 
The alternative is to interpret the XML model only once and generate some source code that is a more technical representation - ready to support the SQL generation. Also that&#039;s a good moment in time to validate the mapping, the projections and all of that. Needless to say what my favorite approach is.</description>
		<content:encoded><![CDATA[<p><i>what is the data type of an element in hotelList?</i> As this is a return value from hotelRepository it is a collection of objects of type Hotel.</p>
<p><i>Doesn’t it take a lot of code to turn the projection into valid SQL?</i> A valid concern. The classical approach is to put the ORM in an XML file and interpret it over and over again. That is potentially more time-consuming than actually generating SQL.<br />
The alternative is to interpret the XML model only once and generate some source code that is a more technical representation &#8211; ready to support the SQL generation. Also that&#8217;s a good moment in time to validate the mapping, the projections and all of that. Needless to say what my favorite approach is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billhamaker</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-7</link>
		<dc:creator>billhamaker</dc:creator>
		<pubDate>Fri, 25 Aug 2006 15:51:40 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-7</guid>
		<description>Thanks for the additional information.   Two things I&#039;m not clear on.

1.  In you example what is the data type of an element in hotelList?  Since projections can contain variable data its hard to see how it could be fixed data type.  Is it an ado.net DataTable?

2.  Doesn&#039;t it take a lot of code to turn the projection into valid SQL?  Or are you saying that your mapping software provides most of the code to do that so you don&#039;t need to write the SQL generation code yourself?

I&#039;ve never used an OR mapper so software so I&#039;m I don&#039;t know if application programs could access the SQL generator capabilities of the OR Mapping software directly.

Bill Hamaker</description>
		<content:encoded><![CDATA[<p>Thanks for the additional information.   Two things I&#8217;m not clear on.</p>
<p>1.  In you example what is the data type of an element in hotelList?  Since projections can contain variable data its hard to see how it could be fixed data type.  Is it an ado.net DataTable?</p>
<p>2.  Doesn&#8217;t it take a lot of code to turn the projection into valid SQL?  Or are you saying that your mapping software provides most of the code to do that so you don&#8217;t need to write the SQL generation code yourself?</p>
<p>I&#8217;ve never used an OR mapper so software so I&#8217;m I don&#8217;t know if application programs could access the SQL generator capabilities of the OR Mapping software directly.</p>
<p>Bill Hamaker</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bert Hooyman</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-6</link>
		<dc:creator>Bert Hooyman</dc:creator>
		<pubDate>Fri, 25 Aug 2006 06:56:58 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-6</guid>
		<description>Two replies to this:
1) The definition of a projection. It&#039;s actually much simpler than you thought it was. A projection has a name (a string) and a collection of properties, each of which is itself a string (&quot;roomtypes.name&quot; from my earlier example). In my implementation, so far I haven&#039;t used any objects for this and simply concatenate all the properties into a comma-separated string.
2) The use of a projection. In my implementation, I have both predefined projections which live in the mapping file, i.e. where my object-relational mapping is specified, and also dynamic projections, which are specified at runtime.
The benefit of predefined mappings is that I can validate them offline (as projections refer to object properties and associations, there&#039;s many ways to make errors so validation must happen), so predefined projections are more efficient.
The dynamic projections add an extra level of flexibility, useful in scenarios where the provider of the Repository service does not know or cannot anticipate what the consumer of the service wants. Very useful when you expose repository as a (web) service, as client apps can then ask for any projection without impact on the server code.

In practice, I start out with dynamic projections during early development of an application. By the time my data entry forms, my list pages and my view pages are all in production-ready state, I turn the dynamic projections into static projections by adding them to the OR mapping file and taking out all the setProjection() calls. Flexibility at development time makes way for performance at production time.

Examples of use:
with a static projection, client code must refer to a projection name that Repository knows about:
hotelList = hotelRepository.find(&quot;hotelListProjection&quot;, );
This throws an exception when &quot;hotelListProjection&quot; is not a known projection name.
With a dynamic projection, client code must first make the projection known to the repository, at which point it is validated:
hotelRepository.setProjection(&quot;hotelListProjection&quot;, &quot;hotelName, streetAddress, qualityRating&quot;);
hotelList = hotelRepository.find(&quot;hotelListProjection&quot;, );
The setProjection method throws validation exceptions when attribute names or association names are unknown to the repository.

The examples above discuss the use of projection for object population which is only part of the story. The other part is of course the object persistence, when object data must be passed back to a persitent store. Again, I&#039;m using projection for that. Reason being that in typical interactive applications, the client code is very much aware of the attributes that were exposed to the UI so it knows very well which attributes may potentially have changed (it&#039;s the same list of attributes that was used to build the data edit page in the first place, in the case of an &quot;update&quot; scenario).

Bert Hooyman, Utrecht, Netherlands</description>
		<content:encoded><![CDATA[<p>Two replies to this:<br />
1) The definition of a projection. It&#8217;s actually much simpler than you thought it was. A projection has a name (a string) and a collection of properties, each of which is itself a string (&#8220;roomtypes.name&#8221; from my earlier example). In my implementation, so far I haven&#8217;t used any objects for this and simply concatenate all the properties into a comma-separated string.<br />
2) The use of a projection. In my implementation, I have both predefined projections which live in the mapping file, i.e. where my object-relational mapping is specified, and also dynamic projections, which are specified at runtime.<br />
The benefit of predefined mappings is that I can validate them offline (as projections refer to object properties and associations, there&#8217;s many ways to make errors so validation must happen), so predefined projections are more efficient.<br />
The dynamic projections add an extra level of flexibility, useful in scenarios where the provider of the Repository service does not know or cannot anticipate what the consumer of the service wants. Very useful when you expose repository as a (web) service, as client apps can then ask for any projection without impact on the server code.</p>
<p>In practice, I start out with dynamic projections during early development of an application. By the time my data entry forms, my list pages and my view pages are all in production-ready state, I turn the dynamic projections into static projections by adding them to the OR mapping file and taking out all the setProjection() calls. Flexibility at development time makes way for performance at production time.</p>
<p>Examples of use:<br />
with a static projection, client code must refer to a projection name that Repository knows about:<br />
hotelList = hotelRepository.find(&#8220;hotelListProjection&#8221;, );<br />
This throws an exception when &#8220;hotelListProjection&#8221; is not a known projection name.<br />
With a dynamic projection, client code must first make the projection known to the repository, at which point it is validated:<br />
hotelRepository.setProjection(&#8220;hotelListProjection&#8221;, &#8220;hotelName, streetAddress, qualityRating&#8221;);<br />
hotelList = hotelRepository.find(&#8220;hotelListProjection&#8221;, );<br />
The setProjection method throws validation exceptions when attribute names or association names are unknown to the repository.</p>
<p>The examples above discuss the use of projection for object population which is only part of the story. The other part is of course the object persistence, when object data must be passed back to a persitent store. Again, I&#8217;m using projection for that. Reason being that in typical interactive applications, the client code is very much aware of the attributes that were exposed to the UI so it knows very well which attributes may potentially have changed (it&#8217;s the same list of attributes that was used to build the data edit page in the first place, in the case of an &#8220;update&#8221; scenario).</p>
<p>Bert Hooyman, Utrecht, Netherlands</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billhamaker</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-3</link>
		<dc:creator>billhamaker</dc:creator>
		<pubDate>Mon, 14 Aug 2006 14:53:41 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-3</guid>
		<description>If I understand this suggestion the signature of your repository would look something like..

public List GetPeople(PersonProjection projection)

And the Person class would need to implement lazy loading to handle the case where the application references some attribute or method that relies on data not in the projection.

Is that correct?

If so I&#039;m curious if you consider the PersonProjection class part of the domain model?    And if not where does it reside?   

I don&#039;t see anything wrong with doing what you describe other than the fact that it is a very big front end investment.   I find the idea rather daunting but its always nice to make investments if you can get enough reuse to justify them.

If you have just a few fixed projections then what you have done is not so different from what I did where I assumed there was typically each class had just one projection that the user cared about.    Except I wasn&#039;t willing to implement a lazy loading system so I suggested passing around an interface rather than a lazy loaded domain object.

If instead you are proposing that the user interface developer needs to construct generic projections in a general purpose query language then you have complicated the UI layer significantly.

Bill Hamaker</description>
		<content:encoded><![CDATA[<p>If I understand this suggestion the signature of your repository would look something like..</p>
<p>public List GetPeople(PersonProjection projection)</p>
<p>And the Person class would need to implement lazy loading to handle the case where the application references some attribute or method that relies on data not in the projection.</p>
<p>Is that correct?</p>
<p>If so I&#8217;m curious if you consider the PersonProjection class part of the domain model?    And if not where does it reside?   </p>
<p>I don&#8217;t see anything wrong with doing what you describe other than the fact that it is a very big front end investment.   I find the idea rather daunting but its always nice to make investments if you can get enough reuse to justify them.</p>
<p>If you have just a few fixed projections then what you have done is not so different from what I did where I assumed there was typically each class had just one projection that the user cared about.    Except I wasn&#8217;t willing to implement a lazy loading system so I suggested passing around an interface rather than a lazy loaded domain object.</p>
<p>If instead you are proposing that the user interface developer needs to construct generic projections in a general purpose query language then you have complicated the UI layer significantly.</p>
<p>Bill Hamaker</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bert Hooyman</title>
		<link>http://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-2</link>
		<dc:creator>Bert Hooyman</dc:creator>
		<pubDate>Mon, 14 Aug 2006 14:26:28 +0000</pubDate>
		<guid isPermaLink="false">https://billhamaker.wordpress.com/2006/08/03/what-is-a-view-in-domain-driven-design/#comment-2</guid>
		<description>My view on this is that in many real-life projects, the bulk of an application is not considered so much with a domain model, but rather with the underlying data. Navigating through lists of business entities is just one example of that - there is no business logic in providing this type of functionality, users are simply navigating a large, perhaps complex, data space. It is only when they create or modify information that the domain model comes into play. In my experience, that is the case only in a surprisingly low percentage of all use cases.

The consequence of this is that View becomes much more relevant than Model. Hence, the underlying code should provide support for delivering View-related information. I&#039;m not a big fan of elaborate object models for view-only purposes (data carriers). Instead, I would be quite happy to push around the first-class domain model objects and live with partially populated attributes. I have worked on this approach and came to appreciate the value of &lt;i&gt;attribute lists&lt;/i&gt;, which I tend to refer to as &lt;i&gt;projections&lt;/i&gt; (an RDBM term). As an example, when I&#039;m populating a pick list of hotels, and each item in the list would only show the hotel name, the street address and the quality rating, I would use a named projection that refers to an attribute list with those three attributes, plus an identifier of course. I would use a Repository with a generic finder method that accepts a query object as well as a projection name. It would ultimately turn the query object into a WHERE clause and the projection into a SELECT clause, assuming the repository accesses a regular SQL source. Projections need not be restricted to a single object&#039;s primitive attributes; it may also work with embedded objects, for example various room types in the hotel. By the time my View tier needs details of a single hotel, including the standard rates for all room types, the projection would include roomtypes.name, roomtypes.rate, roomtypes.facilities as attributes. Those would come back as a collection of roomType objects, embedded within a hotel object.

The real benefit of projection-based object population with query-based finders is that your data access tier becomes extremely general-purpose (read: reusable). One implementation is usually enough for supporting all of the requirements of the View tier.</description>
		<content:encoded><![CDATA[<p>My view on this is that in many real-life projects, the bulk of an application is not considered so much with a domain model, but rather with the underlying data. Navigating through lists of business entities is just one example of that &#8211; there is no business logic in providing this type of functionality, users are simply navigating a large, perhaps complex, data space. It is only when they create or modify information that the domain model comes into play. In my experience, that is the case only in a surprisingly low percentage of all use cases.</p>
<p>The consequence of this is that View becomes much more relevant than Model. Hence, the underlying code should provide support for delivering View-related information. I&#8217;m not a big fan of elaborate object models for view-only purposes (data carriers). Instead, I would be quite happy to push around the first-class domain model objects and live with partially populated attributes. I have worked on this approach and came to appreciate the value of <i>attribute lists</i>, which I tend to refer to as <i>projections</i> (an RDBM term). As an example, when I&#8217;m populating a pick list of hotels, and each item in the list would only show the hotel name, the street address and the quality rating, I would use a named projection that refers to an attribute list with those three attributes, plus an identifier of course. I would use a Repository with a generic finder method that accepts a query object as well as a projection name. It would ultimately turn the query object into a WHERE clause and the projection into a SELECT clause, assuming the repository accesses a regular SQL source. Projections need not be restricted to a single object&#8217;s primitive attributes; it may also work with embedded objects, for example various room types in the hotel. By the time my View tier needs details of a single hotel, including the standard rates for all room types, the projection would include roomtypes.name, roomtypes.rate, roomtypes.facilities as attributes. Those would come back as a collection of roomType objects, embedded within a hotel object.</p>
<p>The real benefit of projection-based object population with query-based finders is that your data access tier becomes extremely general-purpose (read: reusable). One implementation is usually enough for supporting all of the requirements of the View tier.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
