Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented FSM design pattern issue #203 #3116

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

Wessam100
Copy link

What problem does this PR solve?

The PR addresses issue #203 by implementing a Finite State Machine (FSM) to streamline state management in systems where behavior depends on distinct states and transitions

Copy link
Owner

@iluwatar iluwatar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition please ensure that

  • The module contains a main entry point for executing the example (such as App.java)
  • The module contains a README.md with pattern description

Comment on lines +13 to +17
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from parent pom.xml and can be left out

*/
@Override
public void handleEvent(TrafficLightContext context) {
System.out.println("Green Light: Go!");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a proper logger

Comment on lines +38 to +40
public TrafficLightState getCurrentState() {
return currentState;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lombok can be used to get rid of boilerplate such as getters and setters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants