The Architecture Diagram given above explains the high-level design of the application.
Given below is a quick overview of the main components and how they work with each other.
Main components of the architecture
SkyControl
is responsible for:
The rest of the app consists of five components.
How the architecture components interact with each other
The sequence diagram below shows how the components interact with each other for the scenario where the user issues
a valid flight add
command.
Each of the component is initialised in SkyControl
, the parse
, execute
and insertIntoFile
methods are
called by the run
method in SkyControl
which continuously takes in user input and executes accordingly until the app
is shut down.
Here is a partial class diagram of the Ui
component.
The Ui
component consists of:
Ui
: Manages access to the Scanner
object that reads user input and also contains all the methods
for printing to the user.
It also contains methods which return strings to be printed to the user.Below is a partial class diagram that shows an overview of the Parser
component.
Certain boolean methods and variables in Parser
class used to classify the user input are not included for simplicity.
The Parser
component consists of:
Parser
: Handles the user input and determines which specific parser class’s method to be usedFlightParser
: Takes in the parsed user input from Parser
and instantiates a new AddFlightCommand
,
or DeleteFlightCommand
, or ListFlightCommand
to be executed.PassengerParser
: Takes in the parsed user input from Parser
and instantiates a new AddPassengerCommand
,
or DeletePassengerCommand
, or ListPassengerCommand
to be executed.ModificationParser
: Takes in the parsed user input from Parser
and instantiates a new ModifyFlightNumCommand
,
or ModifyGateNumCommand
, or DelayFlightCommand
to be executed.Here is a partial class diagram that shows an overview of the Command
component.
Trivial methods such as getters are omitted from the diagram for simplicity. The overriden execute()
method
is also taken out to improve visibility of the association.
The Command
component consists of:
Command
: An abstract class that standardises the format of a command with the abstract method execute()
, the other specific command classes override execute()
to call the corresponding
operations such as adding or deleting.AddFlightCommand
: Handles the case when the command is to add a flightDeleteFlightCommand
: Handles the case when the command is to delete a flightListFlightCommand
: Handles the case when the command is to list all the flightsDelayFlightCommand
: Handles the case when the command is to delay a flightModifyFlightNumCommand
: Handles the case when the command is to change the flight numberModifyGateNumCommand
: Handles the case when the command is to change the gate numberAddPassengerCommand
: Handles the case when the command is to add a passengerDeletePassengerCommand
: Handles the case when the command is to delete a passengerListPassengerCommand
: Handles the case when the command is to list all the passengersExitCommand
: Handles the case when the command is to exit the application.Below is a partial class diagram that shows an overview of the OperationList
component.
The various methods implemented to ensure the operations are done correctly are not included to maintain simplicity.
The OperationList
component consists of:
OperationList
: An abstract class that contains the flight and passengers information.
It also contains abstract methods of the operations to be implemented
by the FlightList
or PassengerList
class.FlightList
: Implements the various operations such as adding, deleting and listing of flights
by inheriting the abstract methods provided in OperationList
.
Contains various methods to check the validity of the operation called, throws an exception otherwise.PassengerList
: Implements the various operations such as adding AddOperation()
, deleting DeleteOperation()
of passengers by inheriting the abstract methods provided in OperationList
.
Contains various methods to check the validity of the operation called, throws an exception otherwise.Below is a partial class diagram that shows an overview of the Storage
component.
The Storage
component consists of:
Storage
: Handles the file related operations such as creation of files and reading from files or saving to files.To add on, the Storage
component is designed to only access the following folders:
1.data/
:For SkyControl.txt file.
The rationale behind standardizing a specific folder to read/save to, is to ensure that all relevant files can be found in the same location, which makes it easier for users to find the files they are looking for.
The seedu.duke.exceptions
package contains the SkyControlException
class and SyncException
class which are used
by the various components to be thrown as exceptions and print specific error messages to the console.
This section would focus on explaining the application flow and the specifics on how the features are implemented.
List of Commands
The following sequence diagrams to showcase the list of commands,
⚠️NOTE FOR ALL SEQUENCE DIAGRAM
- Exceptions are omitted for readability.
- parser() method will not be reflected in order to improve readability.
The command Add a passenger adds passenger details of a particular passenger to the passenger list.
Sequence Diagram
departureTime
and gateNumber
from the respective flight detail
in FlightList and appends the details to the lineInput.AddPassengerCommand
is instantiated, the execute
method is called from the SkyControl
class with passenger list and user input as method parameters.AddPassengerCommand
then calls the method addOperation(String passengerDetail)
within the PassengerList
class.getPassengerDetails(String passengerDetail)
method then extracts each of the passenger detail into an attribute in
the PassengerList
classpassenger
object of the class PassengerInfo
is instantiated using the attributes retrieved from the method in
Step 4. The passenger
object is then added to the list of passengersUi
class level method showAddedPassenger(PassengerInfo passenger)
is used to display to the user that passenger
has been added to the list successfully.A delete function that removes a passenger’s detail from the passenger’s log book is
facilitated by DeletePassengerCommand
. It extends an abstract Command
with an override method called execute
.
The abstract Command
extends a Parser
which holds and validates the User input to determine the type of command.
Furthermore, DeletePassengerCommand
implements the following operation:
execute(OperationList passengers, String lineInput)
→ An override method inherited from command
to execute the delete operation that should remove a passenger from the logbook.Sequence diagram
When Parser
verifies that the command is an entity passenger
and delete
operation,
DeletePassengerCommend
is instantiated.
execute(passenger, lineInput)
will run within DeletePassengerCommend
which in turn would call on deleteOperation(passengerDetail)
in PassengerList
class.deleteOperation(passengerDetail)
, it would loop the arraylist passengers
obtained from OperationList
.passenger
from passengers
. ELse, return without deletion.A list function lists out all passengers’ details in table form which is facilitated by ListPassengerCommand
. It
extends an abstract Command
with an override method called execute
.
The abstract Command
extends a Parser
which holds and validates the User input to determine the type of command.
Furthermore, ListPassengerCommand
implements the following operation:
execute(OperationList passengers, String lineInput)
→ An override method inherited from command
to execute the list operation that should list out all the passengers from the logbook.Sequence diagram
When Parser
verifies that the command is an entity passenger
and list
operation,
ListPassengerCommend
is instantiated.
execute(passenger, lineInput)
will run within ListPassengerCommend
which in turn would call on listOperation()
in PassengerList
class.listOperation()
, it would first check if arraylist passengers
obtained
from OperationList
is empty or not.passengers
is empty, prints empty table, else prints respective passenger details in table form.The Add a flight function adds a flight with its corresponding details to the flight logbook.
Sequence Diagram
When the Parser
recognizes the add flight
command, the AddFlightCommand()
is instantiated.
AddFlightCommand
then implements a new addOperation(lineInput:String)
in FlightList
getFlightDetails(flightDetails:String)
extracts the various flight details into an attribute.FlightInfo
is then instantiated using the details retrieved from the previous step. And the flight Object can then be added to the flight array list.showFlightAddedMessage()
in the UI class prints a message to inform the user that they have added the flight.A delete function which allows the user to delete a flight specified with its flight number and departure time from the flight logbook.
This feature is facilitated by DeleteFlightCommand
. It extends an abstract Command
with an override
method execute
. The abstract Command
extends a Parser
which holds and validates the User input
to determine the type of command.
DeleteFlightCommand
implements the following operation:
command
to execute the delete operation that should delete the specified flight from the logbook.The sequence diagram shown below describes the behaviour of the flight delete operation. This scenario assumes that the manager has given a valid ‘flight delete’ command as an input for easier readability.
Sequence Diagram
Assuming that the manager has entered a valid ‘flight delete’ command, parser()
will verify that the command
is an entity flight
and a delete
operation. executeEntity()
runs within SkyControl which will
create an instantiation of DeleteFlightCommand
.
execute(flights, lineInput)
will run within DeleteFlightCommand
which calls
deleteOperation(lineInput)
in FlightList
class.deleteOperaton(lineInput)
, it will check whether the flight number given is valid or not.findAndRemoveFlight(flightNumber)
will search through the entire arraylist flights
to find if the flight number exists and remove it from the arraylist.showFlightRemovedMessage()
is called which prints a message to the user to indicate a
successful delete operationdeletePassengersOnSameFlightNumber(flightNumber)
will also run in deleteOperation(lineInput)
to find and delete
the information of the passengers which contain the flight number that has been successfully removed.There are 2 modify features:
ModifyFlightNumCommand
- Allows the Airport Operations Manager(AOM) to modify the flight number of an existing flight
in the flight list. The changes will be reflected in the passenger list as well for passengers on that flight.ModifyGateNumCommand
- Allows the AOM to modify the gate number of a particular flight and changes will be
reflected for the passengers, similar to ModifyFlightNumCommand
.
⚠️NOTE: Since the two features have the same code structure, we will only be going through the implementation of
ModifyFlightNumCommand
to avoid repetition.
Sequence Diagram
ModifyFlightNumCommand
class is instantiated in SkyControl by the Parser
classes.execute(passengers, lineInput)
is then called from SkyControl. Then, ModifyFlightNumCommand
extracts the
existing flight number and new flight number parameters from the lineInput before
calling the modifyFlightNum(flightNum, newFlightNum)
method in FlightList.FlightList
, if the input parameters are incorrect, a relevant exception is raised and the command terminates.findFlightInfo(flightNum)
and getFlightAttributes(flight)
methods are
called. The former retrieves the FlightInfo object while the latter
extracts the flight attributes of the FlightInfo object.setFlightNum(newFlightNum)
method.Ui
class.execute(passengers, lineInput)
method is called from SkyControl to reflect the changes in flight number
for the respective passengers as well.In the event of a flight not being able to depart on time and needs to be delayed,
the flight delay
command allows AOM to delay the departure time of an existing flight.
Sequence Diagram
When the Parser
recognizes the delay
command has been inputted, DelayFlightCommand
is instantiated.
execute(entityList, lineInput)
will run in the DelayFlightCommand
and call on the delayFLightDeparture
method which helps extract the flight number to be changed and new departure timing from the user lineInput.findFlightInfo
will find the index of the flight to change.getFLightAttributes
is called to retrieve all the relevant flight details from FlightInfo
.setDepartureTime(newDepartureTime)
appends the flight records and change the departure time.showUpdatedDepartureTime(flightNum, oldDepartureTime, newDepartureTime
informs the user the flight delay has been saved.The list function lists out all flight details in a table form which is facilitated by ListFlightCommand
.
It extends an abstract Command
class with an override method called execute
.
When the Parser
recognizes the flight list
command, ListFlightCommand
is instantiated.
ListFlightCommand
would call on the listOperation()
method in the FlightList
.showListOfFlights
in the Ui class. It calls checkEmptyFlightList
to check if the flight
OperationList is empty.numOfFlights == 0
, an empty table is printed. Else, it would print the respective flight details in a table
form.This application helps users(specifically an Airport Operations Planning & Airside Manager) to store and view flight information and passenger information. It includes features such as the ability to add, delete, modify a flight’s details or a passenger’s details.
To sum it up, this application helps an Airport Operations Planning & Airside Manager(AOM) have an easier time keeping track of constant changes in flight scheduling and the relevant passenger details.
Version | As a … | I can … | So that I can … |
---|---|---|---|
v1.0 | AOM | add a passenger details | be able to manually add a passenger details |
v1.0 | AOM | delete a passenger details | be able to delete a passenger details manually |
v1.0 | AOM | add flight detail | be able to manually add flight details |
v1.0 | AOM | remove flight details | be able to manually remove flight details |
v1.0 | AOM | view the details of a passenger | see the details of passengers and identify each passenger |
v1.0 | AOM | view the flight schedule and their timings for each day | see the details of each flight |
v2.0 | AOM | include the flight details before inputting the passenger details | there is no confusion to flight availability |
v2.0 | AOM | change the flight number of different airlines | fix any modifications to the flight information easily |
v2.0 | AOM | change one or many passenger’s boarding gate number | fix any modifications to the passenger information easily |
v2.0 | AOM | include a delay in departure/arrival time for flights | accommodate for any delays in the flights |
v2.0 | AOM | save the flight and passenger details that have been entered | still access them after closing and reopening the program |
v2.1 | AOM | automatically sync up passenger details with flight details | prevent any error in input between passenger and flight detail for same details |
Java-11
or above has been installed.Launch
To launch SkyControl, please follow the instructions on our Getting Started.
Exit
Enter the command quit
to close the program.
To specify a command for flights or passengers, the word flight
and passenger
has to be added in front respectively.
Adding a new flight can be done using the flight add fn/FLIGHT_NUMBER a/AIRLINE d/DESTINATION dt/DEPARTURE_TIME gn/GATE_NUMBER c/CHECKIN_ROW_DOOR
command.
flight add fn/sq832 a/Singapore Airlines d/bangkok dt/1600 gn/05 c/03-03
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Flight added!
flight add fn/sq832 a/Singapore Airlines
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The system is unable to read your command, please try again.
flight add fn/sq832 a/Singapore Airlines d/bangkok dt/7200 gn/05 c/03-03
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Stop! The departure time input format is wrong.
Please try again in 24Hr time format.
flight add fn/WRONG123 a/Singapore Airlines d/bangkok dt/1200 gn/05 c/03-03
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Stop! The flight number input format is wrong.
Please try again with the following format:
'SQ12' - For international flights
'SQ123' - For regional flights
'SQ1234' - For domestic flights
flight add fn/sq832 a/Singapore Airlines d/bangkok dt/7200 gn/x c/y
(where x is not within 00 to 99 while y is not a valid row-door number)flight delete sq832
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FLIGHT SQ832 HAS BEEN DELETED.
flight delete sq456
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FLIGHT SQ832 NOT FOUND.
modify SQ832 fn/SQ654
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Flight number of flight SQ832 is updated to SQ654.
modify SQ654 gn/08
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gate number of flight SQ654 is updated to 08.
delay sq654 dt/2100
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Departure time of flight SQ654 is delayed from 1600 to 2100.
delay sq654 dt/0800
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Stop! Please enter a valid departure time for flight SQ654.
Time must be later than 2100.
passenger add n/Ivan Theng fn/sq654 bg/06 sn/17d
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Passenger IVAN THENG of SQ654 17D has been added.
passenger add n/Susan Lee fn/ke987 bg/34 sn/22e
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Stop! The input passenger detail does not have a flight number that exist yet.
Flight detail of the specific flight number should input first.
passenger delete n/Ivan Theng fn/sq654 sn/17d
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Passenger IVAN THENG from SQ654 of seat number 17D have been
deleted from the passenger list.
1 passenger(s) left on the passenger list.
passenger delete n/Ivan Theng fn/sq654 sn/17d
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The system is unable to delete the specified passenger
as he/she is not found in the passenger list or his/her
detail have been input incorrectly.
passenger add n/Ivan Theng fn/sq832 bg/01 sn/17d
followed by passenger list
delay KE632 dt/2100
then passenger list
Expected: The passenger’s boarding time would automatically change to 45 minutes earlier of
the tracked delayed departure time.The list command has 2 variations:
flight list
passenger list
The first command lists all flights in the flight logbook while the second commands lists all passengers in the passenger logbook.
flight list
+----------------------------------------------------------------------------------------------------------------------------------+
| FLIGHT DETAILS LOGBOOK FOR TERMINAL 1 |
+----------------------------------------------------------------------------------------------------------------------------------+
| FLIGHT NUM | DEPARTURE DATE | AIRLINE | DESTINATION | DEPARTURE TIME | GATE NUM | CHECK-IN ROW/DOOR |
+----------------------------------------------------------------------------------------------------------------------------------+
| SQ654 | 06-11-22 | SINGAPORE AIRLINES | BANGKOK | 2100 | 08 | 03-03 |
+----------------------------------------------------------------------------------------------------------------------------------+
passenger list
+------------------------------------------------------------------------------------------------------------------------------+
| PASSENGER DETAILS LOGBOOK |
+------------------------------------------------------------------------------------------------------------------------------+
| NAME | DEPARTURE DATE | DEPARTURE TIME | FLIGHT NUM | GATE NUM | BOARDING GRP | SEAT NUM | BOARDING TIME |
+------------------------------------------------------------------------------------------------------------------------------+
| IVAN THENG | 06-11-22 | 2100 | SQ654 | 08 | 6 | 17D | 2015 |
+------------------------------------------------------------------------------------------------------------------------------+
flight list
+----------------------------------------------------------------------------------------------------------------------------------+
| FLIGHT DETAILS LOGBOOK FOR TERMINAL 1 |
+----------------------------------------------------------------------------------------------------------------------------------+
| FLIGHT NUM | DEPARTURE DATE | AIRLINE | DESTINATION | DEPARTURE TIME | GATE NUM | CHECK-IN ROW/DOOR |
+----------------------------------------------------------------------------------------------------------------------------------+
| The flight details logbook is empty. |
+----------------------------------------------------------------------------------------------------------------------------------+
passenger list
+------------------------------------------------------------------------------------------------------------------------------+
| PASSENGER DETAILS LOGBOOK |
+------------------------------------------------------------------------------------------------------------------------------+
| NAME | DEPARTURE DATE | DEPARTURE TIME | FLIGHT NUM | GATE NUM | BOARDING GRP | SEAT NUM | BOARDING TIME |
+------------------------------------------------------------------------------------------------------------------------------+
| The passenger details logbook is empty. |
+------------------------------------------------------------------------------------------------------------------------------+
Below is a summary of all the possible commands that you can execute in SkyControl as well as their required formats and an example. Followed by the format that each parameter should adhere to.
Command | Format | Example |
---|---|---|
passenger add |
passenger add n/PASSENGER_NAME fn/FLIGHT_NUMBER bg/BOARDING_GROUP sn/SEAT_NUMBER |
passenger add n/Ivan Theng fn/sq832 bg/01 sn/17d |
flight add |
flight add fn/FLIGHT_NUMBER a/AIRLINE d/DESTINATION dt/DEPARTURE_TIME gn/GATE_NUMBER c/CHECKIN_ROW_DOOR |
flight add fn/KE632 a/Korea Airlines d/Korea dt/1200 gn/32 c/12-03 |
passenger delete |
passenger delete n/PASSENGER_NAME fn/FLIGHT_NUMBER sn/SEAT_NUMBER |
passenger delete n/Ivan Theng fn/sq832 sn/17d |
flight delete |
flight delete FLIGHT_NUMBER |
flight delete ke632 |
passenger list |
passenger list |
passenger list |
flight list |
flight list |
flight list |
modify flight number |
modify FLIGHT_NUMBER fn/NEW_FLIGHT_NUMBER |
modify SQ832 fn/SQ654 |
modify gate number |
modify FLIGHT_NUMBER gn/NEW_GATE_NUMBER |
modify SQ654 gn/08 |
delay |
delay FLIGHT_NUMBER dt/NEW_DEPARTURE_TIME |
delay KE632 dt/2100 |
Table of parameters:
Parameter | Format to adhere by | Example |
---|---|---|
PASSENGER_NAME | Input name should be no more than 24 characters | Ivan Lim |
DEPARTURE_TIME | Input departure time should be in 24 Hours format | 2100 |
NEW_DEPARTURE_TIME | Input departure time should be in 24 Hours format and later than the existing departure time | 2200 |
FLIGHT_NUMBER | Input flight number should start with 2 letter character, followed either by Two numbers for international flights Three numbers for regional flights Four numbers for domestic flights |
SQ12 </br>SQ123 </br>SQ1234 |
NEW_FLIGHT_NUMBER | Input flight number should follow FLIGHT_NUMBER constraints but must not be the same flight code | KE356 |
GATE_NUMBER | Input gate number should be 2 digits and between ranges 00 and 99 | 05 |
NEW_GATE_NUMBER | Input gate number should follow GATE_NUMBER constraints but must not be the same value | 22 |
BOARDING_GROUP | Input boarding Group should not be more than 10 and should be in digit form | 01 |
SEAT_NUMBER | Input Seat number should range between 00A to 99Z | B01 |
SkyControl.txt
file found in the data
directory.