You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: state/README.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,10 @@ change its class.
20
20
21
21
##Explanation
22
22
23
-
Realworld example
23
+
Real-world example
24
24
25
25
>When observing a mammoth in its natural habitat it seems to change its behavior based on the
26
-
>situation. It may first appear calm but over time when it detects a threat it gets angry and
26
+
>situation. It may first appear calm, but over time when it detects a threat, it gets angry and
27
27
>dangerous to its surroundings.
28
28
29
29
In plain words
@@ -125,7 +125,7 @@ public class Mammoth {
125
125
}
126
126
```
127
127
128
-
And hereis the full example how the mammoth behaves over time.
128
+
Hereis the full example of how the mammoth behaves over time.
129
129
130
130
```java
131
131
var mammoth=newMammoth();
@@ -156,7 +156,7 @@ Use the State pattern in either of the following cases
156
156
* An object's behavior depends on its state, and it must change its behavior at run-time depending on that state
157
157
* Operations have large, multipart conditional statements that depend on the object's state. This state is usually represented by one or more enumerated constants. Often, several operations will contain this same conditional structure. The State pattern puts each branch of the conditional in a separate class. This lets you treat the object's state as an object in its own right that can vary independently from other objects.
158
158
159
-
##Real world examples
159
+
##Known uses
160
160
161
161
*[javax.faces.lifecycle.Lifecycle#execute()](http://docs.oracle.com/javaee/7/api/javax/faces/lifecycle/Lifecycle.html#execute-javax.faces.context.FacesContext-) controlled by[FacesServlet](http://docs.oracle.com/javaee/7/api/javax/faces/webapp/FacesServlet.html), the behavior is dependent on current phase of lifecycle.
162
162
*[JDiameter - Diameter State Machine](https://github.com/npathai/jdiameter/blob/master/core/jdiameter/api/src/main/java/org/jdiameter/api/app/State.java)