On 23/06/2009 15:10, Greg Brown wrote:
It might be clearer for shutdown()'s return value to mean "yes, cancel shutdown" (true) or "no, do not cancel shutdown" (false). Also, by default, Eclipse provides a stub method that returns false. An unsuspecting developer could easily be tripped up by this and create an application that will never shut down.

Personal taste: I find the name confusing already, seeing it without context would make me think the method does the shutdown.

Since it it a callback function (presumably to clean up resources or to defer closing if doing a lengthly operation), I would prefer to see it named onShutdown() or something similar. Of course, then, you would have to name the other functions onStartup, onSuspend, onResume. These names break my personal policy of starting function names by a verb, but somehow it shows their status of callback. Not sure if there is a better convention. allowShutdown() is a bit restrictive, and opposed to your proposal. shouldCancelShutdown() is a bit verbose. Both seems to restrict to pure yes/not without the clean-up implication. And doesn't fit with the other methods.

Just my opinion, you might be vehemently opposed to such conventions... :-)

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

Reply via email to