Re: [dialog2] Advance failures and names

2006-08-30 Thread Rahul Akolkar

On 8/30/06, Craig McClanahan [EMAIL PROTECTED] wrote:

On 8/30/06, Rahul Akolkar [EMAIL PROTECTED] wrote:

 Some notes from looking at the dialog2 sandbox modules:

 a) Dealing with failures in:

 Context#advance(FacesContext, String)

 It is possible that advancing a dialog might fail (say there is no
 such state defined as indicated by a transition target), and while
 many of these errors can be caught by static analysis and model
 checking tooling (indeed, Commons SCXML, for example will warn of many
 such errors at parsing time), how should the engine that gets plugged
 in report such an error, if one at all occurs? Doesn't make much sense
 to have a typed exception here since its going to bubble up to the
 handleNavigation() method without a throws clause.


Some sort of logging would probably be appropriate.  We could also define an
event (in the JavaBeans sense, where you can register listeners) on the
context class, so the app can choose to be notified when an exception
occurs, and take whatever action *it* wants to take.


snip/

Sounds good, I can take a stab at the JavaBeans listener if we want to
do this (after the long weekend). Do we just want error notifications
or progress notifications as well?



NIT-PICKS (yes, I'm aware I'm nit-picking below ;-):

 b) In line with FacesContext, InitialContext, PageContext etc., should
 we rename the Context interface to DialogContext? Context seems way
 too generic and would make the variable declarations more readable,
 IMO. Also appropriate for me to point out that there is a Context
 interface in Commons SCXML but there was lot of time spent mulling
 over that name FWIW now.


I think you're right ... it's hard to remember what kind of context you're
talking about otherwise.  I'll make this change when I import your
shale-dialog2-scxml stuff tonight.  (Gotta love refactoring engines in IDEs
:-).

How about Contexts though?  DisplayContexts would be an obvious choice

but

the actual functionality of the class is a little more than just a cache of
the active things.  Maybe DialogContextManager?


snap/

DialogContextManager sounds appropriate to me.

-Rahul





Craig




Re: [dialog2] Advance failures and names

2006-08-30 Thread Craig McClanahan

On 8/30/06, Rahul Akolkar [EMAIL PROTECTED] wrote:


Sounds good, I can take a stab at the JavaBeans listener if we want to
do this (after the long weekend). Do we just want error notifications
or progress notifications as well?



Progress indications make a lot of sense.  IIRC, this was one of Sean's
motiviations for specializing some of the classes in the original
implementation.  Some things that might make sense to treat as notification
events:

* Started dialog x

* Ended dialog x

* Entered state x

* Exited state x (via transition x)

* Excepton thrown from state

* Suspending operation due to needing user input (i.e. when you
 return from a view state or an exit state

Craig