It's late, I know, but I hope not too late... First of all, an excellent
proposal in my view! You make lots of sense and bring clarity to our muddy
minds!

There is one thing that I don't quite follow though, to do with the boolean
returned by execute(). When would you ever return false? To put it another
way, what is the key criterion that determines whether you return false or
throw an exception?

In terms of your proposal:

>    This should return true if everything
>     executed, else false.  Note that a false return signifies that the
>    <b>execution</b> failed, not that the intended result was not
>    reached.  For example, a LoginService that finds out a user's

However, what reasons are there that the execution failed, but didn't
warrant an exception? It seems to me that execute() should just return void.
Pray, shed some light!

Marcel Juffermans

----- Original Message -----
From: Brett McLaughlin <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>
Sent: Wednesday, 26 January 2000 2:29
Subject: [PROPOSAL] Service model re-design

<snip>
>   /**
>    * This is the executable portion of a service.  For a scheduler,
>    *   this would start the event timer; for a parser, it would begin
>    *   parsing of, say, a ClassMap ;-)  You get the idea...
>    * The first thing this method must always do is check the isReady
>    *   flag (@see init()); if it is not true, the
>    *   <code>ServiceException</code> should be thrown signifying things
>    *   aren't ready to go.  If this particular service implementation
>    *   does not need any object paramters, <i>still check the flag!</i>
>    *   The >code>init()</code> method in that instance will simply set
>    *   the flag to true.  This makes these portable and the implementation
>    *   very straightforward.  This should return true if everything
>    *   executed, else false.  Note that a false return signifies that the
>    *   <b>execution</b> failed, not that the intended result was not
>    *   reached.  For example, a LoginService that finds out a user's
>    *   credentials are incorrect would return true because it completed
>    *   its task, even though the outcome wasn't what the user wanted.
>    *
>    * @return boolean - true if all OK, else false
>    * @throws ServiceException - if not ready to execute, or errors
> occur.
>    */
>   public boolean execute() throws ServiceException;
</snip>




------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to