Just to add a comment to this discussion...

> Well, CheckAvailability would perform the actual runtime 
> check (using the XML configuration in the NAnt configuration 
> file, or the behaviour specified by the task), and possibly 
> throw an exception detailing the reason why the task is not 
> available.  The IsAvailable property would just call the 
> CheckAvailability method, and return false if the 
> CheckAvailability method throws an exception.

I realise performance isn't a major issue in a build system, but the
normal reason for having a test (IsAvailable in this case) is to try to
avoid having an exception thrown.  To this end, the actual runtime test
could be separated into a private (protected?) method; CheckAvailability
would delegate to this method and throw an exception on failure,
IsAvailable would delegate and simply return false on failure.


> Still not sure about the name of the property/function 
> though, kinda awkward to have task::exists and 
> task::available.  In order to determine whether a task can be 
> executed you'd have to check the value of both functions ...

It wouldn't be the first place this is found... to perform the check "Is
this property read-only" requires testing both existence and
read-only-ness.

Then again, in both the property::read-only function and the
task::available cases, I think it should be reasonable for the
functionto represent an extended test.  That is, property::read-only
should return false if the property is not set, rather than throwing an
exception.  Similarly, task::available should return false if no task is
defined for that tag, rather than throwing an exception.


Let me know if I'm way off base,

-- Troy

Disclaimer Message:

This message contains confidential information and is intended only for the 
individual(s) named.  If you are not the named addressee you should not disseminate, 
distribute or copy this e-mail. Please immediately delete it and all copies of it from 
your system, destroy any hard copies of it, and notify the sender. E-mail transmission 
cannot be guaranteed to be secure or error-free as information could be intercepted, 
corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. To the 
maximum extent permitted by law, Immersive Technologies Pty. Ltd. does not accept 
liability for any errors or omissions in the contents of this message which arise as a 
result of e-mail transmission.


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to