Developer Guide
- Acknowledgements
- Setting up, getting started
- Design
- Implementation
- Documentation, logging, testing, configuration, dev-ops
- Appendix: Requirements
- Appendix: Instructions for manual testing
Acknowledgements
- {list here sources of all reused/adapted ideas, code, documentation, and third-party libraries – include links to the original source as well}
Setting up, getting started
Refer to the guide Setting up and getting started.
Design
.puml
files used to create diagrams in this document docs/diagrams
folder. Refer to the PlantUML Tutorial at se-edu/guides to learn how to create and edit diagrams.
Architecture
The Architecture Diagram given above explains the high-level design of the App.
Given below is a quick overview of main components and how they interact with each other.
Main components of the architecture
Main
(consisting of classes Main
and MainApp
) is in charge of the app launch and shut down.
- At app launch, it initializes the other components in the correct sequence, and connects them up with each other.
- At shut down, it shuts down the other components and invokes cleanup methods where necessary.
The bulk of the app’s work is done by the following four components:
-
UI
: The UI of the App. -
Logic
: The command executor. -
Model
: Holds the data of the App in memory. -
Storage
: Reads data from, and writes data to, the hard disk.
Commons
represents a collection of classes used by multiple other 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 the command delete 1
.
Each of the four main components (also shown in the diagram above),
- defines its API in an
interface
with the same name as the Component. - implements its functionality using a concrete
{Component Name}Manager
class (which follows the corresponding APIinterface
mentioned in the previous point.
For example, the Logic
component defines its API in the Logic.java
interface and implements its functionality using the LogicManager.java
class which follows the Logic
interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component’s being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.
The sections below give more details of each component.
UI component
The API of this component is specified in 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 which captures the commonalities between classes that represent parts of the visible GUI.
The UI
component uses the 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. - listens for changes to
Model
data so that the UI can be updated with the modified data. - keeps a reference to the
Logic
component, because theUI
relies on theLogic
to execute commands. - depends on some classes in the
Model
component, as it displaysPerson
object residing in theModel
.
Logic component
API : Logic.java
Here’s a (partial) class diagram of the Logic
component:
The sequence diagram below illustrates the interactions within the Logic
component, taking execute("delete 1")
API call as an example.
DeleteCommandParser
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.
How the Logic
component works:
- When
Logic
is called upon to execute a command, it is passed to anAddressBookParser
object which in turn creates a parser that matches the command (e.g.,DeleteCommandParser
) and uses it to parse the command. - This results in a
Command
object (more precisely, an object of one of its subclasses e.g.,DeleteCommand
) which is executed by theLogicManager
. - The command can communicate with the
Model
when it is executed (e.g. to delete a person).
Note that although this is shown as a single step in the diagram above (for simplicity), in the code it can take several interactions (between the command object and theModel
) to achieve. - The result of the command execution is encapsulated as a
CommandResult
object which is returned back fromLogic
.
Here are the other classes in Logic
(omitted from the class diagram above) that are used for parsing a user command:
How the parsing works:
- When called upon to parse a user command, the
AddressBookParser
class creates anXYZCommandParser
(XYZ
is a placeholder for the specific command name e.g.,AddCommandParser
) which uses the other classes shown above to parse the user command and create aXYZCommand
object (e.g.,AddCommand
) which theAddressBookParser
returns back as aCommand
object. - All
XYZCommandParser
classes (e.g.,AddCommandParser
,DeleteCommandParser
, …) inherit from theParser
interface so that they can be treated similarly where possible e.g, during testing.
Model component
API : Model.java
The Model
component,
- stores the address book data i.e., all
Person
objects (which are contained in aUniquePersonList
object). - stores the currently ‘selected’
Person
objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiableObservableList<Person>
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. - stores a
UserPref
object that represents the user’s preferences. This is exposed to the outside as aReadOnlyUserPref
objects. - does not depend on any of the other three components (as the
Model
represents data entities of the domain, they should make sense on their own without depending on other components)
Tag
list in the AddressBook
, which Person
references. This allows AddressBook
to only require one Tag
object per unique tag, instead of each Person
needing their own Tag
objects.Storage component
API : Storage.java
The Storage
component,
- can save both address book data and user preference data in JSON format, and read them back into corresponding objects.
- inherits from both
AddressBookStorage
andUserPrefStorage
, which means it can be treated as either one (if only the functionality of only one is needed). - depends on some classes in the
Model
component (because theStorage
component’s job is to save/retrieve objects that belong to theModel
)
Common classes
Classes used by multiple components are in the seedu.address.commons
package.
Implementation
This section describes some noteworthy details on how certain features are implemented.
Add Feature
AddCommand
Implementation Sequence Diagram
The sequence diagram below illustrates the process of adding a person into TalentSG.
Key Components
-
AddCommand
: Executes the addition operation based on the user’s input. -
AddCommandParser
: Parses user input to create anAddCommand
object. -
LogicManager
: Invokes theAddCommand
to execute the addition operation. -
ModelManager
: Implements theModel
interface and contains the internal list of persons. -
Person
: Represents a person in TalentSG, encapsulating their personal information. -
AddressBookParser
: Creates anAddCommand
object based on the user input.
Component Interaction Details
- The user executes the command
add n/John Doe p/98765432 e/johnd@example.com a/123 Main St s/Java,Python st/Active note/Great candidate ex/5 years in HR dr/Software Engineer
, intending to add a person with the specified details. - The
AddCommandParser
interprets the input. - An
AddCommand
object is created. - The
LogicManager
invokes the execute method of AddCommand. - The execute method of
AddCommand
invokes theaddPerson
method inModel
property to create new contact with the newPerson
object. - The execute method of
AddCommand
returns aCommandResult
object which stores the data regarding the completion of theAddCommand
. - The UI reflects this new list with added
Person
.
List Feature
ListCommand
Implementation Sequence Diagram
The sequence diagram below illustrates the process of executing the list
command in TalentSG, which lists all persons in the address book.
Key Components
-
ListCommand
: Executes the listing operation to show all persons in the address book. -
AddressBookParser
: Parses user input to create aListCommand
object. -
LogicManager
: Invokes theListCommand
to execute the list operation. -
ModelManager
: Implements theModel
interface and contains the internal list of persons. -
CommandResult
: Encapsulates the result of the command execution, including any feedback to the user.
Component Interaction Details
- The user executes the command
list
, intending to list all persons in the address book. - The
AddressBookParser
interprets the input and creates aListCommand
object. - The
LogicManager
invokes the execute method ofListCommand
. - The execute method of
ListCommand
callsupdateFilteredPersonList
in theModel
to apply a filter to show all persons. - The execute method of
ListCommand
returns aCommandResult
object, indicating the command was successful with the message “Listed all persons”. - The UI reflects the updated list of persons.
Edit Feature
EditCommand
Implementation Sequence Diagram
The sequence diagram below illustrates the process of editing a person’s details in TalentSG.
Key Components
-
EditCommand
: Executes the edit operation based on the user’s input. -
EditCommandParser
: Parses user input to create anEditCommand
object. -
LogicManager
: Invokes theEditCommand
to execute the edit operation. -
ModelManager
: Implements theModel
interface and contains the internal list of persons. -
Person
: Represents a person in TalentSG, encapsulating their personal information. -
AddressBookParser
: Creates anEditCommand
object based on the user input.
Component Interaction Details
- The user executes the command
edit 1 n/John Doe p/98765432 e/johnd@example.com a/123 Main St s/Java,Python st/Active note/Great candidate ex/5 years in HR dr/Software Engineer
, intending to edit the details of the person at index 1. - The
EditCommandParser
interprets the input. - An
EditCommand
object is created. - The
LogicManager
invokes the execute method ofEditCommand
. - The execute method of
EditCommand
invokes thesetPerson
method in theModel
to update the details of the existingPerson
object with the new values. - The execute method of
EditCommand
returns aCommandResult
object which stores the data regarding the completion of theEditCommand
. - The UI reflects this updated list with the edited
Person
.
Delete Feature
Delete Command
Implementation Sequence Diagram
The sequence diagram below illustrates the process of deleting a person from TalentSG.
Key Components
-
DeleteCommand
: Executes the deletion operation based on the user’s input. -
AddCommandParser
: Parses user input to create aDeleteCommand
object. -
LogicManager
: Invokes theDeleteCommand
to execute the deletion operation. -
ModelManager
: Implements theModel
interface and contains the internal list of persons. -
Person
: Represents a person in TalentSG, encapsulating their personal information. -
AddressBookParser
: Creates anDeleteCommand
object based on the user input.
Component Interaction Details
- The user executes the command
delete 2
, intending to delete a person with index 2 in the contact list. - The
DeleteCommandParser
interprets the input. - A
DeleteCommand
object is created. - The
LogicManager
invokes the execute method of DeleteCommand. - The execute method of
DeleteCommand
invokes thedeletePerson
method inModel
property to delete the contact of thePerson
object. - The execute method of
DeleteCommand
returns aCommandResult
object which stores the data regarding the completion of theDeleteCommand
. - The UI reflects this new list with deleted
Person
.
Find Feature
FindCommand
Implementation Sequence Diagram
The sequence diagram below illustrates the process of finding all persons based on keyword in TalentSG.
Key Components
-
FindCommand
: Executes the find operation based on the user’s input. -
FindCommandParser
: Parses user input to create anFindCommand
object. -
LogicManager
: Invokes theFindCommand
to execute the find operation. -
ModelManager
: Implements theModel
interface and contains the internal list of persons. -
Predicate
: Represents the keyword for finding persons whose name contains any of the argument keyword in TalentSG. -
AddressBookParser
: Creates anFindCommand
object based on the user input.
Component Interaction Details
- The user executes the command
find john
, intending to find all persons whose name contains the keyword. - The
FindCommandParser
interprets the input. - An
FindCommand
object is created. - The
LogicManager
invokes the execute method of FindCommand. - The execute method of
FindCommand
invokes theupdateFilteredPersonList
method inModel
property to update the filter of the filtered person list. - The execute method of
FindCommand
returns aCommandResult
object which stores the data regarding the completion of theFindCommand
. - The UI reflects this updated filtered
Person
list.
[Proposed] Undo/redo feature
Proposed Implementation
The proposed undo/redo mechanism is facilitated by VersionedAddressBook
. It extends AddressBook
with an undo/redo history, stored internally as an addressBookStateList
and currentStatePointer
. Additionally, it implements the following operations:
-
VersionedAddressBook#commit()
— Saves the current address book state in its history. -
VersionedAddressBook#undo()
— Restores the previous address book state from its history. -
VersionedAddressBook#redo()
— Restores a previously undone address book state from its history.
These operations are exposed in the Model
interface as Model#commitAddressBook()
, Model#undoAddressBook()
and Model#redoAddressBook()
respectively.
Given below is an example usage scenario and how the undo/redo mechanism behaves at each step.
Step 1. The user launches the application for the first time. The VersionedAddressBook
will be initialized with the initial address book state, and the currentStatePointer
pointing to that single address book state.
Step 2. The user executes delete 5
command to delete the 5th person in the address book. The delete
command calls Model#commitAddressBook()
, causing the modified state of the address book after the delete 5
command executes to be saved in the addressBookStateList
, and the currentStatePointer
is shifted to the newly inserted address book state.
Step 3. The user executes add n/David …
to add a new person. The add
command also calls Model#commitAddressBook()
, causing another modified address book state to be saved into the addressBookStateList
.
Model#commitAddressBook()
, so the address book state will not be saved into the addressBookStateList
.
Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the undo
command. The undo
command will call Model#undoAddressBook()
, which will shift the currentStatePointer
once to the left, pointing it to the previous address book state, and restores the address book to that state.
currentStatePointer
is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The undo
command uses Model#canUndoAddressBook()
to check if this is the case. If so, it will return an error to the user rather
than attempting to perform the undo.
The following sequence diagram shows how an undo operation goes through the Logic
component:
UndoCommand
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
Similarly, how an undo operation goes through the Model
component is shown below:
The redo
command does the opposite — it calls Model#redoAddressBook()
, which shifts the currentStatePointer
once to the right, pointing to the previously undone state, and restores the address book to that state.
currentStatePointer
is at index addressBookStateList.size() - 1
, pointing to the latest address book state, then there are no undone AddressBook states to restore. The redo
command uses Model#canRedoAddressBook()
to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
Step 5. The user then decides to execute the command list
. Commands that do not modify the address book, such as list
, will usually not call Model#commitAddressBook()
, Model#undoAddressBook()
or Model#redoAddressBook()
. Thus, the addressBookStateList
remains unchanged.
Step 6. The user executes clear
, which calls Model#commitAddressBook()
. Since the currentStatePointer
is not pointing at the end of the addressBookStateList
, all address book states after the currentStatePointer
will be purged. Reason: It no longer makes sense to redo the add n/David …
command. This is the behavior that most modern desktop applications follow.
The following activity diagram summarizes what happens when a user executes a new command:
Design considerations:
Aspect: How undo & redo executes:
-
Alternative 1 (current choice): Saves the entire address book.
- 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.
- Pros: Will use less memory (e.g. for
{more aspects and alternatives to be added}
[Proposed] Data archiving
{Explain here how the data archiving feature will be implemented}
Documentation, logging, testing, configuration, dev-ops
Appendix: Requirements
Product scope
Target user profile:
Our primary target users are Recruiters and HR professionals who are responsible for managing job candidates and employee information.
Value proposition: simplify and enhance the recruitment process for HR professionals and recruiters.
User stories
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that I can… |
---|---|---|---|
* * * |
recruiter | add new candidate profiles | keep track of all candidates applying for positions |
* * * |
recruiter | edit candidate profiles | update candidate information as new details become available |
* * * |
recruiter | delete candidate profiles | remove candidates who are no longer considered for positions |
* * * |
HR professional | view a list of all candidates | easily access any candidate’s details on demand |
* * * |
recruiter | search for candidates by specific criteria (e.g., skills) | quickly find suitable candidates for various roles |
* * * |
HR professional | schedule and manage interviews | organise the recruitment process efficiently |
* * * |
recruiter | set reminders for interviews | ensure no interview is missed |
* * |
recruiter | track the status of a candidate through different recruitment stages | maintain an organised overview of the recruitment pipeline |
* * |
HR professional | import candidate data from external sources | streamline the process of adding new candidates |
* * |
recruiter | export data on candidates | prepare reports or share data with colleagues |
* * |
recruiter | record notes during or after interviews | have detailed records and observations to refer back to |
* * |
recruiter | see a dashboard of recruitment activities | get a quick overview of all current recruitment efforts |
* * |
HR professional | manage and view employment details for hired candidates | keep track of all employment-related information in one place |
* |
recruiter | receive notifications about upcoming tasks | stay on top of all recruitment-related tasks without having to constantly check the app |
* |
HR professional | customise the fields in candidate profiles | tailor the application to fit the specific needs and focus areas of my organisation |
* |
recruiter | archive candidate profiles | keep our current database up-to-date without losing past data |
* |
recruiter | view analytics on recruitment efforts (e.g., time to hire) | assess the effectiveness of current recruitment strategies |
* |
HR professional | undo/redo changes in the application | correct mistakes without needing to manually revert changes |
* |
recruiter | create and manage job postings | advertise new job openings directly from the application |
* |
recruiter | receive automated suggestions for potential candidates | speed up the process of candidate selection |
* |
recruiter | categorise candidates into different job pools | organize candidates based on their skill sets and roles |
* |
HR professional | bulk upload candidate profiles via a CSV or Excel file | quickly import a large number of candidate profiles |
* |
recruiter | assign tags/labels to candidates | quickly identify candidates based on specific characteristics |
* |
HR professional | generate candidate summary reports for hiring managers | provide concise and relevant candidate data to stakeholders |
* |
recruiter | log communication history with candidates | track all interactions with candidates throughout the recruitment process |
* |
recruiter | set priorities for candidates in the pipeline | focus on high-priority candidates first |
* |
recruiter | track the reason for rejecting a candidate | maintain clear records of why candidates were not selected |
* |
recruiter | add links to candidates’ online profiles (e.g., LinkedIn, GitHub) | have quick access to additional candidate information |
* |
HR professional | integrate the app with job portals or LinkedIn | streamline candidate sourcing from multiple platforms |
* |
recruiter | send automated follow-up emails to candidates | save time by automating routine communication tasks |
Use cases
Use Case 1: Add a New Candidate Profile
Actor: Recruiter
Preconditions: The system is running, and the recruiter is logged into the application.
Main Success Scenario:
- Recruiter selects the “Add Candidate” option.
- System prompts recruiter to input candidate details (name, phone, email, address, role).
- Recruiter enters candidate details.
- System confirms that the details are valid and adds the candidate profile.
- System displays a success message: “Candidate profile added successfully.”
Extensions:
- 3a. Recruiter inputs invalid phone number or email.
- System shows an error message: “Invalid phone number or email. Please enter valid information.”
- 4a. A duplicate candidate profile is detected.
- System shows an error message: “Duplicate candidate detected. Profile not added.”
Use Case 2: Schedule an Interview
Actor: Recruiter
Preconditions: Recruiter is logged in, and a candidate profile exists.
Main Success Scenario:
- Recruiter selects the “Schedule Interview” option for a specific candidate.
- System prompts recruiter to input the date and time for the interview.
- Recruiter inputs valid date and time.
- System saves the interview schedule for the candidate.
- System displays a success message: “Interview scheduled for [Candidate Name] on [Date and Time].”
Extensions:
- a. Recruiter inputs invalid date or time.
- System shows an error message: “Invalid date or time format. Please follow the format YYYY-MM-DD and HH:MM.”
- b. The selected time slot is already booked for another interview.
- System shows an error message: “Time slot is already booked. Please select a different time.”
Use Case 3: Search for Candidates by Criteria
Actor: HR Professional
Preconditions: Candidate profiles exist in the system.
Main Success Scenario:
- HR professional selects the “Search” option.
- System prompts HR professional to input search criteria (e.g., candidate name, role, or skill).
- HR professional enters search criteria (e.g., role: Software Engineer).
- System retrieves and displays a list of candidates matching the criteria.
- HR professional selects a candidate from the list to view detailed information.
Extensions:
- 3a. No candidates match the search criteria.
- System displays a message: “No candidates found for the given criteria.”
Non-Functional Requirements
-
Performance:
- The system should be able to handle up to 100 simultaneous users without a significant decrease in performance.
- System response time for any operation should not exceed 1 second.
-
Scalability:
- The system should support the management of up to 10,000 candidate profiles without performance degradation.
- The system should be able to integrate with external recruitment systems (e.g., LinkedIn, job portals) to import candidate data.
-
Usability:
- The system should be intuitive for users with basic computer skills.
- The user interface should provide clear navigation, with minimal need for user training.
-
Reliability:
- The system should have a 99.9% uptime, ensuring availability for recruiters and HR professionals during business hours.
- Data should be backed up every 24 hours to prevent data loss.
-
Security:
- The system must comply with GDPR regulations and ensure that candidate data is securely stored and handled.
- All user data (including candidate information) should be encrypted both at rest and in transit.
-
Portability:
- The system should be compatible with Windows, macOS, and Linux operating systems.
- The system should be able to run on machines with at least 4GB of RAM and 2GHz processors.
-
Accessibility:
- The system should comply with WCAG 2.1 standards for web accessibility, ensuring that users with disabilities can use the system effectively.
Glossary
-
Recruiter:
- A professional responsible for managing job applicants and their application process.
-
HR Professional:
- A Human Resources professional responsible for managing employee information and candidate data during the recruitment process.
-
Candidate Profile:
- A record containing all relevant details about a job applicant, including contact information, skills, experience, and interview notes.
-
MVP (Minimum Viable Product):
- The minimum version of a product that meets the basic requirements to be usable by the target audience.
-
Interview Schedule:
- The process of setting a date and time for a job applicant to be interviewed by the recruiter or hiring manager.
-
NFR (Non-functional Requirements):
- Requirements that specify the quality and performance characteristics of the system (e.g., performance, security, usability).
-
CRUD:
- Refers to the basic operations of Create, Read, Update, and Delete, typically applied to data management within an application.
-
GDPR (General Data Protection Regulation):
- A European regulation on data protection and privacy for individuals within the EU, applicable to the handling of personal data.
Appendix: Instructions for manual testing
Given below are instructions to test the app manually.
Launch and shutdown
-
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.
-
-
{ more test cases … }
Deleting a person
-
Deleting a person while all persons are being shown
-
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)
Expected: Similar to previous.
-
-
{ more test cases … }
Saving data
-
Dealing with missing/corrupted data files
- {explain how to simulate a missing/corrupted file, and the expected behavior}
-
{ more test cases … }