-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the scenario wiki!
Each time when we write the CLI application on Java, we have to answer the following questions and then implement the corresponding logic:
- design the menu system:
- which menu should be displayed first?
- which items (choices) should each menu contain?
- which menu should be displayed when user chooses the action or types some text?
- how to prevent the user from typing incorrect value?
- how to call the needed business logic when some action is chosen?
- how to be sure that menu won't fall into never-ending cycle (user won't be able to exit the app)?
... and many others.
It leads to nested if or switch statements, input control classes and other boilerplate code.
The main purpose of the scenario library is to delegate all the CLI menu handling to it, so it will act as a service.
Add the following dependency to your project's pom.xml:
WARNING! The release version is not published yet and will be ready when this wiki page is complete.
<dependency>
<groupId>com.github.prifiz</groupId>
<artifactId>scenario</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Okay, you've just added the needed dependency to your project. What's next?
It's time to forget that you're developer and start designing the menu.
It is really easy. You can even ask someone without any programming skills to configure it. The only required thing to know here is YAML syntax.