<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Architecture</title><link>http://forums.asp.net/16.aspx</link><description>Discuss and debate ASP.NET application designs. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=8&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3274549.aspx</link><pubDate>Sat, 04 Jul 2009 10:30:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274549</guid><dc:creator>vivek_iit</dc:creator><author>vivek_iit</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274549.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3274549</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;kashifdotnet:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Customer.GetCustomerOrders ();&lt;/b&gt;&amp;nbsp;// a service&lt;/p&gt;
&lt;p&gt;Did i get it right???&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Yes, correct.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3274534.aspx</link><pubDate>Sat, 04 Jul 2009 10:10:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274534</guid><dc:creator>kashifdotnet</dc:creator><author>kashifdotnet</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274534.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3274534</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;vivek_iit:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;For example, you dont need nested associations, or &amp;quot;stronger&amp;quot; aggregations in your domain model. Make it more &amp;quot;procedural&amp;quot; and SOA like, keeping things simple.&lt;br /&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;So the idea is that &lt;strong&gt;instead of having association&lt;/strong&gt;, we can &lt;strong&gt;have a service&lt;/strong&gt;. For exmaple, lets say we have a &lt;strong&gt;Customer&lt;/strong&gt; object. Instead of the following:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;pre class="c-sharp" name="code"&gt;public class Customer
{
        ......
        IList &amp;lt;Order&amp;gt; OrderCollection;
}
&lt;/pre&gt;
&lt;p&gt;&lt;/strong&gt;the following dependency is preferred:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customer.GetCustomerOrders ();&lt;/strong&gt;&amp;nbsp;// a service&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;Did i get it right???&lt;/p&gt;
&lt;p&gt;Thanks for insight &lt;img title="Embarassed" border="0" alt="Embarassed" src="http://forums.asp.net/tiny_mce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif" /&gt;&lt;/p&gt;</description></item><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3274524.aspx</link><pubDate>Sat, 04 Jul 2009 09:58:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274524</guid><dc:creator>kashifdotnet</dc:creator><author>kashifdotnet</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274524.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3274524</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;scott@elbandit.co.uk:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;public&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="keyword"&gt;void&lt;/span&gt;&lt;span&gt;&amp;nbsp;CreateOrder(OrderDTO&amp;nbsp;order) &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt"&gt;&lt;span&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&gt;&lt;span class="comment"&gt;//&amp;nbsp;Convert&amp;nbsp;OrderDTO&amp;nbsp;(used&amp;nbsp;for&amp;nbsp;transport&amp;nbsp;-&amp;nbsp;no&amp;nbsp;logic&amp;nbsp;because&amp;nbsp;it&amp;nbsp;may&amp;nbsp;need&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&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&gt;&lt;span class="comment"&gt;//&amp;nbsp;to&amp;nbsp;be&amp;nbsp;serilaised)&amp;nbsp;to&amp;nbsp;full&amp;nbsp;entity&amp;nbsp;which&amp;nbsp;contians&amp;nbsp;business&amp;nbsp;logic &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt"&gt;&lt;span&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;Order&amp;nbsp;orderEntity&amp;nbsp;=&amp;nbsp;ConvertToOrderFrom(OrderDTO);&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt"&gt;&lt;span&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;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;aha, this does make sence. The idea is to use&lt;strong&gt; plain DTOs&lt;/strong&gt; for data transfer while &lt;strong&gt;Busines Objects&lt;/strong&gt; perform the complex business logic. Using your idea,&lt;strong&gt; I can now logically classify the Custom Entities a bit differently&lt;/strong&gt; i.e instead of having Core Buiness Objects and Need-Based objects,&lt;strong&gt; lets have Smart Business Objects&lt;/strong&gt; and &lt;strong&gt;plain DTOs&lt;/strong&gt;. The smart Business Objects reflect the &lt;strong&gt;business-domain &lt;/strong&gt;and &lt;strong&gt;plain DTOs used for UI/Reporting/Data tranfer&lt;/strong&gt; based on our requirements. &lt;strong&gt;The plain DTOs get populated through the Business Objects.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the smart idea&amp;nbsp;&lt;img title="Cool" border="0" alt="Cool" src="http://forums.asp.net/tiny_mce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif" /&gt; Let me look into it further and will jump right back...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3273589.aspx</link><pubDate>Fri, 03 Jul 2009 13:29:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273589</guid><dc:creator>vivek_iit</dc:creator><author>vivek_iit</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273589.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3273589</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;kashifdotnet:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;What would be a light domain model (Entities with properties only)? What i understand from SOA like architecture is that for an entity Customer, you have a service which returns all his Orders. Did i get it right?&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Yes, by lighter it means that you dont have complex object-object mappings in your domain model. For example, you dont need nested associations, or &amp;quot;stronger&amp;quot; aggregations in your domain model. Make it more &amp;quot;procedural&amp;quot; and SOA like, keeping things simple.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3273550.aspx</link><pubDate>Fri, 03 Jul 2009 13:02:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273550</guid><dc:creator>DigiMortal</dc:creator><author>DigiMortal</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273550.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3273550</wfw:commentRss><description>&lt;p&gt;If you want to make your life simpler you can assign values to DTO-s using &lt;a href="http://www.codeplex.com/AutoMapper"&gt;AutoMapper&lt;/a&gt;. I am using this little utility in some of my projects and it works very well. If you want find out more about AutoMapper then read my blog entry &lt;a href="http://weblogs.asp.net/gunnarpeipman/archive/2009/03/01/creating-dtos-using-automapper.aspx"&gt;Creating DTOs using AutoMapper&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3273352.aspx</link><pubDate>Fri, 03 Jul 2009 10:59:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273352</guid><dc:creator>scott@elbandit.co.uk</dc:creator><author>scott@elbandit.co.uk</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273352.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3273352</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;kashifdotnet:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;So are you supporting my idea of seperating out light-weight DTOs for specific needs (UI/Reporting)? Scott, for child/parent objects, which of the following do you support:&lt;/p&gt;
&lt;p&gt;1. Have a parent FK property in the child?&lt;br /&gt;2. Have a full blown parent object?&lt;br /&gt;3. Have a Service/Method which returns the parent?&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;It depends on what you want to show on your UI/Report, if you need to have a&amp;nbsp; UI that lists products purchased on a certain day I may just return a simple object like:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;    public class ProductsPurchasedTodayDTO
    {
        public string ProductName { get; set; }
        public string CustomerName { get; set; }
        public long OrderId { get; set; }
    }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;kashifdotnet:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;saravanan.balasubramanian:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;While the business entities model the domain using proper associations and relationships, DTOs are designed to interact with other layers like UI, DAL, service client etc.. based on the needs&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you differentiating between business entities and DTOs. The only difference I see between the two is the details within the Busniess Entity? This also implies that only the DTOs are transfered between all layers. What would be the role of Business Entities in such a case just lieing around?&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br /&gt;Business entities contain all of the rich logic etc, your DTO are just dumb data transfer objects, the need to be dumb as they may be send of the wire and will need to be serialized so they can&amp;#39;t contain methods, check out the code below it may make more sense:&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;public class OrderService
    {
        public void CreateOrder(OrderDTO order)
        {
            // Convert OrderDTO (used for transport - no logic because it may need 
            // to be serilaised) to full entity which contians business logic
            Order orderEntity = ConvertToOrderFrom(OrderDTO);

            // Use the entity for business logic...
            if (orderEntity.GetBrokenBusinessRules().Count == 0)
            {
                if (orderEntity.CanFulfillStockRequirements())
                {
                    orderEntity.Place();
                }
                else
                {
                    //......
                }
            }
            else
	        {
                //.....
	        }                
                
        }
    }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I hope that makes some sense.&lt;br /&gt;Cheers&lt;br /&gt;Scott&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3273249.aspx</link><pubDate>Fri, 03 Jul 2009 10:10:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273249</guid><dc:creator>kashifdotnet</dc:creator><author>kashifdotnet</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273249.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3273249</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;Vivek:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;When the UI needs to display related data, you can use the concepts of association/aggregation etc to display &amp;quot;bound&amp;quot; domain objects&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;Could you elaborate on &amp;quot;bound&amp;quot; domain objects.&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;Vivek:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;I usually use a &amp;quot;lighter&amp;quot; domain model and a &amp;quot;SOA like&amp;quot;architecture&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;What would be a light domain model (Entities with properties only)? What i understand from SOA like architecture is that for an entity Customer, you have a service which returns all his Orders. Did i get it right?&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;Scott:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;For complex applications I create a Domain Model (containing business entities, value object etc) and a separate set of presentation DTO&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;So are you supporting my idea of seperating out light-weight DTOs for specific needs (UI/Reporting)? Scott, for child/parent objects, which of the following do you support:&lt;/p&gt;
&lt;p&gt;1. Have a parent FK property in the child?&lt;br /&gt;2. Have a full blown parent object?&lt;br /&gt;3. Have a Service/Method which returns the parent?&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;saravanan.balasubramanian:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;While the business entities model the domain using proper associations and relationships, DTOs are designed to interact with other layers like UI, DAL, service client etc.. based on the needs&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you differentiating between business entities and DTOs. The only difference I see between the two is the details within the Busniess Entity? This also implies that only the DTOs are transfered between all layers. What would be the role of Business Entities in such a case just lieing around?&lt;/p&gt;
&lt;p&gt;Thanks for replying...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3271259.aspx</link><pubDate>Thu, 02 Jul 2009 12:28:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3271259</guid><dc:creator>saravanan.balasubramanian</dc:creator><author>saravanan.balasubramanian</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3271259.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3271259</wfw:commentRss><description>&lt;p&gt;In my opinion, what you call as&amp;nbsp;&amp;quot;need based entities&amp;quot; are nothing but DTOs.&lt;/p&gt;
&lt;p&gt;While the business entities model the domain using proper associations and relationships, DTOs are designed to interact with other layers like UI, DAL, service client etc.. based on the needs.&lt;/p&gt;
&lt;p&gt;DTOs may be overkill if they resemble similar to business entities...&lt;/p&gt;</description></item><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3271056.aspx</link><pubDate>Thu, 02 Jul 2009 10:54:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3271056</guid><dc:creator>scott@elbandit.co.uk</dc:creator><author>scott@elbandit.co.uk</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3271056.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3271056</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;kashifdotnet:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;IMO, Custom Business Entities should be [&lt;strong&gt;Logically&lt;/strong&gt;] classified into two [Layers]. &lt;strong&gt;One layer should represent the [Core] Business Entities (business domain)&lt;/strong&gt; while &lt;strong&gt;the other represents [Need-Based] Entities&lt;/strong&gt;. The need-based entities should conform to UI or other needs (such as reporting). For example, the following Custom Entities represent the main business domain:&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For complex applications I create a Domain Model (containing business entities, value object etc) and a separate set of presentation DTO (Data Transfer Objects – no logic) which is usually a flatter representation of an object graph used exclusively for displaying data. I find this works very well and keeps a nice separation of concerns.&lt;/p&gt;</description></item><item><title>Re: Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3270753.aspx</link><pubDate>Thu, 02 Jul 2009 08:34:52 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3270753</guid><dc:creator>vivek_iit</dc:creator><author>vivek_iit</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3270753.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3270753</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;When the UI needs to display related data, you can use the concepts of association/aggregation etc to display &amp;quot;bound&amp;quot; domain objects. This is why for larger projects the domain model can get quite complex and convoluted.&lt;/p&gt;&lt;p&gt;Though it depends on project-to-project basis, I usually use a &amp;quot;lighter&amp;quot; domain model and a &amp;quot;SOA like&amp;quot;architecture (which actually goes quite opposite when compared against a traditional domain driven approach). When it comes to reporting, some times I avoid domain objects completely (in heavy reporting scenarios) and leverage datasets etc.&lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;kashifdotnet:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;But the UI may need to display &lt;b&gt;Which Customer bought Which Product (without order details).&lt;/b&gt; For such a need, we can have the following need-based entity:&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;For this case, I would have created a method like: Customer::FindProductPurchaseHistory() which would return a strongly typed collection of Product DTOs or something similar on this line.&lt;/p&gt;&lt;p&gt;HTH,&lt;/p&gt;&lt;p&gt;Vivek&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Logical Classification of Business Entities</title><link>http://forums.asp.net/thread/3270430.aspx</link><pubDate>Thu, 02 Jul 2009 06:08:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3270430</guid><dc:creator>kashifdotnet</dc:creator><author>kashifdotnet</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3270430.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=3270430</wfw:commentRss><description>&lt;p&gt;I have seen countless discussions on this forum where the [&lt;strong&gt;Confusion&lt;/strong&gt;] of designing Business Entities aka Custom Business Entities aka DTO lingers on. Even right now there are many question posted pertaining the same subject. Designing simple Custom Entities is stright forward but the UI needs are very peculiar. If Entity-A holds a link to Entity-B it works fine for a simple screen; however, the problem arises &lt;strong&gt;when the UI needs to display Entity-B including [Name] of Entity-A&lt;/strong&gt;. Since Entity-B only holds a link (without other details) to Entity-A, &lt;strong&gt;the user is either forced to include the [Name] of Entity-A in Entity-B as a property&lt;/strong&gt; or &lt;strong&gt;has to define an entirely new Entity-C&lt;/strong&gt; which is a merger of the Entity-A and Entity-B.&lt;/p&gt;
&lt;p&gt;IMO, Custom Business Entities should be [&lt;strong&gt;Logically&lt;/strong&gt;] classified into two [Layers]. &lt;strong&gt;One layer should represent the [Core] Business Entities (business domain)&lt;/strong&gt; while &lt;strong&gt;the other represents [Need-Based] Entities&lt;/strong&gt;. The need-based entities should conform to UI or other needs (such as reporting). For example, the following Custom Entities represent the main business domain:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Customer (CustID, CustName, ...), Order (OrdID, Date, ...) , Product (ProID, ProName, Price, ...) ----- [Core] Business Entities&lt;/p&gt;
&lt;p&gt;But the UI may need to display &lt;strong&gt;Which Customer bought Which Product (without order details).&lt;/strong&gt; For such a need, we can have the following need-based entity:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;CustomerProductPurchase (CustID, ProID, CustName, ProName, Price, ...)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;This is just my opinion. I see the pros and cons of this architecutre BUT would like to hear from the experts...&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Thanks..&lt;/p&gt;</description></item></channel></rss>