Skip to content

The State design pattern allows an object to alter its behavior when its internal state changes. The object will appear to change its class.

License

Notifications You must be signed in to change notification settings

bezzad/StateDesignPatternSample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

State Design Pattern

The State design pattern allows an object to alter its behavior when its internal state changes. The object will appear to change its class.

Frequency of use: medium

Participants

The classes and objects participating in this pattern include:

  • Context (ContractContext)

    • defines the interface of interest to clients
    • maintains an instance of a ConcreteState subclass that defines the current state.
  • State (ContractState)

    • defines an interface for encapsulating the behavior associated with a particular state of the Context.
  • Concrete State (Accepted, Cancelled, Draft, Expired, InProgress, Waiting, Completed)

    • each subclass implements a behavior associated with a state of Context

About

The State design pattern allows an object to alter its behavior when its internal state changes. The object will appear to change its class.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages