Skip to content

The state is a behavioral design pattern that lets an object alter its behavior when its internal state changes. It appears as if the object changed its class.

Notifications You must be signed in to change notification settings

mehboobali98/State-Design-Pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

State Design Pattern

The repository contains an implementation of the State Design Pattern. The implementation has been done for a Book object in the context of a Library Management System. The book object can have multiple states. They are:

  • Available
  • Issued
  • Reserved
  • Lost

Directory Structure

📦State-Design-Pattern
 ┣ 📂src
 ┃ ┗ 📂StatePattern
 ┃ ┃ ┣ 📜Available.java
 ┃ ┃ ┣ 📜BookContext.java
 ┃ ┃ ┣ 📜BookState.java
 ┃ ┃ ┣ 📜Issued.java
 ┃ ┃ ┣ 📜Main.java
 ┃ ┃ ┗ 📜Reserved.java
 ┣ 📜.gitignore
 ┣ 📜README.md
 ┗ 📜StatePattern.iml

About

The state is a behavioral design pattern that lets an object alter its behavior when its internal state changes. It appears as if the object changed its class.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published