myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Lessard" <>
Subject [TRINIDAD] ProcessMenuModel changes
Date Fri, 10 Aug 2007 17:10:28 GMT
Hello everybody,

Currently Trinidad includes a ProcessMenuModel class that contains
undesirable methods. The complete method list (not including inherited ones)

   - public boolean isImmediate()
   - public boolean isReadOnly()
   - public boolean isVisited()
   - public void clearMaxPath()
   - public void setMaxPathKey(Object maxPathKey)
   - public Object getMaxPathKey()

The methods involving maxPathKey are the ones annoying me the most. However,
as it's part of the public API we have to keep backward compatibility as
much as possible. Note also that isReadOnly should not named that way as
readOnly support was removed from process classes in favor of disabled since
a readOnly link did not make much sense.

Anyway, I would rather have the following class structure and method

public abstract class ProcessModel

   - public abstract boolean isDisabled();
   - public abstract boolean isImmediate();
   - public abstract boolean isVisited();
   - public abstract boolean isNextStepAvailable(); /* Could be optional
   or maybe in a subclass, this would check if there's a step before the
   current one */
   - public abstract boolean isPreviousStepAvailable(); /* As above */
   - public abstract Object getNextStep(); /* As above */
   - public abstract Object getPreviousStep(); /* As above */

public class MaxPathKeyProcessModel extends ProcessModel /* Or a better name

   - Implements all methods using the old ProcessMenuModel code.

public class ProcessMenuModel extends MaxPathKeyProcessModel

   - Empty class except for isReadOnly() that should return

The structure above would clean up the Model class that really shouldn't
contain very implementation specific code like the max path key algorithm
and would allow us to add new ProcessModel classes with more
functionalities. For example I had one using a mode for step access right

The previous/next step methods could be useful for page templates since it
would be possible to include the train in the header as well as a previous
and next step buttons in the page footer in a generic way using the very
same process model. Note that we might have to also include methods like
isPreviousVisited(), isPreviousDisabled() and such to fully support that.

Opinions, suggestions?


~ Simon

View raw message