I just learnt about the State pattern . I would like to know where in core Java / JSF/Servlets code s can I see this pattern being implemented ? I want to see how the state transition is implemented and who plays the role of states
and who plays the role of context
there ?
Asked
Active
Viewed 304 times
0
-
Related: http://stackoverflow.com/questions/1673841/examples-of-gof-design-patterns/2707195#2707195 – BalusC Jan 21 '13 at 11:10
1 Answers
3
In JSF it can be lifecycle processing. Phase
is a state with concrete states: ApplyRequestValuesPhase
, InvokeApplicationPhase
, ProcessValidationsPhase
, RenderResponsePhase
, RestoreViewPhase
, UpdateModelValuesPhase
. Context would be Lifecycle
.
NOTE: This example is from Mojarra implementation of JSF.

partlov
- 13,789
- 6
- 63
- 82
-
2Note that the mentioned `Phase` implementations are Mojarra (`com.sun.faces.*`) specific. MyFaces (`org.apache.myfaces.*`) gave them different names. – BalusC Jan 21 '13 at 11:11