<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Redundant PropertyMetadata classes</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Redundant PropertyMetadata classes</description>
  <pubDate>Sun, 12 Apr 2026 06:15:16 -700</pubDate>
  <lastBuildDate>Thu, 01 Sep 2011 16:19:15 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2941</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Redundant PropertyMetadata classes : Thanks! Entities from the designer...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2941&amp;PID=11618#11618</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=613" rel="nofollow">stephenmcd1</a><br /><strong>Subject:</strong> 2941<br /><strong>Posted:</strong> 01-Sep-2011 at 4:19pm<br /><br />Thanks! &nbsp;Entities from the designer are fine.....it's the manually created ones that you mention that cause us problems. &nbsp;We have lots of these that aren't technically database backed but we want 99% of our app to treat them like all our other Entities so we have them inherit from a real Entity.]]>
   </description>
   <pubDate>Thu, 01 Sep 2011 16:19:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2941&amp;PID=11618#11618</guid>
  </item> 
  <item>
   <title>Redundant PropertyMetadata classes :    Hi Stephen, If you create...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2941&amp;PID=11614#11614</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2941<br /><strong>Posted:</strong> 01-Sep-2011 at 11:46am<br /><br />Hi Stephen,<div> </div><div>&nbsp;</div><div>If you create the child entity in the Designer, you won't have this problem.</div><div> </div><div>&nbsp;</div><div>As for when you manually create a child class, I am adding a feature request so it would automatically inherit PropertyMetadata.</div><div> </div><div>&nbsp;</div><div>Regards,</div><div>   Silvio.</div><span style="font-size:10px"><br /><br />Edited by sbelini - 01-Sep-2011 at 11:46am</span>]]>
   </description>
   <pubDate>Thu, 01 Sep 2011 11:46:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2941&amp;PID=11614#11614</guid>
  </item> 
  <item>
   <title>Redundant PropertyMetadata classes : In a few places, we inherit from...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2941&amp;PID=11609#11609</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=613" rel="nofollow">stephenmcd1</a><br /><strong>Subject:</strong> 2941<br /><strong>Posted:</strong> 31-Aug-2011 at 3:15pm<br /><br />In a few places, we inherit from some of our Entities. &nbsp;Something very straightforward like:<div><table width="99%"><tr><td><pre class="BBcode">public class FancyEmployee : Employee</div><div>{</div><div>&nbsp; &nbsp;// Extra logic here</div><div>}</pre></td></tr></table></div><div>However, that isn't enough. &nbsp;We've found that we need to re-delcare the PropertyMetadata nested class in our FancyEmployee.....even though we aren't adding any more properties. &nbsp;So our code becomes less straightforward:</div><div><table width="99%"><tr><td><pre class="BBcode">public class FancyEmployee : Employee</div><div><div>{</div><div>&nbsp; &nbsp;public new class PropertyMetadata : Employee.PropertyMetadata</div><div>&nbsp; &nbsp;{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//This class is necessary to make Dev Force happy - otherwise serves no purpose :-)</div><div>&nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp;// Extra logic here</div><div>}</pre></td></tr></table></div></div><div>If we don't do that, DevForce will just happily assume there are no properties! &nbsp;Which I actually think is worse behavior than you used to have in previous versions where you would&nbsp;explicitly&nbsp;throw an exception saying "EntityType: FancyEmployee is not a valid 'Entity' subclass. It inherits from Entity but does not contain a PropertyMetadata nested type." &nbsp;- at least that error told us that we were doing something wrong instead of silently ignore it.</div><div><br></div><div>It's not terribly complicated to have these extra PropertyMetadata classes but it does add some extra boilerplate code that is easy to forget. &nbsp;Also, we have complicated&nbsp;inheritance&nbsp;hierarchies and we've started running into some weird errors cause by bad copy/pasting in the boilerplate code. &nbsp;For example, the new PropertyMetadata class in FancyEmployee might accidentally inherit from Order.PropertyMetadata. &nbsp;That kind of thing may work at first but eventually can come back to bite you. &nbsp;Also, if we add a new class to our hierarchy, we have to be careful that we also update all these PropertyMetadata class so they inherit correctly.</div><div><br></div><div>I'm wondering if there might be a way that DevForce could do some kind of 'FlattenHierarchy' when it uses reflection to find the PropertyMetadata class. &nbsp;That way we would only need to re-delcare it if we were actually adding properties (which is considerably more rare).</div>]]>
   </description>
   <pubDate>Wed, 31 Aug 2011 15:15:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2941&amp;PID=11609#11609</guid>
  </item> 
 </channel>
</rss>