By: Team SE-EDU
Since: Jun 2016
Licence: MIT
- 1. Introduction
- 2. Setting up
- 3. Design
- 4. Implementation
- 4.1. Undo/Redo feature
- 4.2. Autocomplete
- 4.3. Add Command
- 4.4. Adding a Pet Patient
- 4.5. Display List of PetPatients
- 4.6. Show Appointments on calendar
- 4.7. Finding a Contact or Pet Patient
- 4.8. Listing Appointments of Different Views and Dates
- 4.9. Deletion and Force Deletion of Contact, Pet Patient and Appointment
- 4.10. Deletion and Force Deletion of Contact, Pet Patient and Appointment
- 4.11. [Proposed] Data Encryption
- 4.12. Logging
- 4.13. Configuration
- 5. Documentation
- 6. Testing
- 7. Dev Ops
- Appendix A: Suggested Programming Tasks to Get Started
- Appendix B: Product Scope
- Appendix C: User Stories
- Appendix D: Use Cases
- Appendix E: Non Functional Requirements
- Appendix F: Glossary
- Appendix G: Product Survey
- Appendix H: Instructions for Manual Testing
Welcome to Medeina! Medeina is a application designed to help veterinarians and their assistants to manage contacts and appointments. Medeina is a command-line based application, all actions can be done using only keyboard. This developer guide aims to help new developers to get started with Medeina, and also serves as a reference for even experienced Medeina contributors.
To successfully install and run Medeina, you’ll need the following:
-
JDK
1.8.0_60
or laterℹ️Having any Java 8 version is not enough.
This app will not work with earlier versions of Java 8. -
IntelliJ IDE
ℹ️IntelliJ by default has Gradle and JavaFx plugins installed.
Do not disable them. If you have disabled them, go toFile
>Settings
>Plugins
to re-enable them.
To set up Medeina in your computer, follow these steps:
-
Fork this repo, and clone the fork to your computer
-
Open IntelliJ (if you are not in the welcome screen, click
File
>Close Project
to close the existing project dialog first) -
Set up the correct JDK version for Gradle
-
Click
Configure
>Project Defaults
>Project Structure
-
Click
New…
and find the directory of the JDK
-
-
Click
Import Project
-
Locate the
build.gradle
file and select it. ClickOK
-
Click
Open as Project
-
Click
OK
to accept the default settings -
Open a console and run the command
gradlew processResources
(Mac/Linux:./gradlew processResources
). It should finish with theBUILD SUCCESSFUL
message.
This will generate all resources required by the application and tests.
To check if the setup is successful:
-
Run the
seedu.address.MainApp
and try a few commands -
Run the tests to ensure they all pass.
Before you start contributing to Medeina, the following configurations are required:
This project follows oss-generic coding standards. IntelliJ’s default style is mostly compliant with ours but it uses a different import order from ours. To rectify,
-
Go to
File
>Settings…
(Windows/Linux), orIntelliJ IDEA
>Preferences…
(macOS) -
Select
Editor
>Code Style
>Java
-
Click on the
Imports
tab to set the order-
For
Class count to use import with '*'
andNames count to use static import with '*'
: Set to999
to prevent IntelliJ from contracting the import statements -
For
Import Layout
: The order isimport static all other imports
,import java.*
,import javax.*
,import org.*
,import com.*
,import all other imports
. Add a<blank line>
between eachimport
-
Optionally, you can follow the UsingCheckstyle.adoc document to configure Intellij to check style-compliance as you write code.
After forking the repo, links in the documentation will still point to the se-edu/addressbook-level4
repo. If you plan to develop this as a separate product (i.e. instead of contributing to the se-edu/addressbook-level4
) , you should replace the URL in the variable repoURL
in DeveloperGuide.adoc
and UserGuide.adoc
with the URL of your fork.
Set up Travis to perform Continuous Integration (CI) for your fork. See UsingTravis.adoc to learn how to set it up.
After setting up Travis, you can optionally set up coverage reporting for your team fork (see UsingCoveralls.adoc).
ℹ️
|
Coverage reporting could be useful for a team repository that hosts the final version but it is not that useful for your personal fork. |
Optionally, you can set up AppVeyor as a second CI (see UsingAppVeyor.adoc).
ℹ️
|
Having both Travis and AppVeyor ensures your App works on both Unix-based platforms and Windows-based platforms (Travis is Unix-based and AppVeyor is Windows-based) |
When you are ready to start coding,
-
Get some sense of the overall design by reading Section 3.1, “Architecture”.
-
Take a look at Appendix A, Suggested Programming Tasks to Get Started.
The Architecture Diagram given above explains the high-level design of the App. Given below is a quick overview of each component.
💡
|
The .pptx files used to create diagrams in this document can be found in the diagrams folder. To update a diagram, modify the diagram in the pptx file, select the objects of the diagram, and choose Save as picture .
|
Main
has only one class called MainApp
. It is responsible for,
-
At app launch: Initializes the components in the correct sequence, and connects them up with each other.
-
At shut down: Shuts down the components and invokes cleanup method where necessary.
Commons
represents a collection of classes used by multiple other components. Two of those classes play important roles at the architecture level.
-
EventsCenter
: This class (written using Google’s Event Bus library) is used by components to communicate with other components using events (i.e. a form of Event Driven design) -
LogsCenter
: Used by many classes to write log messages to the App’s log file.
The rest of the App consists of four components.
Each of the four components
-
Defines its API in an
interface
with the same name as the Component. -
Exposes its functionality using a
{Component Name}Manager
class.
For example, the Logic
component (see the class diagram given below) defines it’s API in the Logic.java
interface and exposes its functionality using the LogicManager.java
class.
The above diagram shows the relations between each subcomponents within the Logic component.
The Sequence Diagram below shows how the components interact for the scenario where the user issues the command delete -o 1
.
ℹ️
|
Note how the Model simply raises a AddressBookChangedEvent when the Address Book data are changed, instead of asking the Storage to save the updates to the hard disk.
|
The diagram below shows how the EventsCenter
reacts to that event, which eventually results in the updates being saved to the hard disk and the status bar of the UI being updated to reflect the 'Last Updated' time.
ℹ️
|
Note how the event is propagated through the EventsCenter to the Storage and UI without Model having to be coupled to either of them. This is an example of how this Event Driven approach helps us reduce direct coupling between components.
|
The sections below give more details of each component.
The following diagram displays the structure of the UI component.
API : Ui.java
The UI consists of a MainWindow
that is made up of parts e.g.CommandBox
, ResultDisplay
, PersonListPanel
, StatusBarFooter
etc. All these, including the MainWindow
, inherit from the abstract UiPart
class.
The UI
component uses JavaFx UI framework. The layout of these UI parts are defined in matching .fxml
files that are in the src/main/resources/view
folder. For example, the layout of the MainWindow
is specified in MainWindow.fxml
The UI
component,
-
Executes user commands using the
Logic
component. -
Binds itself to some data in the
Model
so that the UI can auto-update when data in theModel
change. -
Responds to events raised from various parts of the App and updates the UI accordingly.
The following diagram displays the structure of the Logic component.
The following diagram displays the structures of the commands in Logic component.
XYZCommand
and Command
in Figure 6, “Structure of the Logic Component”API :
Logic.java
-
Logic
uses theAddressBookParser
class to parse the user command. -
This results in a
Command
object which is executed by theLogicManager
. -
The command execution can affect the
Model
(e.g. adding a person) and/or raise events. -
The result of the command execution is encapsulated as a
CommandResult
object which is passed back to theUi
.
API : Model.java
The Model
,
-
stores a
UserPref
object that represents the user’s preferences. -
stores Medeina’s data.
-
exposes unmodifiable
ObservableList<Person>
,ObservableList<PetPatient>
andObservableList<Appointment>
that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. -
does not depend on any of the other three components.
API : Storage.java
The Storage
component,
-
can save
UserPref
objects in json format and read it back. -
can save Medeina’s Address Book data in xml format and read it back.
This section describes some noteworthy details on how certain features are implemented.
The undo/redo mechanism is facilitated by an UndoRedoStack
, which resides inside LogicManager
. It supports undoing and redoing of commands that modifies the state of Medeina (e.g. add
, edit
). Such commands will inherit from UndoableCommand
.
UndoRedoStack
only deals with UndoableCommands
. Commands that cannot be undone will inherit from Command
instead. The following diagram shows the inheritance diagram for commands:
As you can see from the diagram, UndoableCommand
adds an extra layer between the abstract Command
class and concrete commands that can be undone, such as the DeleteCommand
. Note that extra tasks need to be done when executing a command in an undoable way, such as saving the state of Medeina before execution. UndoableCommand
contains the high-level algorithm for those extra tasks while the child classes implements the details of how to execute the specific command. Note that this technique of putting the high-level algorithm in the parent class and lower-level steps of the algorithm in child classes is also known as the template pattern.
Commands that are not undoable are implemented this way:
public class ListCommand extends Command {
@Override
public CommandResult execute() {
// ... list logic ...
}
}
With the extra layer, the commands that are undoable are implemented this way:
public abstract class UndoableCommand extends Command {
@Override
public CommandResult execute() {
// ... undo logic ...
executeUndoableCommand();
}
}
public class DeleteCommand extends UndoableCommand {
@Override
public CommandResult executeUndoableCommand() {
// ... delete logic ...
}
}
Suppose that the user has just launched the application. The UndoRedoStack
will be empty at the beginning.
The user executes a new UndoableCommand
, delete 5
, to delete the 5th person in Medeina’s address book. The current state of Medeina is saved before the delete 5
command executes. The delete 5
command will then be pushed onto the undoStack
(the current state is saved together with the command).
As the user continues to use the program, more commands are added into the undoStack
. For example, the user may execute add n/David …
to add a new person.
ℹ️
|
If a command fails its execution, it will not be pushed to the UndoRedoStack at all.
|
The user now decides that adding the person was a mistake, and decides to undo that action using undo
.
We will pop the most recent command out of the undoStack
and push it back to the redoStack
. We will restore Medeina to the state before the add
command executed.
ℹ️
|
If the undoStack is empty, then there are no other commands left to be undone, and an Exception will be thrown when popping the undoStack .
|
The following sequence diagram shows how the undo operation works:
The redo does the exact opposite (pops from redoStack
, push to undoStack
, and restores Medeina to the state after the command is executed).
ℹ️
|
If the redoStack is empty, then there are no other commands left to be redone, and an Exception will be thrown when popping the redoStack .
|
The user now decides to execute a new command, clear
. As before, clear
will be pushed into the undoStack
. This time the redoStack
is no longer empty. It will be purged as it no longer make sense to redo the add n/David
command (this is the behavior that most modern desktop applications follow).
Commands that are not undoable are not added into the undoStack
. For example, list
, which inherits from Command
rather than UndoableCommand
, will not be added after execution:
The following activity diagram summarize what happens inside the UndoRedoStack
when a user executes a new command:
-
Alternative 1 (current choice): Add a new abstract method
executeUndoableCommand()
-
Pros: We will not lose any undone/redone functionality as it is now part of the default behaviour. Classes that deal with
Command
do not have to know thatexecuteUndoableCommand()
exist. -
Cons: Hard for new developers to understand the template pattern.
-
-
Alternative 2: Just override
execute()
-
Pros: Does not involve the template pattern, easier for new developers to understand.
-
Cons: Classes that inherit from
UndoableCommand
must remember to callsuper.execute()
, or lose the ability to undo/redo.
-
-
Alternative 1 (current choice): Saves the entire Medeina.
-
Pros: Easy to implement.
-
Cons: May have performance issues in terms of memory usage.
-
-
Alternative 2: Individual command knows how to undo/redo by itself.
-
Pros: Will use less memory (e.g. for
delete
, just save the person being deleted). -
Cons: We must ensure that the implementation of each individual command are correct.
-
-
Alternative 1 (current choice): Only include commands that modifies Medeina (
add
,clear
,edit
).-
Pros: We only revert changes that are hard to change back (the view can easily be re-modified as no data are * lost).
-
Cons: User might think that undo also applies when the list is modified (undoing filtering for example), * only to realize that it does not do that, after executing
undo
.
-
-
Alternative 2: Include all commands.
-
Pros: Might be more intuitive for the user.
-
Cons: User have no way of skipping such commands if he or she just want to reset the state of Medeina * and not the view. Additional Info: See our discussion here.
-
-
Alternative 1 (current choice): Use separate stack for undo and redo
-
Pros: Easy to understand for new Computer Science student undergraduates to understand, who are likely to be * the new incoming developers of our project.
-
Cons: Logic is duplicated twice. For example, when a new command is executed, we must remember to update * both
HistoryManager
andUndoRedoStack
.
-
-
Alternative 2: Use
HistoryManager
for undo/redo-
Pros: We do not need to maintain a separate stack, and just reuse what is already in the codebase.
-
Cons: Requires dealing with commands that have already been undone: We must remember to skip these commands. Violates Single Responsibility Principle and Separation of Concerns as
HistoryManager
now needs to do two * different things.
-
The autocomplete feature serves to enhance user experience in using the Command Line Interface (CLI). It currently supports command words, options, prefixes, and parameters such as tags, contact’s NRIC, pet patient’s name, breed, species, colour and blood type.
The implementation logic of the autocomplete feature resides in the UI
component. The autocomplete feature is driven by a ChangeListener
attached to commandTextField.textProperty()
in CommandBox.java
. Once the ChangeListener
registers any changes in the content of commandTextField
, triggerAutocomplete()
will be executed.
Suppose that the user is launching Medeina. Before the Graphical User Interface (GUI) is ready, a CommandBox
object will be initialized for the user to enter commands. The following diagram illustrates a sequence of method calls, starting with the initialization of CommandBox
, followed by the initialization of an instance of Autocomplete
, and then calling 3 set attribute methods in the Logic
component. Subsequently, suppose the user has typed add -p n/Happy s/Cat b/Persian c/Calico bt/A -o nr/
. The diagram shows a sequence of method calls, starting with triggerAutocomplete(), to get autocomplete suggestions for NRIC to be shown in a context menu.
Autocomplete.java
encompasses the logic for parsing user input in the CLI and determining what autocomplete suggestions are to be passed back to CommandBox.java
. Data required for autocomplete, such as a list of command words, prefixes, options and parameters in Medeina, are retrieved from the Logic
component. All data required by Autocomplete
are consolidated in a similar way in the Logic
component.
The following code shows how contact’s NRIC and tags are consolidated:
public void setAttributesForPersonObjects() {
nricInModel = new HashSet<>();
personTagsInModel = new HashSet<>();
for (Person p : model.getAddressBook().getPersonList()) {
nricInModel.add(p.getNric().toString());
personTagsInModel.addAll(p.getTags());
}
}
public Set<String> getAllNric() {
return nricInModel;
}
public Set<String> getAllPersonTags() {
Set<String> personTags = personTagsInModel.stream()
.map(pt -> pt.tagName)
.collect(Collectors.toSet());
return personTags;
}
You may have noticed that in sequence diagram above (Figure 11), Autocomplete
is a singleton class that is initialized only once, and there is only 1 instance of CommandBox
in the application. You may be wondering "can the 3 set attribute methods in the Logic
component be called only once?". If you are currently unsure, imagine that the user is constantly adding new contacts to Medeina. However, Autocomplete
uses only data from when Medeina was launched.
The answer to the question is definitely no. The set attributes methods have to be called whenever there is a change in Medeina’s data, otherwise the autocomplete suggestions will not be up to date.
The following code snippet ensures that the data used by Autocomplete
is kept updated.
public void handleAddressBookChangedEvent(AddressBookChangedEvent a) {
init(this.logic); // calls the 3 set attributes methods
logger.info(LogsCenter.getEventHandlingLogMessage(a, "Local data has changed, update autocomplete data"));
}
-
Alternative 1 (current choice): All Data is updated only when
AddressBookChangedEvent
is raised.-
Pros: Efficient and with minimal redundant updates.
-
Cons: Implementation is less straight-forward.
-
-
Alternative 2 : Updates the specific required data e.g. NRIC, whenever autocomplete is triggered.
-
Pros: Easy to implement.
-
Cons: Redundant updates. Required data will remain the same, except only when add, delete, or edit commands are executed.
-
-
Alternative 3: All Data is updated whenever autocomplete is triggered.
-
Pros: Easy to implement.
-
Cons: Many redundant data updates. Running for-loops in the
Logic
component for every character the user types, is resource-intensive.
-
-
Alternative 1 (current choice): Implement change listener to automatically track user input and provide autocomplete suggestions.
-
Pros: Great improvement in user experience, as Medeina has long and complex command syntax.
-
Cons: Logic for handling caret position and command syntax parsing is complicated and can be prone to bugs.
-
-
Alternative 2: User has to press a specific key e.g. tab to invoke autocompletion.
-
Pros: Less logic to account for, and is thus easier to implement.
-
Cons: User experience is compromised.
-
-
Combining variations of the same type of command into a single command with parsing options
-
add Person : add -o n/NAME p/PHONE NUMBER e/EMAIL a/ADDRESS nr/NRIC [t/TAGS]…
-
add Pet Patient : add -p n/NAME s/SPECIES b/BREED c/COLOUR bt/BLOOD TYPE [t/TAGS]… -o [WHO IS THE OWNER]
-
add Appointment : add -a d/DATE r/REMARK [t/TAGS]… -o [OWNER] -p [PET PATIENT INVOLVED]
-
add -o [OWNER INFO] -p [PET INFO] -a [APPOINTMENT INFO]
-
Keeping to one main command is simpler and more user-friendly as compared to having variations of the same type of command. To reduce the amount of typing required, command syntax should be kept as compact as possible. Instead of having separate add
commands for each of the 3 classes, combine them into a one-liner command to reduce typing redundant information from dependencies.
Currently, adding of pet patients is achieved by AddPetPatientCommand
. It allows the user to add the details of pet patients, and subsequently stores the details within the storage file.
The implementation of AddPetPatientCommand
is rather similar to that of AddCommand
.
ℹ️
|
AddPetPatientCommand , as well as AddCommand , extends UndoableCommand .
|
public class AddPetPatientCommand extends UndoableCommand { // logic for AddPetPatientCommand }
This brings us to the next section on the design considerations of AddPetPatientCommand.
-
Alternative 1 (current choice): The command extends
UndoableCommand
-
Pros: We can make use of the undo / redo function that was previously implemented. This also allows our users to correct any mistakes that they might have made while keying in the information of the pet patients.
-
Cons: Developers who join our team in the future may have trouble understanding the code base (since we have both
UndoableCommand
andCommand
).
-
-
Alternative 2: The command extends
Command
instead.-
Pros: We simplify the code base by removing the use of
UndoableCommand
. -
Cons: Users are unable to undo their mistakes. Instead, they will have to go through the hassle of editing / deleting pet patients to resolve the error on their part.
-
As of now, the linking of pet patients to their respective owners (and also appointments) has not been implemented.
The implementation of PetPatient
tags (i.e. having a separate list of tags from Person
) is currently ongoing; as such, there is no support for tagging of pet patients yet.
Future work on this feature will address the current limitations that we have.
Linking of pet patients to their respective owners and appointments will be implemented. Tagging of the pet patients will also be implemented, as this is crucial to the searching of medical history of pets for the user.
Since Veterinarians and their assistants have the need to view the PetPatients as a list and see how many PetPatients belong to the same Owner. It is necessary to implement the PetPatient List feature.
-
Alternative 1: Use tab function to switch between PetPatientList and PersonList
-
Pros: The UI will be neat to see, saves more space for calendar view
-
Cons: The user will not be able to see both PetPatient and Owners at the same time.
-
-
ALternative 2: Implement another Panel to display PetPatients.
-
Pros: User will be able to see both lists at the same time
-
Cons: Takes up more space, making it difficult to display appointments in the future.
-
More command and features relating to PetPatient List are to be properly developed, the tags of PetPatients are not properly organised.
Since veterinarians and their assistants have the need to constantly check their schedule for upcoming appointments, a calender feature is required to show future appointments.
Third party API CalendarFX
is used as a Java calendar frame to show Appointments.
-
Alternative 1: Use
iCalendar
from Jfxtra library-
Pros: Easy to implement, convenient to use. Can easily import from Jfxtra library.
-
Cons: UI styles are limited, the API is limited;
-
-
Alternative 2 (current choice): Implement CalendarFX API library.
-
Pros: Versatile APIs such as set style for each calendar, and much better looking UI than iCalendar.
-
Cons: Extra work required to integrate CalendarFX files into project, and may cause build problems if not implemented properly.
-
There’s a known issue in CalendarFx, when switch from a year with appointments inside to a year without, the CalendarFx will still color the same appointment data despite there’s no entry on that date.
Users and developers should know that this issue is embedded inside CalendarFx, and hopefully can be resolved in future versions of CalendarFx.
The find function allows users to look for contacts or pet patients.
Users are unable to find appointment related elements as the Appointment
listing function in the calendar is different from the listing function of the other classes of Person
and PetPatient
. As such, there is currently no implementation to find an appointment based on types or remarks, which may pose as inconvenience to veterinarians, should they want to search by a specific type of appointment or remark.
The command allows users to list appointments based on the date that they wish to see, and the results are displayed via the API of CalendarFX.
After Medeina implemented CalendarFX, users are able to view appointments at a specified date by clicking on the Calendar. However, as Medeina is a CLI-based application, users should not be required to move their mouse. Instead, users should be able to jump to certain dates to check appointments using the command line only.
The implemented CalendarFX API consists of 4 different views: Day, Week, Month and Year views. Users should be able to get a specific requested view of a date, month, or year they wish to see.
The below diagram illustrates the interaction between the UI
, Logic
and Events
components in the ListAppointment
command.
listappt -y 2017
command.ListAppointmentParser.java
handles and separates the request of users based on a regular expression that captures the matching groups of options -d
, -w
, -m
, -y
. The parser then checks the remaining user input, and parses it into LocalDate
, YearMonth
and Year
classes. Should there be no remaining user input after the option, the current date is obtained as the field. A new ListAppointmentCommand
is created with the type (1 for year, 2 for month, 3 for week, 4 for date) as well as the parsed class.
In execute()
, there is a switch that determines the type of command run based on the type obtained from the parser. The relevant functions to change the Calendar gets called based on the type, and an event gets called to handle the change. If an appointment is in the past, a check is done to determine whether there were appointments in the year of that requested date, so that users are not able to jump into years that should not have appointments (i.e. years before Medeina existed).
private CommandResult getYearView() throws NoAppointmentInYearException {
if (year.isBefore(Year.now())) {
if (!checkPastAppointment(year.getValue())) {
throw new NoAppointmentInYearException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, MESSAGE_USAGE));
}
}
EventsCenter.getInstance().post(new ChangeYearViewRequestEvent(year));
return new CommandResult(String.format(MESSAGE_SUCCESS, "year"));
}
An event is then called to handle change the view with the specified date. The handler resides in CalendarWindow.java
to be able to switch the calendarView
to the specified requested view.
private void changeWeekView(LocalDate date) {
WeekFields weekFields = WeekFields.SUNDAY_START;
int week = date.get(weekFields.weekOfWeekBasedYear()) - 1;
if (week == 0 && date.getMonthValue() == 12) {
//wraparound
week = 52;
calendarView.showWeek(Year.of(date.getYear()), week);
} else if (week == 0 && date.getMonthValue() == 1) {
//wraparound
LocalDate dateOfFirstJan = LocalDate.of(date.getYear(), 1, 1);
if (dateOfFirstJan.getDayOfWeek().getValue() != 7) {
week = 52;
calendarView.showWeek(Year.of(date.getYear() - 1), week);
} else {
week = 53;
calendarView.showWeek(Year.of(date.getYear() - 1), week);
}
} else {
calendarView.showWeek(Year.of(date.getYear()), week);
}
}
As the week view in calendarFX is different from the obtaining the week of year in the original Java API, there was a need to switch the week value
obtained from LocalDate
to fit the week value
in the Calendar. Above illustrates the snippet of code used to convert from the value
of the week obtained from LocalDate
to fit the Calendar.
Upon a successful listing, a CommandResult(…)
class is called with a success message of the specified view.
-
Alternative 1: Use a fixed
date
field.-
Pros: Users only need to remember that a
date
in the format of YYYY-MM-DD is accepted for eachlistappt
command. -
Cons: Users have to type more than required, especially for Year and Month views.
-
-
Alternative 2 (current choice): Use a changing field:
Year
for Year view,YearMonth
for Month view,LocalDate
for Week and Day views.-
Pros: Users do not need to type redundant information. A Year view will be in the format of YYYY while a Month view will be in the format of YYYY-MM or MM (with automatically allocated current year).
-
Cons: Users have to remember that Year view only accepts the year, while the Month view only accepts a year and month, or month. The Week and Day views will not accept just a year or year and month, but requires the specific date.
-
-
Alternative 1 (current choice): Implement functions that requires users to type to switch views instead of clicking
-
Pros: Users do not need to switch between using a mouse and a keyboard, which increases productivity for users accustomed to the CLI based nature of Medeina.
-
Cons: Need to implement functions that help will change views (
listappt
orla
command).
-
-
Alternative 2: Use buttons and clicks to switch a calendar than to manually input a command
-
Pros: There will be no need to implement any functions pertaining to
ListAppointment
. -
Cons: Defeats the purpose of a CLI-based application.
-
The delete function allows its users to get rid of obsolete information.
Medeina has multiple important classes to handle: Person
, PetPatient
and Appointment
. As Medeina caters to veterinarians, there is a need for the ability to remove the mentioned classes. For example, an Appointment
can be deleted should a contact decide not to go for the appointment anymore, a PetPatient
should be deleted if a pet patient dies, and a Person
should be deleted if a contact decides to immigrate permanently.
The below diagram illustrates the interaction between Logic
and Model
components during the deletion of a contact.
DeleteCommandParser.java
handles and separates the deletion based on a regular expression, that captures the matching groups of options -o
, -p
, -a
, -fp
, -fo
. Subsequently, the parser gets the Index
from user input to determine the element to delete. The parser then creates a new DeleteCommand
with the type (1 for contact, 2 for pet patient, 3 for appointment, 4 for force contact, 5 for force pet patient), as well as the Index
.
In execute()
, there is a switch that determines the type of command run based on the type obtained from the parser. The normal delete functions (types 1, 2, 3) subsequently calls the Model
component to properly remove the element.
private CommandResult deleteAppointment() {
//... code ...
requireNonNull(appointmentToDelete);
model.deleteAppointment(appointmentToDelete);
//... code ...
return new CommandResult(String.format(MESSAGE_DELETE_APPOINTMENT_SUCCESS, appointmentToDelete));
}
However, for the force delete functions (types 4, 5), dependencies have to be removed before the element itself can be removed, as shown by the snippet of code from DeleteCommand.java
below.
private CommandResult deleteForcePerson() {
//... code ...
List<PetPatient> petPatientsDeleted = model.deletePetPatientDependencies(personToDelete);
List<Appointment> appointmentsDeleted = new ArrayList<>();
for (PetPatient pp : petPatientsDeleted) {
appointmentsDeleted.addAll(model.deleteAppointmentDependencies(pp));
deleteDependenciesList += "\n" + (String.format(MESSAGE_DELETE_PET_PATIENT_SUCCESS, pp));
}
for (Appointment appointment : appointmentsDeleted) {
deleteDependenciesList += "\n" + (String.format(MESSAGE_DELETE_APPOINTMENT_SUCCESS, appointment));
}
model.deletePerson(personToDelete);
//... code ...
return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, personToDelete) + deleteDependenciesList);
}
It can be noted that pet patient dependencies are deleted before appointment dependencies. This is because of the dependency "hierachy" between the different elements. A pet patient is uniquely tied to a contact based on Nric
, while an appointment is uniquely tied to a pet patient based on Nric
and PetPatientName
. As a result, pet patients must first be deleted before determining which appointments are to be deleted.
For each dependency deleted, it is stored in List<…>
so that the CommandResult(…)
returns all deleted dependencies as well as the main, deleted element.
-
Alternative 1: Use different commands for different delete functions.
-
Pros: It is easier to implement. The command can just take in an
Index
without any options before. -
Cons: Hard on users as they will have to type a different command for every type of delete (i.e.
deleteperson
,deletepetpatient
etc.).
-
-
Alternative 2 (current choice): Use one overseeing
delete
command.-
Pros: Users do not need to go through the hassle of trying to remember every different command of delete.
-
Cons: Extra work to determine the type of deletion (i.e.
-a
for Appointment,-p
for PetPatient etc.).
-
-
Alternative 1: Have no force delete function.
-
Pros: There will be no need to implement functions to delete prior dependencies before a deletion is done. An exception can just be thrown if dependencies still exist.
-
Cons: Users will need to manually find and delete every dependency manually.
-
-
Alternative 2 (current choice): Have a force delete function that will delete all dependencies along with the element to be deleted.
-
Pros: Easier to use. Users do not need to manually find and delete all dependencies, it just gets deleted immediately if required.
-
Cons: Need to delete dependencies upon calling a force function. In addition, the dependencies deleted must be shown as well to inform users of all deleted elements.
-
As of now, users are only capable of deleting an element based on its Index
displayed in Medeina. This may pose as difficult for users if they want to delete an element based on the list displayed through the list
command, especially if there is alot of data in Medeina.
In the coming future, the Delete
function can be altered such that it allows users to input other fields other than just Index
, so that users do not need to get a list before deleting a particular element, especially if the user wants to delete an element that is not in the current listing (i.e. not on the listing after a find
command).
The delete function allows its users to get rid of obsolete information.
Medeina has multiple important classes to handle: Person
, PetPatient
and Appointment
. As Medeina caters to veterinarians, there is a need for the ability to remove the mentioned classes. For example, an Appointment
can be deleted should a contact decide not to go for the appointment anymore, a PetPatient
should be deleted if a pet patient dies, and a Person
should be deleted if a contact decides to immigrate permanently.
The below diagram illustrates the interaction between Logic
and Model
components during the deletion of a contact.
DeleteCommandParser.java
handles and separates the deletion based on a regular expression, that captures the matching groups of options -o
, -p
, -a
, -fp
, -fo
. Subsequently, the parser gets the Index
from user input to determine the element to delete. The parser then creates a new DeleteCommand
with the type (1 for contact, 2 for pet patient, 3 for appointment, 4 for force contact, 5 for force pet patient), as well as the Index
.
In execute()
, there is a switch that determines the type of command run based on the type obtained from the parser. The normal delete functions (types 1, 2, 3) subsequently calls the Model
component to properly remove the element.
private CommandResult deleteAppointment() {
//... code ...
requireNonNull(appointmentToDelete);
model.deleteAppointment(appointmentToDelete);
//... code ...
return new CommandResult(String.format(MESSAGE_DELETE_APPOINTMENT_SUCCESS, appointmentToDelete));
}
However, for the force delete functions (types 4, 5), dependencies have to be removed before the element itself can be removed, as shown by the snippet of code from DeleteCommand.java
below.
private CommandResult deleteForcePerson() {
//... code ...
List<PetPatient> petPatientsDeleted = model.deletePetPatientDependencies(personToDelete);
List<Appointment> appointmentsDeleted = new ArrayList<>();
for (PetPatient pp : petPatientsDeleted) {
appointmentsDeleted.addAll(model.deleteAppointmentDependencies(pp));
deleteDependenciesList += "\n" + (String.format(MESSAGE_DELETE_PET_PATIENT_SUCCESS, pp));
}
for (Appointment appointment : appointmentsDeleted) {
deleteDependenciesList += "\n" + (String.format(MESSAGE_DELETE_APPOINTMENT_SUCCESS, appointment));
}
model.deletePerson(personToDelete);
//... code ...
return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, personToDelete) + deleteDependenciesList);
}
It can be noted that pet patient dependencies are deleted before appointment dependencies. This is because of the dependency "hierachy" between the different elements. A pet patient is uniquely tied to a contact based on Nric
, while an appointment is uniquely tied to a pet patient based on Nric
and PetPatientName
. As a result, pet patients must first be deleted before determining which appointments are to be deleted.
For each dependency deleted, it is stored in List<…>
so that the CommandResult(…)
returns all deleted dependencies as well as the main, deleted element.
-
Alternative 1: Use different commands for different delete functions.
-
Pros: It is easier to implement. The command can just take in an
Index
without any options before. -
Cons: Hard on users as they will have to type a different command for every type of delete (i.e.
deleteperson
,deletepetpatient
etc.).
-
-
Alternative 2 (current choice): Use one overseeing
delete
command.-
Pros: Users do not need to go through the hassle of trying to remember every different command of delete.
-
Cons: Extra work to determine the type of deletion (i.e.
-a
for Appointment,-p
for PetPatient etc.).
-
-
Alternative 1: Have no force delete function.
-
Pros: There will be no need to implement functions to delete prior dependencies before a deletion is done. An exception can just be thrown if dependencies still exist.
-
Cons: Users will need to manually find and delete every dependency manually.
-
-
Alternative 2 (current choice): Have a force delete function that will delete all dependencies along with the element to be deleted.
-
Pros: Easier to use. Users do not need to manually find and delete all dependencies, it just gets deleted immediately if required.
-
Cons: Need to delete dependencies upon calling a force function. In addition, the dependencies deleted must be shown as well to inform users of all deleted elements.
-
As of now, users are only capable of deleting an element based on its Index
displayed in Medeina. This may pose as difficult for users if they want to delete an element based on the list displayed through the list
command, especially if there is alot of data in Medeina.
In the coming future, the Delete
function can be altered such that it allows users to input other fields other than just Index
, so that users do not need to get a list before deleting a particular element, especially if the user wants to delete an element that is not in the current listing (i.e. not on the listing after a find
command).
We are using java.util.logging
package for logging. The LogsCenter
class is used to manage the logging levels and logging destinations.
-
The logging level can be controlled using the
logLevel
setting in the configuration file (See Section 4.13, “Configuration”) -
The
Logger
for a class can be obtained usingLogsCenter.getLogger(Class)
which will log messages according to the specified logging level -
Currently log messages are output through:
Console
and to a.log
file.
Logging Levels
-
SEVERE
: Critical problem detected which may possibly cause the termination of the application -
WARNING
: Can continue, but with caution -
INFO
: Information showing the noteworthy actions by the App -
FINE
: Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size
We use asciidoc for writing documentation.
ℹ️
|
We chose asciidoc over Markdown because asciidoc, although a bit more complex than Markdown, provides more flexibility in formatting. |
See UsingGradle.adoc to learn how to render .adoc
files locally to preview the end result of your edits.
Alternatively, you can download the AsciiDoc plugin for IntelliJ, which allows you to preview the changes you have made to your .adoc
files in real-time.
See UsingTravis.adoc to learn how to deploy GitHub Pages using Travis.
We use Google Chrome for converting documentation to PDF format, as Chrome’s PDF engine preserves hyperlinks used in webpages.
Here are the steps to convert the project documentation files to PDF format.
-
Follow the instructions in UsingGradle.adoc to convert the AsciiDoc files in the
docs/
directory to HTML format. -
Go to your generated HTML files in the
build/docs
folder, right click on them and selectOpen with
→Google Chrome
. -
Within Chrome, click on the
Print
option in Chrome’s menu. -
Set the destination to
Save as PDF
, then clickSave
to save a copy of the file in PDF format. For best results, use the settings indicated in the screenshot below.
There are three ways to run tests.
💡
|
The most reliable way to run tests is the 3rd one. The first two methods might fail some GUI tests due to platform/resolution-specific idiosyncrasies. |
Method 1: Using IntelliJ JUnit test runner
-
To run all tests, right-click on the
src/test/java
folder and chooseRun 'All Tests'
-
To run a subset of tests, you can right-click on a test package, test class, or a test and choose
Run 'ABC'
Method 2: Using Gradle
-
Open a console and run the command
gradlew clean allTests
(Mac/Linux:./gradlew clean allTests
)
ℹ️
|
See UsingGradle.adoc for more info on how to run tests using Gradle. |
Method 3: Using Gradle (headless)
Thanks to the TestFX library we use, our GUI tests can be run in the headless mode. In the headless mode, GUI tests do not show up on the screen. That means the developer can do other things on the Computer while the tests are running.
To run tests in headless mode, open a console and run the command gradlew clean headless allTests
(Mac/Linux: ./gradlew clean headless allTests
)
We have two types of tests:
-
GUI Tests - These are tests involving the GUI. They include,
-
System Tests that test the entire App by simulating user actions on the GUI. These are in the
systemtests
package. -
Unit tests that test the individual components. These are in
seedu.address.ui
package.
-
-
Non-GUI Tests - These are tests not involving the GUI. They include,
-
Unit tests targeting the lowest level methods/classes.
e.g.seedu.address.commons.StringUtilTest
-
Integration tests that are checking the integration of multiple code units (those code units are assumed to be working).
e.g.seedu.address.storage.StorageManagerTest
-
Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
e.g.seedu.address.logic.LogicManagerTest
-
See UsingGradle.adoc to learn how to use Gradle for build automation.
We use Travis CI and AppVeyor to perform Continuous Integration on our projects. See UsingTravis.adoc and UsingAppVeyor.adoc for more details.
We use Coveralls to track the code coverage of our projects. See UsingCoveralls.adoc for more details.
When a pull request has changes to asciidoc files, you can use Netlify to see a preview of how the HTML version of those asciidoc files will look like when the pull request is merged. See UsingNetlify.adoc for more details.
Here are the steps to create a new release.
-
Update the version number in
MainApp.java
. -
Generate a JAR file using Gradle.
-
Tag the repo with the version number. e.g.
v0.1
-
Create a new release using GitHub and upload the JAR file you created.
A project often depends on third-party libraries. For example, Medeina depends on the Jackson library for XML parsing. Managing these dependencies can be automated using Gradle. For example, Gradle can download the dependencies automatically, which is better than these alternatives.
a. Include those libraries in the repo (this bloats the repo size)
b. Require developers to download those libraries manually (this creates extra work for developers)
Suggested path for new programmers:
-
First, add small local-impact (i.e. the impact of the change does not go beyond the component) enhancements to one component at a time. Some suggestions are given in Section A.1, “Improving each component”.
-
Next, add a feature that touches multiple components to learn how to implement an end-to-end feature across all components. Section A.2, “Creating a new command:
remark
” explains how to go about adding such a feature.
Each individual exercise in this section is component-based (i.e. you would not need to modify the other components to get it to work).
Scenario: You are in charge of logic
. During dog-fooding, your team realize that it is troublesome for the user to type the whole command in order to execute a command. Your team devise some strategies to help cut down the amount of typing necessary, and one of the suggestions was to implement aliases for the command words. Your job is to implement such aliases.
💡
|
Do take a look at Section 3.3, “Logic component” before attempting to modify the Logic component.
|
-
Add a shorthand equivalent alias for each of the individual commands. For example, besides typing
clear
, the user can also typec
to remove all persons in the list.-
Hints
-
Just like we store each individual command word constant
COMMAND_WORD
inside*Command.java
(e.g.FindCommand#COMMAND_WORD
,DeleteCommand#COMMAND_WORD
), you need a new constant for aliases as well (e.g.FindCommand#COMMAND_ALIAS
). -
AddressBookParser
is responsible for analyzing command words.
-
-
Solution
-
Modify the switch statement in
AddressBookParser#parseCommand(String)
such that both the proper command word and alias can be used to execute the same intended command. -
Add new tests for each of the aliases that you have added.
-
Update the user guide to document the new aliases.
-
See this PR for the full solution.
-
-
Scenario: You are in charge of model
. One day, the logic
-in-charge approaches you for help. He wants to implement a command such that the user is able to remove a particular tag from everyone in the address book, but the model API does not support such a functionality at the moment. Your job is to implement an API method, so that your teammate can use your API to implement his command.
💡
|
Do take a look at Section 3.4, “Model component” before attempting to modify the Model component.
|
-
Add a
removeTag(Tag)
method. The specified tag will be removed from everyone in Medeina’s address book.-
Hints
-
The
Model
and theAddressBook
API need to be updated. -
Think about how you can use SLAP to design the method. Where should we place the main logic of deleting tags?
-
Find out which of the existing API methods in
AddressBook
andPerson
classes can be used to implement the tag removal logic.AddressBook
allows you to update a person, andPerson
allows you to update the tags.
-
-
Solution
-
Implement a
removeTag(Tag)
method inAddressBook
. Loop through each person, and remove thetag
from each person. -
Add a new API method
deleteTag(Tag)
inModelManager
. YourModelManager
should callAddressBook#removeTag(Tag)
. -
Add new tests for each of the new public methods that you have added.
-
See this PR for the full solution.
-
The current codebase has a flaw in tags management. Tags no longer in use by anyone may still exist on the
AddressBook
. This may cause some tests to fail. See issue#753
for more information about this flaw. -
The solution PR has a temporary fix for the flaw mentioned above in its first commit.
-
-
-
Scenario: You are in charge of ui
. During a beta testing session, your team is observing how the users use your address book application. You realize that one of the users occasionally tries to delete non-existent tags from a contact, because the tags all look the same visually, and the user got confused. Another user made a typing mistake in his command, but did not realize he had done so because the error message wasn’t prominent enough. A third user keeps scrolling down the list, because he keeps forgetting the index of the last person in the list. Your job is to implement improvements to the UI to solve all these problems.
💡
|
Do take a look at Section 3.2, “UI component” before attempting to modify the UI component.
|
-
Use different colors for different tags inside person cards. For example,
friends
tags can be all in brown, andcolleagues
tags can be all in yellow.Before
After
-
Hints
-
The tag labels are created inside the
PersonCard
constructor (new Label(tag.tagName)
). JavaFX’sLabel
class allows you to modify the style of each Label, such as changing its color. -
Use the .css attribute
-fx-background-color
to add a color. -
You may wish to modify
DarkTheme.css
to include some pre-defined colors using css, especially if you have experience with web-based css.
-
-
Solution
-
You can modify the existing test methods for
PersonCard
's to include testing the tag’s color as well. -
See this PR for the full solution.
-
The PR uses the hash code of the tag names to generate a color. This is deliberately designed to ensure consistent colors each time the application runs. You may wish to expand on this design to include additional features, such as allowing users to set their own tag colors, and directly saving the colors to storage, so that tags retain their colors even if the hash code algorithm changes.
-
-
-
-
Modify
NewResultAvailableEvent
such thatResultDisplay
can show a different style on error (currently it shows the same regardless of errors).Before
After
-
Hints
-
NewResultAvailableEvent
is raised byCommandBox
which also knows whether the result is a success or failure, and is caught byResultDisplay
which is where we want to change the style to. -
Refer to
CommandBox
for an example on how to display an error.
-
-
Solution
-
Modify
NewResultAvailableEvent
's constructor so that users of the event can indicate whether an error has occurred. -
Modify
ResultDisplay#handleNewResultAvailableEvent(NewResultAvailableEvent)
to react to this event appropriately. -
You can write two different kinds of tests to ensure that the functionality works:
-
The unit tests for
ResultDisplay
can be modified to include verification of the color. -
The system tests
AddressBookSystemTest#assertCommandBoxShowsDefaultStyle() and AddressBookSystemTest#assertCommandBoxShowsErrorStyle()
to include verification forResultDisplay
as well.
-
-
See this PR for the full solution.
-
Do read the commits one at a time if you feel overwhelmed.
-
-
-
-
Modify the
StatusBarFooter
to show the total number of people in the address book.Before
After
-
Hints
-
StatusBarFooter.fxml
will need a newStatusBar
. Be sure to set theGridPane.columnIndex
properly for eachStatusBar
to avoid misalignment! -
StatusBarFooter
needs to initialize the status bar on application start, and to update it accordingly whenever the address book is updated.
-
-
Solution
-
Modify the constructor of
StatusBarFooter
to take in the number of persons when the application just started. -
Use
StatusBarFooter#handleAddressBookChangedEvent(AddressBookChangedEvent)
to update the number of persons whenever there are new changes to the addressbook. -
For tests, modify
StatusBarFooterHandle
by adding a state-saving functionality for the total number of people status, just like what we did for save location and sync status. -
For system tests, modify
AddressBookSystemTest
to also verify the new total number of persons status bar. -
See this PR for the full solution.
-
-
Scenario: You are in charge of storage
. For your next project milestone, your team plans to implement a new feature of saving the address book to the cloud. However, the current implementation of the application constantly saves the address book after the execution of each command, which is not ideal if the user is working on limited internet connection. Your team decided that the application should instead save the changes to a temporary local backup file first, and only upload to the cloud after the user closes the application. Your job is to implement a backup API for the address book storage.
💡
|
Do take a look at Section 3.5, “Storage component” before attempting to modify the Storage component.
|
-
Add a new method
backupAddressBook(ReadOnlyAddressBook)
, so that the address book can be saved in a fixed temporary location.-
Hint
-
Add the API method in
AddressBookStorage
interface. -
Implement the logic in
StorageManager
andXmlAddressBookStorage
class.
-
-
Solution
-
See this PR for the full solution.
-
-
By creating this command, you will get a chance to learn how to implement a feature end-to-end, touching all major components of the app.
Scenario: You are a software maintainer for addressbook
, as the former developer team has moved on to new projects. The current users of your application have a list of new feature requests that they hope the software will eventually have. The most popular request is to allow adding additional comments/notes about a particular contact, by providing a flexible remark
field for each contact, rather than relying on tags alone. After designing the specification for the remark
command, you are convinced that this feature is worth implementing. Your job is to implement the remark
command.
Edits the remark for a person specified in the INDEX
.
Format: remark INDEX r/[REMARK]
Examples:
-
remark 1 r/Likes to drink coffee.
Edits the remark for the first person toLikes to drink coffee.
-
remark 1 r/
Removes the remark for the first person.
Let’s start by teaching the application how to parse a remark
command. We will add the logic of remark
later.
Main:
-
Add a
RemarkCommand
that extendsUndoableCommand
. Upon execution, it should just throw anException
. -
Modify
AddressBookParser
to accept aRemarkCommand
.
Tests:
-
Add
RemarkCommandTest
that tests thatexecuteUndoableCommand()
throws an Exception. -
Add new test method to
AddressBookParserTest
, which tests that typing "remark" returns an instance ofRemarkCommand
.
Let’s teach the application to parse arguments that our remark
command will accept. E.g. 1 r/Likes to drink coffee.
Main:
-
Modify
RemarkCommand
to take in anIndex
andString
and print those two parameters as the error message. -
Add
RemarkCommandParser
that knows how to parse two arguments, one index and one with prefix 'r/'. -
Modify
AddressBookParser
to use the newly implementedRemarkCommandParser
.
Tests:
-
Modify
RemarkCommandTest
to test theRemarkCommand#equals()
method. -
Add
RemarkCommandParserTest
that tests different boundary values forRemarkCommandParser
. -
Modify
AddressBookParserTest
to test that the correct command is generated according to the user input.
Let’s add a placeholder on all our PersonCard
s to display a remark for each person later.
Main:
-
Add a
Label
with any random text insidePersonListCard.fxml
. -
Add FXML annotation in
PersonCard
to tie the variable to the actual label.
Tests:
-
Modify
PersonCardHandle
so that future tests can read the contents of the remark label.
We have to properly encapsulate the remark in our Person
class. Instead of just using a String
, let’s follow the conventional class structure that the codebase already uses by adding a Remark
class.
Main:
-
Add
Remark
to model component (you can copy fromAddress
, remove the regex and change the names accordingly). -
Modify
RemarkCommand
to now take in aRemark
instead of aString
.
Tests:
-
Add test for
Remark
, to test theRemark#equals()
method.
Now we have the Remark
class, we need to actually use it inside Person
.
Main:
-
Add
getRemark()
inPerson
. -
You may assume that the user will not be able to use the
add
andedit
commands to modify the remarks field (i.e. the person will be created without a remark). -
Modify
SampleDataUtil
to add remarks for the sample data (delete youraddressBook.xml
so that the application will load the sample data when you launch it.)
We now have Remark
s for Person
s, but they will be gone when we exit the application. Let’s modify XmlAdaptedPerson
to include a Remark
field so that it will be saved.
Main:
-
Add a new Xml field for
Remark
.
Tests:
-
Fix
invalidAndValidPersonAddressBook.xml
,typicalPersonsAddressBook.xml
,validAddressBook.xml
etc., such that the XML tests will not fail due to a missing<remark>
element.
Since Person
can now have a Remark
, we should add a helper method to PersonBuilder
, so that users are able to create remarks when building a Person
.
Tests:
-
Add a new method
withRemark()
forPersonBuilder
. This method will create a newRemark
for the person that it is currently building. -
Try and use the method on any sample
Person
inTypicalPersons
.
Our remark label in PersonCard
is still a placeholder. Let’s bring it to life by binding it with the actual remark
field.
Main:
-
Modify
PersonCard
's constructor to bind theRemark
field to thePerson
's remark.
Tests:
-
Modify
GuiTestAssert#assertCardDisplaysPerson(…)
so that it will compare the now-functioning remark label.
We now have everything set up… but we still can’t modify the remarks. Let’s finish it up by adding in actual logic for our remark
command.
Main:
-
Replace the logic in
RemarkCommand#execute()
(that currently just throws anException
), with the actual logic to modify the remarks of a person.
Tests:
-
Update
RemarkCommandTest
to test that theexecute()
logic works.
See this PR for the step-by-step solution.
Target user profile:
-
tech-savvy veterinarians and their assistants
-
can type relatively fast while maintaining accuracy
-
requires using the desktop in the workplace
-
requires CLI applications for efficiency
-
provide veterinary services to domestic animals in Singapore
-
has to manage a significant number of pet patients
-
requires the information kept to generally be non-volatile
-
needs to search through amounts of data for information
Value proposition: all-in-one vet assistant app that can view and make appointments and search for information
Feature contribution:
Name | Major enhancement(s) | Minor enhancement(s) |
---|---|---|
Jacqueline Cheong |
To enhance user experience and usage efficiency of the CLI by providing autocomplete suggestions
A single add command with options to add a contact, pet patient and appointment to Medeina. Users don’t have to remember multiple commands performing similar functions. The new add command also enables the user to all 3 objects at one go to reduce typing. |
This allows Vets to change the application’s appearance to better suit their preferences and working environment (e.g. dark theme for night time) |
Chia Le Jing |
PetPatient class and all its relevant features Commands such as add, edit, delete, find. Also includes the storage of pet patient’s data into the associated .xml file. |
Implement backup function for local databases and the cloud (for v2.0) Allows local files to be backed up with the latest copy (in case of corruption of data). Also allows data to be backed up to the cloud for future use. |
Wynona Kaan |
Find by Contact or Pet Patient Allows for finding of contacts or pet patients based on a particular field or a combination of fields allowed. Delete Contact, Pet Patient or Appointment Allows for deletion of contacts, pet patients and appointments, as well as force deletion of contacts and pet patients that deletes all relevant dependencies along with the element deleted. |
Appointment class, storing and listing of appointments Create a new class for to handle appointments. Allows for storage so that appointments can be stored in the .xml file and persist beyond application restart. Allows for listing of appointments in specific requested views of requested dates in CalendarFX. |
Peng Xuanchang |
Integrating CalenderFX as framework for Calender view Vets and their assistants will be able to see their appointments in calender view integrated in the software. |
Add NRIC field in Owner’s profile The NRIC field will help the veterinarians and their assistants to better locate an owner using their unique ID. |
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that I can… |
---|---|---|---|
|
new user |
see usage instructions |
refer to instructions when I forget command syntax, or how to use the App |
|
user |
add a pet patient |
register its information |
|
user |
find a pet patient by name |
easily locate its information without having to go through a long list of pet patients |
|
user |
add appointment |
schedule meetings with pet patients and their owners |
|
user |
edit pet owner’s contact information |
update any change in contact information (e.g. changed hand phone number, change of address) |
|
user |
basic tags to be assigned automatically |
type lesser (e.g. when adding a pet owner, the "Person" tag should be assigned by default) |
|
user |
list out appointments for next day |
prepare for the required procedures/diagnosis/consultation |
|
user |
classify appointments by types |
better organize a long list of appointments |
|
user |
cancel an appointment |
make space in schedule for other things |
|
user |
see upcoming appointments |
prepare/plan in advance |
|
user |
see a list of today’s appointment |
check on today’s schedule |
|
user |
filter pet patients by species and blood type |
contact them for blood donation during emergencies |
|
user |
reschedule an appointment |
make time for emergency situations |
|
user |
search by pet owner’s name |
retrieve a list of pet patients under a particular owner |
|
user |
add a pet owner |
maintain contact information and register a pet patient under him or her |
|
user |
add in owner details such as contact number |
contact them when needed |
|
user |
update pet patients' information |
|
|
user |
see pet owner’s name when checking pet patients' profile |
know who it belongs to |
|
user |
delete a pet patient after certain period |
remove entries that I no longer need |
|
user |
have a simple and intuitive command line interface |
maximize workflow efficiency |
|
user |
change the theme of the application |
better suit my preference |
|
user |
log in with password |
protect my pet patients' and their respective owners' information |
|
user |
update status of pet patient (living, deceased) |
know the number of pets I am managing now |
|
user |
check who is my assistant for the day/particular pet patient |
brief them in advance |
|
user |
check services consumed for a particular appointment |
know what a pet patient has gone through |
|
user |
create and modify tags |
standardize tags used in the application |
|
user |
have reminders sms sent to pet owners automatically 2 days before appointment |
|
|
user |
update my status |
be recognized as an official vet after my training |
|
user |
transfer a pet patient from my clinic to another in case of emergency |
|
|
user |
manage the "rooms" in hospital |
make space for newly hospitalized pet patient |
|
user |
search for a pet patient’s medical history |
know the next step of treatment |
|
user with many pet patients in the address book |
sort pet patients by name |
locate a pet patient easily |
{More to be added}
(For all use cases below, the System is the Medeina
and the Actor is the user
, unless specified otherwise)
MSS
-
User requests to view appointments for current month
-
Medeina updates calendarFx to show appointments for the current month
Use case ends.
Extensions
-
2a. There are no appointments for the month.
Use case ends.
MSS
-
User requests to find a pet patient with the name "Joseph"
-
Medeina shows a list of pet patients with the name "Joseph" in the pet patient card panel and updates the contacts card panel with their point of contact.
-
User requests to modify the pet patient’s point of contact
-
Medeina shows the pet patient’s updated information
Use case ends.
Extensions
-
2a. The list is empty.
Use case ends.
-
3a. The given index is invalid.
-
3a1. Medeina shows an error message.
Use case resumes at step 2.
-
-
3b. The given command is invalid.
-
3b1. Medeina shows the correct command usage to edit pet patient’s information.
Use case resumes at step 2.
-
MSS
-
User requests to find a contact named "Mavis"
-
Medeina shows a list of contacts with "Mavis" as part of their name and updates the pet patient card panel with pet patients under them
Use case ends.
Extensions
-
2a. The list is empty.
Use case ends.
MSS
-
User requests to find an contacts with the name "Mavis"
-
Medeina shows a list of contacts with the name "Mavis" and updates the pet patient card panel with pet patients under them
-
User requests to add tags to a specific owner on the list
-
Medeina shows updated owner information
Use case ends.
Extensions
-
2a. The list is empty.
Use case ends.
-
3a. The given index is invalid.
-
3a1. Medeina shows an error message.
Use case resumes at step 2.
-
-
3b. The given tag(s) is/are invalid.
-
3b1. Medeina shows an error message.
Use case resumes at step 2.
-
-
The system should work on Windows, Linux and macOS as long as it has Java
1.8.0_60
or higher installed. -
A user (vet or vet assistant) with above average typing speed for regular English text (i.e. not code, not system administrative commands) should be able to accomplish most of the tasks faster using commands than using the mouse.
-
The system should be accessible, even without any Internet connection (or with poor Internet connection).
-
The system should be able to hold the information of at least 1000 patients (pets) and their respective owners without noticeable sluggishness in performance for typical usage.
-
The system should be stable (runs without crashing, even for extended hours) and responsive (with a maximum lag of 2 seconds) due to the possibility of patient emergencies.
-
The system should be reliable and accurate (i.e. information keyed in is guaranteed to be saved, information retrieved is guaranteed to be accurate based on what was keyed in previously).
-
The system must have sufficient security (such as password protection / encrypted storage file) to protect the confidentiality of the patients (pets) and their respective owners. This is also to ensure compliance with PDPA.
-
Patient’s and owner’s information should be easily and accurately backed up, with zero errors in the information.
-
Restoring patient’s and their respective owner’s information should be an easy process.
-
The system should have sufficient commands / functions to ensure that information can be maintained and managed easily. Basic operations such as add, delete, find, update must be included for patients and their respective owners.
{More to be added}
- Mainstream OS
-
Windows, Linux, Unix, OS-X
- Assistants
-
People who help Veterinarians (receptionist, technicians etc.)
- CLI
-
Command Line Interface
- Pet Patients
-
Domestic animals which seek veterinary services
- Person
-
To refer to contacts in the implementation of Medeina
- Contact
-
To refer to owners of pet patients
- Singleton
-
A design pattern in programming
Given below are instructions to test the app manually.
ℹ️
|
These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing. |
-
Initial launch
-
Download the jar file and copy into an empty folder
-
Double-click the jar file
Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
-
-
Saving window preferences
-
Resize the window to an optimum size. Move the window to a different location. Close the window.
-
Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
-
-
dark theme
-
Type "theme dark" in the command box to switch to dark theme.
-
Re-launch the app by double-clicking the jar file.
Expected: The app is using dark theme. The change of theme persists beyond app restart.
-
-
Command word
-
In an empty command box (with no user input), type a space. You should see a drop down list of commands supported by Medeina.
-
Continue typing spaces in the command box. The same drop down list of command words will be suggested.
-
-
Prefixes
-
Type "add " you should see a list of prefixes supported by Medeina.
-
Type "edit " you should see a list of prefixes supported by Medeina.
-
Type "find " you should see a list of prefixes supported by Medeina.
-
Type "delete " you should see a list of prefixes supported by Medeina.
-
Type "listappt " you should see a list of prefixes supported by Medeina.
-
There will be no prefixes suggested for all other preceeding words e.g. "sdfkljsdlkfjs ", "help ".
-
-
Options
-
Type "add -" you should see a list of options (starting with "-") supported by Medeina.
-
Type "edit -" you should see a list of options (starting with "-") supported by Medeina.
-
Type "find -" you should see a list of options (starting with "-") supported by Medeina.
-
Type "delete -" you should see a list of options (starting with "-") supported by Medeina.
-
Type "listappt -" you should see a list of options (starting with "-") supported by Medeina.
-
There will be no options suggested for all other preceeding words e.g. "sdfkljsdlkfjs -", "help -".
-
-
Species, breed, colour and blood type
-
Typing s/, b/, c/ and bt/ after a word (and a space) in the command box, will show their respective suggestions.
-
-
Pet patient names
-
Type "add -a -o -p n/" and you will see a list of pet patient name suggestions (cap at 13).
-
Type "add -p n/" and there will be no pet patient name suggestions.
-
-
NRIC
-
Type "add -p -o nr/" and you will see a list of NRIC suggestions (cap at 13).
-
Type "add -p n/Mikey s/Cat b/Persian c/Calico bt/A -o nr/" and you will see a list of NRIC suggestions (cap at 13).
-
Type "add -p n/Mikey s/Cat b/Persian c/Calico bt/A -o nr/T" and you will see a list of NRIC suggestions starting with "T" (cap at 13).
-
Type "edit 1 -p nr/" to see a list of NRIC suggestions (cap at 13).
-
Type "edit 1 -p n/hello nr/" to see a list of NRIC suggestions (cap at 13).
-
Type "find -o nr/" to see a list of NRIC suggestions (cap at 13).
-
-
Toggle on/off
-
Press F2 when the command box is in focus to off/on autocomplete.
-
-
Deleting a person while all persons are listed
-
Prerequisites: List all persons using the
list
command. Multiple persons in the list. -
Test case:
delete 1
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated. -
Test case:
delete 0
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. -
Other incorrect delete commands to try:
delete
,delete x
(where x is larger than the list size) {give more}
Expected: Similar to previous.
-
{ more test cases … }
-
Listing out all owners and petPatients
-
Prerequisites: Conduct
find
command. More than one person or petPatient in the lists. -
Testcase:
find -o n/Alex
+list
Expected: Medeina will display the located person and then list out all owners and petPatients in Medeina’s storage.
-