<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2>From my point of view as a developer who writes code 
against the api, </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2>I have to handle to case of a Resource not being there, or 
being invalid/corupt... theese are casses that I need to recover from in my 
code...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2>and&nbsp;I have no way of knowing what do I need to catch 
and where,&nbsp;without first writing the code, run tests against it, and 
examine stack traces. I find this quite inefficient...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2>If you google for ResourceNotFoundException, you will find 
out that there is quite a few APIs out there that implement it. There is other 
apis that have InvalidResourceException... or 
javx.resource.ResourceException</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2>My preference would be toward catched Exceptions in this 
case.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2>--zoly</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=150074315-12122008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN><SPAN class=150074315-12122008><FONT 
face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-dev-bounces@lists.jboss.org 
[mailto:rules-dev-bounces@lists.jboss.org] <B>On Behalf Of </B>Mark 
Proctor<BR><B>Sent:</B> Thursday, December 11, 2008 8:04 PM<BR><B>To:</B> Rules 
Dev List<BR><B>Subject:</B> Re: [rules-dev] Drools API improvement 
sugestion<BR></FONT><BR></DIV>
<DIV></DIV>Zoltan Farkas wrote: 
<BLOCKQUOTE 
cite=mid:A483EB3CA9C69D41AEC537D1C7C2CAFF033592E0@34093-C3-EVS2.exchange.rackspace.com 
type="cite">
  <DIV><FONT face=Arial size=2><SPAN class=035244019-11122008>Based on current 
  implementation, the following&nbsp;methods I think should throw a exception, 
  something like: </SPAN></FONT></DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008></SPAN></FONT><FONT 
  face=Arial size=2><SPAN 
  class=035244019-11122008>ResourceNotFoundException</SPAN></FONT></DIV></BLOCKQUOTE>do 
you want this as runtime or catched exception? At the moment we are trying to 
avoid catched exceptions.<BR><BR>Mark<BR>
<BLOCKQUOTE 
cite=mid:A483EB3CA9C69D41AEC537D1C7C2CAFF033592E0@34093-C3-EVS2.exchange.rackspace.com 
type="cite">
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial><FONT 
  size=2>org.drools.compiler.PackageBuilder.addKnowledgeResource<SPAN 
  class=035244019-11122008>()</SPAN></FONT></FONT></DIV>
  <DIV><FONT face=Arial 
  size=2>org.drools.builder.impl.KnowledgeBuilderImpl.add<SPAN 
  class=035244019-11122008>()</SPAN><BR></FONT></DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2>another option might be to&nbsp;verify the validity of a Resource 
  object at creation time and make ResourceFactory factory methods throw <SPAN 
  class=035244019-11122008>ResourceNotFoundException.</SPAN></FONT></SPAN></FONT></DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN class=035244019-11122008></SPAN></FONT></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN class=035244019-11122008>I believe the case of a&nbsp;"not 
  found&nbsp;resource" the user of the api should be "ecouraged" to 
  handle.</SPAN></FONT></SPAN></FONT></DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN class=035244019-11122008></SPAN></FONT></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN class=035244019-11122008>Another case that might be needed to be 
  handled could be InvalidResource?</SPAN></FONT></SPAN></FONT></DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN class=035244019-11122008></SPAN></FONT></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN class=035244019-11122008>Let me know what you guys 
  think</SPAN></FONT></SPAN></FONT></DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN class=035244019-11122008></SPAN></FONT></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN 
class=035244019-11122008>Regards</SPAN></FONT></SPAN></FONT></DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN class=035244019-11122008></SPAN></FONT></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=+0><SPAN class=035244019-11122008><FONT face=Arial 
  size=2><SPAN class=035244019-11122008>--zoly</SPAN></FONT></SPAN></FONT></DIV><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
rules-dev mailing list
<A class=moz-txt-link-abbreviated href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</A>
<A class=moz-txt-link-freetext href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</A>
  </PRE></BLOCKQUOTE><BR></BODY></HTML>