State

xiaoxiao2021-03-06  53

Benefits: • It Keeps State-Specific Behavior Local and Partitions Behavior for Different State. • It makes any state transitions expected.

Applicable Scenarios:. • The behavior of an object depends on its state and it must be able to change its behavior at runtime according on the new state • Operations have large, multipart conditional statements that depend on the state of the object.

转载请注明原文地址:https://www.9cbs.com/read-116591.html

New Post(0)