There are two part of this application that I can think of.
- Console app to support few commands.
- Parking lot to execute actions for the command.
Factors to think about.
Console app can be a simple application that takes the commands and execute those command effectively and securely. In this application we can think about so many factors.
- Should support any type of command for any application.
- How frequently the command will be fired based on that we can enable chunk processing and delay processing.
- Since the command will be provided by external application how the output will be consumed.
- Preprocessing and postprocessing to support feature link notifications etc.
Parking app will be simple parking implementation, we will need to care about how the parking action will be handled.
- It will be providing supported command.
- parking action handling strategy, for now we have in memory but in future we can have database strategy.
- Builder pattern.
- Strategy design pattern.
- Command design pattern.
This application is divided in three layer.
-
Console app : This is a generic framework to handle any type of command, This provided an interface ICommand for external application. Right now we have 2 strategy to handle command but in future we can have many more strategy. This provided ConsoleAppContext to build all parameters for execution, client application can provided their own setup.
-
Parking lot app : This is simple parking lot application with provided rule and commands to handle in memory parking, this can be extended for any other parking strategy.
Interactive command-line mode ./parking_lot File comand mode ./parking_lot <filename.txt> <.txt extension is mandatory>
JDK version : 1.8.0_144 Maven version : Latest version of maven