<?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: DAL Pattern Question</title><link>http://forums.asp.net/thread/2263952.aspx</link><pubDate>Sat, 29 Mar 2008 17:57:31 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2263952</guid><dc:creator>scott@elbandit.co.uk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2263952.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2263952</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;nberardi:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; &lt;br /&gt;This may seem like an odd question but bare with me. 
&lt;p&gt;&lt;b&gt;How do you fill the same data at varying degrees with the least amount of objects?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;For instance to the left of this post you see a small representation of my &amp;quot;User Object&amp;quot; that shows only the most basic information.&amp;nbsp; However when you click my user name you go in to my profile which contains this information plus some.&amp;nbsp; So assuming that ASP.NET Forums uses the same &amp;quot;User Object&amp;quot; for both of these different views of the same model and only fills the appropriate information when requested.&amp;nbsp; How would you go about programming this?&amp;nbsp; And is there currently a pattern or model that gets me almost there?&lt;/p&gt;Nick&lt;br /&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br /&gt;&lt;br /&gt;You could use Inheritance like so:&lt;br /&gt;&lt;br /&gt;&lt;img style="WIDTH:159px;HEIGHT:457px;" height="457" src="http://www.elbandit.co.uk/images/UserInfo.gif" width="159" alt="" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;&lt;em&gt;Public&lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Class&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;em&gt; User&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public&lt;/font&gt;&lt;font size="2"&gt; _Points &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;font size="2"&gt; _Name &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;font size="2"&gt; _JoinDate &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Date&lt;/p&gt;&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; Points &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; name &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; JoinDate &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Date&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&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;&amp;nbsp; _Points = Points&lt;br /&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;&amp;nbsp; _Name = name&lt;br /&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;&amp;nbsp; _JoinDate = JoinDate&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Sub&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&lt;em&gt;End&lt;/em&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;em&gt; &lt;/em&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Class&lt;/em&gt;&lt;/p&gt;&lt;em&gt;Public&lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Class&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; UserDetails&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Inherits&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;em&gt; User&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public&lt;/font&gt;&lt;font size="2"&gt; _bio &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;font size="2"&gt; _Email &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;font size="2"&gt; _BirthDate &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;Date&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;font size="2"&gt; _BlogURL &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;font size="2"&gt; _HomePageURL &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/p&gt;&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; Points &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; name &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; JoinDate &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Date&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt;, _&lt;br /&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; bio &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; Email &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; BlogURL &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; HomePageURL &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt;, _&lt;br /&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; BirthDate &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;em&gt; DateTime)&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase&lt;/em&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;em&gt;.New(Points, name, JoinDate)&lt;/em&gt;&lt;/p&gt;&lt;em&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;&amp;nbsp;&amp;nbsp; _bio = bio&lt;br /&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;&amp;nbsp;&amp;nbsp; _Email = Email&lt;br /&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;&amp;nbsp;&amp;nbsp; _BirthDate = BirthDate&lt;br /&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;&amp;nbsp;&amp;nbsp; _BlogURL = BlogURL&lt;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;_HomePageURL = HomePageURL&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Sub&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&lt;em&gt;End&lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Class&lt;/p&gt;&lt;/font&gt;&lt;/em&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2263936.aspx</link><pubDate>Sat, 29 Mar 2008 17:35:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2263936</guid><dc:creator>TATWORTH</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2263936.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2263936</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;If your question has been answered, please mark the thread as answered. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2188505.aspx</link><pubDate>Thu, 21 Feb 2008 22:15:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2188505</guid><dc:creator>nberardi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2188505.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2188505</wfw:commentRss><description>&lt;p&gt;Hi Dimebrain,&lt;/p&gt;&lt;p&gt;Actually I am using C# 3.0 and LINQ is very nice with their anonymous types.&amp;nbsp; But my problem comes in that I need to develop processes around these types and business layer logic.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2182257.aspx</link><pubDate>Tue, 19 Feb 2008 15:14:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2182257</guid><dc:creator>Dimebrain</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2182257.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2182257</wfw:commentRss><description>&lt;p&gt;Rather than defining interfaces for each subset of User data, if it&amp;#39;s possible for you to use VS2008, you could simply populate your fields using a C# 3.0 projection, creating an anonymous local type with the fields you needed. In situations like the example it hardly makes sense to dynamically load a handful of small data types.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;In real world applications, where you can&amp;#39;t use C# 3.0, my suggestion is to employ a framework like NHibernate that can reasonably handle lazy-loading in situations where it&amp;#39;s actually warranted (large object graphs under collections on your object). Otherwise, just bring down the whole, small entity and display what matters to you.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2160729.aspx</link><pubDate>Fri, 08 Feb 2008 03:27:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2160729</guid><dc:creator>czuvich</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2160729.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2160729</wfw:commentRss><description>&lt;p&gt;The only unfortunate part of using interfaces to design your object properties is that you can&amp;#39;t return interfaces from web services. I just tried this today because I am faced with the same problem. I ended up creating concrete objects and then use composition to create the larger objects. I tried to break up the extra properties into a reasonably named class. Good luck.&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2159362.aspx</link><pubDate>Thu, 07 Feb 2008 15:40:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2159362</guid><dc:creator>scott@elbandit.co.uk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2159362.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2159362</wfw:commentRss><description>&lt;p&gt;How about this for an Idea:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Public&lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Class&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; User &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Implements&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; IFullUser&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Implements&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;em&gt; ILightUser&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private&lt;/font&gt;&lt;font size="2"&gt; _name &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; = &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Private&lt;/font&gt;&lt;font size="2"&gt; _age &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;em&gt; = 0 &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#008000" size="2"&gt;&amp;#39; Constructor for Light User&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; Name &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt;)&lt;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _name = Name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Sub&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#008000" size="2"&gt;&amp;#39; Constructor for Full User&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; Name &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; age &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt;)&lt;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _name = Name&lt;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _age = age&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/p&gt;&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ReadOnly&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Property&lt;/font&gt;&lt;font size="2"&gt; name() &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Implements&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;em&gt; ILightUser.Name, IFullUser.Name &lt;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;Get&lt;br /&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;&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;/font&gt;&lt;font color="#0000ff" size="2"&gt;Return&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; _name&lt;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;Get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Property&lt;/p&gt;&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ReadOnly&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Property&lt;/font&gt;&lt;font size="2"&gt; age() &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Implements&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; IFullUser.Age&lt;br /&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;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Get&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;br /&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;&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;/font&gt;&lt;font color="#0000ff" size="2"&gt;Return&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; _age&lt;br /&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;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;Get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Property&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&lt;em&gt;End&lt;/em&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;em&gt; &lt;/em&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Class&lt;/em&gt;&lt;/p&gt;&lt;em&gt;Public&lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Interface&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; IFullUser&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ReadOnly&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Property&lt;/font&gt;&lt;font size="2"&gt; Name() &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ReadOnly&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Property&lt;/font&gt;&lt;font size="2"&gt; Age() &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Integer&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&lt;em&gt;End&lt;/em&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;em&gt; &lt;/em&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Interface&lt;/em&gt;&lt;/p&gt;&lt;em&gt;Public&lt;/em&gt;&lt;/font&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Interface&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;em&gt; ILightUser&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReadOnly&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Property&lt;/font&gt;&lt;font size="2"&gt; Name() &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;String&lt;/em&gt;&lt;/p&gt;&lt;em&gt;End&lt;/em&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;em&gt; &lt;/em&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;em&gt;Interface&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&lt;/font&gt;then you can create the objects like so:&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; aLightUser &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; ILightUser&lt;br /&gt;aLightUser = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt; User(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Scott&amp;quot;&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;em&gt;)&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;em&gt;&amp;#39; Only has access to the name property&lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;em&gt;aLightUser.Name&lt;/em&gt;&lt;/p&gt;&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; aFullUser &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; IFullUser&lt;br /&gt;aFullUser = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt; User(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Scott&amp;quot;&lt;/font&gt;&lt;/em&gt;&lt;font size="2"&gt;&lt;em&gt;, 30)&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;em&gt;&amp;#39; Has access to the name and age property&lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;em&gt;aFullUser.Age&lt;br /&gt;aFullUser.Name&lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;br /&gt;This way if you have any complicated business logic going on in a property or method you can store it all in one place. I have never actually used this but I thought it may be useful in some situtations.&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2154186.aspx</link><pubDate>Tue, 05 Feb 2008 14:21:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2154186</guid><dc:creator>landofcash</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2154186.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2154186</wfw:commentRss><description>&lt;p&gt;I usually move heavy data in its own object e.g.:&lt;/p&gt;
&lt;p&gt;&lt;span class="kwd"&gt;public class&lt;/span&gt; User{&lt;br /&gt;&lt;span class="cmt"&gt;//common fields&lt;/span&gt;&lt;br /&gt;&lt;span class="kwd"&gt;private int&lt;/span&gt; _id;&lt;br /&gt;&lt;span class="kwd"&gt;private string&lt;/span&gt; _name;&lt;br /&gt;&lt;span class="cmt"&gt;//extended data&lt;/span&gt;&lt;br /&gt;&lt;span class="kwd"&gt;private&lt;/span&gt; UserData _userData&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="kwd"&gt;public class&lt;/span&gt; UserData {&lt;br /&gt;&lt;span class="kwd"&gt;private int&lt;/span&gt; _id;&lt;br /&gt;&lt;span class="kwd"&gt;private string&lt;/span&gt; _bio;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&amp;nbsp;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2150840.aspx</link><pubDate>Mon, 04 Feb 2008 01:45:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2150840</guid><dc:creator>alibaba199</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2150840.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2150840</wfw:commentRss><description>&lt;p&gt;If you want to maintain a high level of data/code integrity, you really should create separate BLL objects that reference the appropriate procs in your DAL.&lt;/p&gt;

&lt;p&gt;Otherwise, I would think you could do a quick &amp;amp; dirty implementation by giving the object a &amp;quot;state&amp;quot; variable which is set to x, y, or z when calling the proc to load x, y, or z set of data.  Then, you&amp;#39;d have to confuse things by making a rule that when state=x, only set x of data is valid for the object.  You could enforce this (and help your debugging) by overriding the objects&amp;#39; instance variable &amp;quot;get&amp;quot; (tired, can&amp;#39;t remember the academic name) functions to return nulls if the data isn&amp;#39;t valid in the current state.
&lt;/p&gt;
&lt;p&gt;At least, that&amp;#39;s what my overly tired brain is coming up with at the moment....
&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2149850.aspx</link><pubDate>Sat, 02 Feb 2008 22:24:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2149850</guid><dc:creator>nberardi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2149850.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2149850</wfw:commentRss><description>I originally arrived at this pattern after reading up on the MVC (Model View Controller).&amp;nbsp; The idea of a model really intrigued me.&amp;nbsp; Because the more I thought about standard web pages they are mostly based around only one &amp;quot;object&amp;quot;, such as a User or a Product and everything else is just meta data, such as purchases for the User.&amp;nbsp; So if you define all your models that you need for your website ahead of time such as User, UserProfile, Product, ProductProfile, etc you have not only helped define a development plan, but you have created very convent interfaces that both have common attributes.&amp;nbsp; For example:&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;interface&lt;/span&gt; IUser {
    &lt;span class="kwd"&gt;int&lt;/span&gt; Id { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    &lt;span class="kwd"&gt;string&lt;/span&gt; UserName { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    DateTime JoinedOn { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
}

&lt;span class="kwd"&gt;interface&lt;/span&gt; IUserProfile : IUser {
    &lt;span class="kwd"&gt;string&lt;/span&gt; FullName { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    &lt;span class="kwd"&gt;string&lt;/span&gt; Email { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    UserBilling Billing { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    Address Address { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    List Purchases { &lt;span class="kwd"&gt;get&lt;/span&gt;; }

    &lt;span class="kwd"&gt;void&lt;/span&gt; MakePurchase(IProduct product);
}

&lt;span class="kwd"&gt;interface&lt;/span&gt; IProduct {
    &lt;span class="kwd"&gt;int&lt;/span&gt; Id { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    &lt;span class="kwd"&gt;string&lt;/span&gt; Name { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    &lt;span class="kwd"&gt;decimal&lt;/span&gt; Price { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    &lt;span class="kwd"&gt;string&lt;/span&gt; Description { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
}

&lt;span class="kwd"&gt;interface&lt;/span&gt; IProductProfile : IProduct {
    List&amp;lt;&lt;span class="kwd"&gt;string&lt;/span&gt;&amp;gt; Comments { &lt;span class="kwd"&gt;get&lt;/span&gt;; }
    &lt;span class="kwd"&gt;float&lt;/span&gt; CustomerRating { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }
    &lt;span class="kwd"&gt;int&lt;/span&gt; StockCount { &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }

    &lt;span class="kwd"&gt;void&lt;/span&gt; Purchase(IUser user);
    &lt;span class="kwd"&gt;void&lt;/span&gt; AddPicture (&lt;span class="kwd"&gt;string&lt;/span&gt; path);
}&lt;/pre&gt;Then with these interfaces you create objects.&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;class&lt;/span&gt; User : IUser, IUserProfile {
    &lt;span class="cmt"&gt;// implement interfaces plus supporting code&lt;/span&gt;
}

&lt;span class="kwd"&gt;class&lt;/span&gt; Product : IProduct, IProductProfile {
    &lt;span class="cmt"&gt;// implement interfaces plus supporting code&lt;/span&gt;
}&lt;/pre&gt;Then you create a helper class to fill these methods in the data layer.&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;static class&lt;/span&gt; DataHelper {&lt;br /&gt;    &lt;span class="kwd"&gt;public static&lt;/span&gt; IProduct GetProduct (&lt;span class="kwd"&gt;int&lt;/span&gt; id) {&lt;br /&gt;        IProduct p = &lt;span class="kwd"&gt;new&lt;/span&gt; Product();&lt;br /&gt;        &lt;span class="cmt"&gt;// get data from database and only fill in IProduct interfaces&lt;/span&gt;
    }

    &lt;span class="kwd"&gt;public static&lt;/span&gt; IProductProfile GetProductProfile (&lt;span class="kwd"&gt;int&lt;/span&gt; id) {&lt;br /&gt;        IProductProfile p = &lt;span class="kwd"&gt;new&lt;/span&gt; Product();&lt;br /&gt;        &lt;span class="cmt"&gt;// get data from database and fill in IProductProfile interfaces&lt;br /&gt;        // including supporting tables such as the collections&lt;br /&gt;        // or fill in some and dirty fill the others&lt;/span&gt;
    }

    &lt;span class="cmt"&gt;// do the same for User&lt;/span&gt;
}
&lt;/pre&gt;Personally this is similar to how I am now implementing it.&amp;nbsp; I am hoping LINQ is going to be able to help me out so that only the data I need is returned for each interface.&amp;nbsp; If LINQ can&amp;#39;t do the job I may have to pony up the time and create the DAL by hand.&amp;nbsp; Honestly performance matters so I can&amp;#39;t trust a DataSet in this instance.&lt;br /&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2147725.aspx</link><pubDate>Fri, 01 Feb 2008 14:10:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2147725</guid><dc:creator>czuvich</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2147725.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2147725</wfw:commentRss><description>&lt;p&gt;Same here. I&amp;#39;d like to know a solid pattern for this problem as well. My guess would be it depends... I like the solution posted above about loading the object all at once and then moving out what you need to a readonly object, but due to the 1-M relationships and other fields, you could suffer a performance hit. &lt;/p&gt;
&lt;p&gt;I&amp;#39;ve always been under the impression if you do it as posted above, your code is simple and easy to maintain; however, you suffer a performance hit. Whereas if you decide to load only what you need into particular objects, then you end up with more data access code; however, I would probably shy away from blank or null values in your objects.&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2146612.aspx</link><pubDate>Fri, 01 Feb 2008 00:56:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2146612</guid><dc:creator>officialboss</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2146612.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2146612</wfw:commentRss><description>&lt;p&gt;This is an interesting topic that I have been also wondering about. Could you post what solution you decided to go with and your reasons for doing so when you are done. 
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2146498.aspx</link><pubDate>Thu, 31 Jan 2008 22:54:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2146498</guid><dc:creator>nberardi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2146498.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2146498</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;Mercury082:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;You could create 3 seperate interfaces - ISmallUser, IPartialUser : ISmallUser, IUser : IPartialUser&amp;nbsp;with the appropriate public properties on them and have the User class implement IUser. By passing the appropriate interface around instead of the actual User class you could avoid accessing something you&amp;#39;re not supposed to with that particular type of &amp;#39;filledness&amp;#39; of the class. You still wouldn&amp;#39;t be saving much in terms of performance but it would make a partially filled User object easier to work with (by programming against the appropriate interface and knowing exactly what you&amp;#39;re dealing with instead of encountering a whole bunch of default value properties and NullReference Exceptions).&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Honestly the above was an example.&amp;nbsp; The actuality of what we are talking about is the same object one with 3 fields and the other with about 20 fields and a couple supporting collections pulled from another table.&amp;nbsp; So there is a real performance hit if I just need the three columns.&amp;nbsp; However most if not all of the methods in this object require the 3 fields in the smaller of the two data results, so it would be a pain to try and dual code for two different objects.&amp;nbsp; We considered an interface and coding two objects and a supporting state class with all the methods.&amp;nbsp; But that seemed clunky at best.&lt;br /&gt; &lt;/p&gt;&lt;p&gt;We actually considered the interface option and it is still on the plate of possible solutions and seems like the best idea for now given the different views we need of the object. &lt;/p&gt;&lt;p&gt;Really I was just looking for a sanity check in this forum.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2144184.aspx</link><pubDate>Thu, 31 Jan 2008 04:46:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2144184</guid><dc:creator>Mercury082</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2144184.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2144184</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m not totally getting why you&amp;#39;d want to partially fill an object, leaving some properties null or default values. There&amp;#39;s no point having an object and just not setting the properties. It won&amp;#39;t save much in terms of performance and it&amp;#39;ll&amp;nbsp;make the object more difficult to work with (think NullReference Exceptions and default values mingled in with your real data...).&lt;/p&gt;
&lt;p&gt;I would use inheritance, and create SmallUser, PartialUser : SmallUser and a User:PartialUser&amp;nbsp;classes. Although you mention that you don&amp;#39;t want to create seperate classes for each. That would save some performance by excluding the stuff you don&amp;#39;t want completely from the class.&lt;/p&gt;
&lt;p&gt;You could create 3 seperate interfaces - ISmallUser, IPartialUser : ISmallUser, IUser : IPartialUser&amp;nbsp;with the appropriate public properties on them and have the User class implement IUser. By passing the appropriate interface around instead of the actual User class you could avoid accessing something you&amp;#39;re not supposed to with that particular type of &amp;#39;filledness&amp;#39; of the class. You still wouldn&amp;#39;t be saving much in terms of performance but it would make a partially filled User object easier to work with (by programming against the appropriate interface and knowing exactly what you&amp;#39;re dealing with instead of encountering a whole bunch of default value properties and NullReference Exceptions).&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2144093.aspx</link><pubDate>Thu, 31 Jan 2008 03:28:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2144093</guid><dc:creator>nberardi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2144093.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2144093</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;ParrotBoy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;I agree, it would be very unlikely to have an object that loads in data as it is requested as it would inevitably be slower than just loading all the data at once. I generate all my business entities using codesmith templates and in general I will have an object which allows updates and loads all the information for each table and a read-only object for each view. This way I could create a view named &amp;quot;SimpleUserInfo&amp;quot; for use in places like the right hand of this page, but if I wanted to update a User I would have to use the full-featured User object.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I think I actually gave you guys the wrong impression.&amp;nbsp; My question wasn&amp;#39;t about lazy loading each property individually.&amp;nbsp; I already know the performance problems with that.&lt;/p&gt;&lt;p&gt;My question was essentially in creating a couples states of the object.&amp;nbsp; For example:&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="cmt"&gt;// small fill&lt;/span&gt;
User user1 = &lt;span class="kwd"&gt;new&lt;/span&gt; User();
user1.Id = (&lt;span class="kwd"&gt;int&lt;/span&gt;)reader[&lt;span class="st"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;];
user1.UserName = (&lt;span class="kwd"&gt;string&lt;/span&gt;)reader[&lt;span class="st"&gt;&amp;quot;UserName&amp;quot;&lt;/span&gt;];

&lt;span class="cmt"&gt;// partially filled&lt;/span&gt;
User user2 = &lt;span class="kwd"&gt;new&lt;/span&gt; User();
user2.Id = (&lt;span class="kwd"&gt;int&lt;/span&gt;)reader[&lt;span class="st"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;];
user2.UserName = (&lt;span class="kwd"&gt;string&lt;/span&gt;)reader[&lt;span class="st"&gt;&amp;quot;UserName&amp;quot;&lt;/span&gt;];
user2.LastPost = (DateTime)reader[&lt;span class="st"&gt;&amp;quot;LastPost&amp;quot;&lt;/span&gt;];

&lt;span class="cmt"&gt;// fully filled&lt;/span&gt;
User user3 = &lt;span class="kwd"&gt;new&lt;/span&gt; User();
user3.Id = (&lt;span class="kwd"&gt;int&lt;/span&gt;)reader[&lt;span class="st"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;];
user3.UserName = (&lt;span class="kwd"&gt;string&lt;/span&gt;)reader[&lt;span class="st"&gt;&amp;quot;UserName&amp;quot;&lt;/span&gt;];
user3.LastPost = (DateTime)reader[&lt;span class="st"&gt;&amp;quot;LastPost&amp;quot;&lt;/span&gt;];
user3.PostCount = (&lt;span class="kwd"&gt;int&lt;/span&gt;)reader[&lt;span class="st"&gt;&amp;quot;PostCount&amp;quot;&lt;/span&gt;];
user3.JoinedOn = (DateTime)reader[&lt;span class="st"&gt;&amp;quot;JoinedOn&amp;quot;&lt;/span&gt;];
&lt;span class="cmt"&gt;// etc...&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;So my question is this.&amp;nbsp; Is there a better method or pattern that accomplishes something like this for the 3 different states of the User object above.&amp;nbsp; I have already determined that I don&amp;#39;t want to create a separate object for each state of this object.&amp;nbsp; And performance is really important so minimizing the database calls and the data returned is very important.&amp;nbsp; The DAL doesn&amp;#39;t have to be enterprise grade pattern or practice, because this is a Web 2.0 initiative where most of the objects requested are going to be the smaller objects that only have a limited amount of data.&amp;nbsp; And there are only a handful of them with very minor reliance on each other.&lt;/p&gt;&lt;p&gt;Please let me know if you have any suggestions.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: DAL Pattern Question</title><link>http://forums.asp.net/thread/2143742.aspx</link><pubDate>Wed, 30 Jan 2008 22:49:35 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2143742</guid><dc:creator>Mercury082</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2143742.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=16&amp;PostID=2143742</wfw:commentRss><description>&lt;p&gt;I&amp;nbsp;have used&amp;nbsp;lazy-loading&amp;nbsp;a little in the past&amp;nbsp;and I use deep-loading often. It&amp;#39;s really useful if you have a large&amp;nbsp;object-model with alot of relationships that aren&amp;#39;t always necessary. NetTiers handles deep-loading fairly well (with a patch applied to stop stack overflow exceptions) -&amp;nbsp;you can pass in an object and specify the types that you wish to deepload.&lt;/p&gt;
&lt;p&gt;eg. &lt;/p&gt;
&lt;p&gt;User usr = UserService.GetById(1);&lt;/p&gt;
&lt;p&gt;UserService.DeepLoad(usr, typeof(Address));&lt;/p&gt;
&lt;p&gt;Address userAddress = usr.AddressSource;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>