I
I
Ilya Plotnikov2019-05-20 12:39:27
Java
Ilya Plotnikov, 2019-05-20 12:39:27

Recommend FSM for Java?

Hello. For a java 8 Enterprise project, please recommend a high-quality state machine implementation. The project is written in Guice, so there is no way to take the ready-made Spring Statemachine.
For myself, I identified the following requirements in order of priority:

  1. Typed API - we expect that when creating a machine, you can specify the types of events from actions in the signature. Compile-time checking is our everything
  2. Configurations in code . sorry xml we buried you
  3. Compact - no heavy external dependencies (spring statemachine fell off here)
  4. Thread safety - it is expected that when sending an event from different threads, they will be synchronized and the state will change atomically. Non-thread-safe, we will always have time to do it later
  5. Ease of use - the machine should not introduce its own world (akka fsm and other scala) into the project, which will take a week to understand
  6. Lightness - we do not produce garbage for every sneeze. I would like to be able to use one fsm in different situations, ranging from tracking the global state of the application, ending with a use case in short-lived objects

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question