<?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 : Suggestions for verifying deleted entities?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Suggestions for verifying deleted entities?</description>
  <pubDate>Sun, 12 Apr 2026 00:25:11 -700</pubDate>
  <lastBuildDate>Thu, 07 Feb 2008 11:28:10 -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=680</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>Suggestions for verifying deleted entities? : I overrode the Delete() method...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=680&amp;PID=2521#2521</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=20" rel="nofollow">Customer</a><br /><strong>Subject:</strong> 680<br /><strong>Posted:</strong> 07-Feb-2008 at 11:28am<br /><br /><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">I overrode the Delete() method in my EntityBase class and turned in into a template method. &nbsp;The sub-class can provide a VerifierCollection by overriding and implementing a method called DeleteVerifiers() and then the template method tells the verifier engine to execute these verifiers.&nbsp; Upon success, I calls a method called DeleteCore() that performs the actual delete after successful verification.&nbsp; I am throwing an exception from the Delete() method for now since this is the quickest things that works.&nbsp; I had considered providing a delete service and I’ll probably go this direction eventually.<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">Thanks for the input.</SPAN></P>]]>
   </description>
   <pubDate>Thu, 07 Feb 2008 11:28:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=680&amp;PID=2521#2521</guid>
  </item> 
  <item>
   <title>Suggestions for verifying deleted entities? : It&#8217;s a good question.  The customeris...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=680&amp;PID=2520#2520</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 680<br /><strong>Posted:</strong> 07-Feb-2008 at 11:25am<br /><br /><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">It’s a good question.<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">The customer&nbsp;is correct that, once an object has been deleted, one cannot traverse its graph … I don’t think you should be able to do so.<o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">What to do? How to check if delete is ok before deleting? <o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">The obvious first answer is to override the Delete method and test the object before deleting. <o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">But perhaps you want to do that in a generalized way, even taking advantage of the VerificationEngine’s ability to acquire and deliver rules. The VE wasn’t designed to verify delete (or add or any object operation other than save) but it would seem easy to extend for such purposes. We can add any kind of VerificationRule to the VE’s inventory and retrieve it by type and name (although I don’t remember precisely how to do so as I write this).<o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">It would be essential to clear all triggers for such a rule – we don’t want it to fire on property change or save … or at least I don’t think so.<o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">I suppose what I’d do next is override a business object base class Delete method such that it looked for delete verification rules in the VE and, if found, ran them.</SPAN><SPAN style="COLOR: #1f497d"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">Of course if the rule fails, you have to have some way of communicating that fact back to the UI. I don’t know that throwing an exception is a good idea. Some eventing mechanism might seem appropriate but I wouldn’t want to hook up an event to every object and I’d be wary of anything that might prevent a transient entity from being garbage collected when it went out of scope. I strongly advise against attaching and detaching event handlers to individual entities.<o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">This leads me instead to the notion of some kind of service that the Delete method can find and invoke for communicating a delete verification failure; the UI could subscribe to that service. Use the ServiceLocator pattern. You know the drill.<o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">Clearly it would be a good idea for IdeaBlade to develop a recommendation for verifying basic operations on entities (add, delete). I figured we’d get into that when we developed our SecurityEngine – the object level security parallel to the VerificationEngine.<o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="COLOR: #1f497d">Because we have not done this yet, it remains for&nbsp;the customer&nbsp;to consider these ideas here and spike on them. I’d sure like to know what he thinks.</SPAN></P>]]>
   </description>
   <pubDate>Thu, 07 Feb 2008 11:25:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=680&amp;PID=2520#2520</guid>
  </item> 
  <item>
   <title>Suggestions for verifying deleted entities? : In the interested of consolidating...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=680&amp;PID=2519#2519</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=20" rel="nofollow">Customer</a><br /><strong>Subject:</strong> 680<br /><strong>Posted:</strong> 07-Feb-2008 at 11:13am<br /><br /><P =Ms&#111;normal>In the interested of consolidating my business rules, I’d prefer to use verification to enforce my deletion criteria rather than overriding the delete method.&nbsp; The trouble is that when an entity is marked “deleted” then you cannot traverse to its related objects because a deleted entity has all NullEntity values for its relations.&nbsp; Can you suggest a recommended practice for verifying that an entity can be deleted when I need to check values in related entities in order to make this determination?<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>]]>
   </description>
   <pubDate>Thu, 07 Feb 2008 11:13:12 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=680&amp;PID=2519#2519</guid>
  </item> 
 </channel>
</rss>