At 21:36 -0700 8/13/03, Craig R. McClanahan wrote:
 > Ted H more or less suggested this, but I think the way to go is to
 > give each command an opportunity to validate any contract
 > pre-conditions, like expecting certain beans to be defined in the
 context.  You could even just leave this up to the command author to
 do in the main execute method, but it might promote good practice if
 it were explicitly in the API.


How would you suggest putting something like this into the API? Adding a method like verifyPreconditions() seems like it makes things harder instead of easier -- why not just let the execute() method throw an IllegalStateException (or something like that) if its preconditions are not met?

I'm not sure I see why a "verify..." method makes things harder, except that it's an awkward method name. However, I can't think of any that I like much better, which I sometimes take as a sign that an idea isn't strong enough. But sometimes other folks on the list pick up on the bud of an idea and take it the next step.


I don't think I feel strongly enough about this to make much of a case for it. IllegalStateException will handle this problem.

Joe

--
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "If nature worked that way, the universe would crash all the time." --Jaron Lanier


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to