- 4.1 Main Component
- 4.2 UI Component
- 4.3 Logic Component
- 4.4 Model Component
- 4.5 Storage Component
- 4.6 Logger Component
- 4.7 Common Classes
- 5.1 Add Event
- 5.2 Edit Event
- 5.3 Conflict Detector
- 5.4 List Events
- 5.5 Delete Event
- 5.6 Priority Filter
- 5.7 Duplicate Event
- 5.8 Add Participant
- 5.9 List Participants
- 5.10 Event Storage
- 5.11 User Storage
- 5.12 Login System
- 5.13 List All Events
- 7.1 Product Scope
- 7.2 User Stories
- 7.3 Non-Functional Requirements
- 7.4 Glossary
- 7.5 Manual Testing
- 7.6 Future Features
- CS2113 Individual Project Template
Used as the foundational project structure with modifications for our event management system
- SE-EDU PlantUML Guide
Referenced for creating all UML diagrams in this project
This project is a CLI-based Event Manager designed to help users organize their schedules effectively. In addition to creating, editing, deleting, and sorting events, the application supports participant management with access levels and availability. This Developer Guide documents the architecture, features, design considerations, and implementation details to help contributors understand the codebase and make meaningful contributions.
JDK 17Gradle 7.6.2or higherIntelliJ IDEA(recommended IDE for Java development)
Clone the repository to your local machine:
git clone https://github.com/AY2425S2-CS2113-W13-2/tp.git
To import the project:
- Open
IntelliJ IDEA - Click on
File → Open - Select the
tpdirectory - Choose the
build.gradlefile and open it - Select
Open as Projectwhen prompted - Ensure the JDK is set to
JDK 17 - Wait for Gradle to finish syncing
To ensure everything is working correctly, you can:
- Run all tests:
./gradlew test
- Launch the application:
./gradlew run
Click here to view the UML class diagram
The architecture of Event Manager is structured into clearly defined components to ensure modularity and maintainability. The core components are outlined below:
-
The Architecture Diagram given above explains the high-level design.
-
Given below is a quick overview of main components and how they interact with each other.
-
Main components of the architecture
-
Main(
EventSync.java) is in charge of the initialization and execution of the system.- At 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 system’s work is done by the following components:
- UI: The user interface that interacts with the user.
- Logic: The command executor responsible for processing commands.
- Model: Maintains the application's data in memory, including participants and events.
- Storage: Reads data from, and writes data to, files for persistence.
-
Logger handles logging of system events, errors, and debugging information.
-
Commons: Provides shared utilities and helper functions used across components.
-
How the architecture components interact with each other
-
Each of the main components:
- Defines its API in an interface with the same name as the component.
- Implements its functionality using a concrete {Component Name}Factory class, which follows the corresponding API interface.
-
The sections below give more details of each component.
The UI component handles all user interaction through the command line. It displays menus, messages, prompts, and results. It acts as an interface between the user and the application logic.
The UI class is instantiated when the application starts. Other components, such as Event Manager should use the UI instance to interact with the user. UI helps to separate the user interaction from the core application logic.
-
Input Handling:
Scanner scannerhandles the input from the user. It is used to read user commands and data.setScanner(Scanner newScanner)allows setting a different scanner, useful for testing purposes.readLine()reads a line of text from the user.readInt()reads an integer input from the user, returning null if the input is not a valid integer.checkForExit(String input)checks if the user wants to exit the current operation by typing 'exit'.
-
Command Input Methods:
readAddCommandInput()gets input for adding a new event.readDuplicateEventInput()gets input for duplicating an event.readDeleteName()gets input for searching events to delete.readFilterInput()gets input for filtering events.readListCommandInput()gets input for listing and sorting events.readAddParticipantInput()gets input for adding a participant to an event.splitAddParticipantCommandInput()parses input for adding a participant.askParticipantName()prompts for and reads a participant's name.askPassword()prompts for and reads a participant's password.askConfirmation(String message)asks the user for confirmation (y/n).confirmDeletion(String eventName)asks the user to confirm deletion of an event.
-
Output Display Methods:
showMessage(String message)displays a given message to the console.showMenu()displays the main command menu with all available actions.showEventWithIndex(Event event, int index, String priority)displays event details with its index and priority.showEmptyListMessage()displays a message when there are no events to show.printMatchingEvents(ArrayList<Event> events)displays matching events from a search.showAddFormat()displays the format for adding a new event.showAddedMessage(Event event)confirms an event has been added.showEditCommandMessageWithOptions(Event event)displays edit options for an event.showEditCommandCorrectFormat()shows correct format for edit commands.showEditCommandStep1()toshowEditCommandStep5()guide users through editing different event fields.showEditedEvent(Event event)displays updated event details.showByeMessage()displays a goodbye message when exiting.showWelcomeMessage()displays a welcome message at startup.showCollisionWarning()andshowParticipantSlotCollisionWarning()warn about scheduling conflicts.showDeletedMessage(Event event)confirms an event has been deleted.showMatchingEventsWithIndices(ArrayList<Event> matchingEvents, EventManager eventManager)displays matching events with indices.showDeletionCancelledMessage()informs that deletion was cancelled.showAddParticipantFormat()displays format for adding participants.showParticipantAdded(Participant p)confirms a participant was added.showLogOutMessage()displays logout message.showSuccessLoginMessage()confirms successful login.showSuccessCreateMessage(Participant participant)confirms user creation.
The UI component provides a comprehensive set of methods to handle user interactions, ensuring a clear separation between the user interface and the application logic. Each method is designed to handle a specific type of interaction, making the code more modular and easier to maintain.
The Logic Component is responsible for interpreting user input and executing appropriate actions in the system using the Command and Factory patterns. It is made up of several sub-components:
-
Parser Component:
Parser.java: Core class that receives and interprets user input.CommandParser.java: Provides helper methods to parse specific data (e.g., date-time, event details).
-
Command Component:
Command.java: Abstract base class that defines theexecute()method.- Concrete subclasses implement specific behaviors like
AddEventCommand,DeleteCommand,ListCommand, etc.
-
CommandFactory Component:
CommandFactory.java: Interface for creating Command objects.- Concrete factories (e.g.,
AddEventCommandFactory) encapsulate logic to construct and return specific command types.
This partial UML class diagram focuses only on the components involved in executing the add command:
- The
Parserreceives a command string and delegates toCommandParserfor detailed input handling. - A suitable
CommandFactory(likeAddEventCommandFactory) is created to generate the correspondingCommandobject. - That factory uses utility methods from
CommandParserto help construct the requiredCommand(e.g.,AddEventCommand). - The resulting
Commandis then ready to be executed by the system.
Note: Only selected classes (
AddEventCommandandAddEventCommandFactory) are shown for brevity. The actual system contains many more command types, each following a similar structure.
This sequence diagram illustrates the interaction flow when a user inputs the add command:
- The
Userenters an input string such asadd. - The
Parserinterprets the command and instantiates anAddEventCommandFactory. createCommand()is called on the factory.- Inside the factory,
CommandParseris used to:
- Prompt and read event details.
- Validate and parse the information (e.g., date-time format, name).
- Construct an
Eventobject.
- The
AddEventCommandis returned. - The command is then executed, adding the event to the system and notifying the UI.
Note: This diagram only shows the flow for the
AddEventCommand. Other command types likeedit,list,filter, etc., follow a similar interaction flow using their respective factories and command implementations.
The Model Component is responsible for representing the core data entities of the system and providing functionality to manage them. It is composed of the following parts:
-
Event Component:
Event.java: Core data structure for scheduled activities.EventManager.java: Manages the event collection and operations such as add, delete, or retrieve.
-
Participant Component:
Participant.java: Represents users in the system.ParticipantManager.java: Manages users including creation, deletion, and authentication.AvailabilitySlot.java: Tracks availability timeslots for participants.
-
Label Component:
Priority.java: Enum-like structure for event priority levels, supports flexible priority assignment.
-
Sort Component (implements Strategy Pattern):
Sort.java: Abstract base class defining the sorting interface.SortByStartTime.java,SortByEndTime.java,SortByPriority.java: Concrete implementations for sorting logic.
-
Exception Component:
SyncException.java: Custom exception used for synchronization-related errors within model operations.
- Storage.java: Base class for data persistence
- UserStorage.java: Handles user data storage
- Uses file I/O to save and load events and user data
The UserStorage component,
- is responsible for saving and loading user-related data, including participant details.
- stores data in a structured format, ensuring persistence across sessions. (sample: Alice | MEMBER | 123 | 2025-03-31 12:00,2025-05-31 12:00)
- depends on
Participantas it manages participant-related storage operations. - throws
SyncExceptionin case of synchronization failures.
The Storage component,
- handles the storage and retrieval of both event and priority data.
- integrates
UserStorageto manage participant-related information. - can save and load events, including participant details and scheduling information.
- depends on
UserStorage,Event, andPriorityas it manages multiple data types. - throws
SyncExceptionto handle potential storage errors.
- EventSyncLogger.java: Handles logging for debugging and tracking
- Classes used by multiple components are in the src/main/java package.
The AddEventCommand feature allows users to add an event to their schedule. It is implemented using the Command pattern, where AddEventCommand extends Command.
- Step 1. CLI Input (
addCommand):
- The user inputs the
addcommand via the CLI. This command is parsed, and theParsercreates anAddEventCommandFactoryobject.
- Step 2. Event Information Collection:
- The system prompts the user to input details of the event (such as time, location, and participant).
- Step 3. Command Object Creation:
- The
AddEventCommandobject is created with the collected event information.
- Step 4.Executing
addEvent:
- The
addEventmethod ofEventManageris called to add the event to the system. - This involves collision checks, participant availability checks, and priority assignment.
- The event is successfully added to the system and saved to storage.
Step 1. Null Check for Event
- The system ensures that the
eventis not null. If it is, anAssertionErroris thrown.
Step 2. Collision Check
- The
checkCollisionmethod is invoked to ensure that the event does not overlap with any existing events based on the start and end time, as well as the location. - If a conflict is found, a
SyncExceptionis thrown with an appropriate message, indicating the overlap.
Step 3. Participant Availability Check
- If the
participantis null: ASyncExceptionis thrown indicating that a participant must be specified for the event. - Check Availability: Ensures that the
participantis available during the event's scheduled time. If not, aSyncExceptionis thrown, informing that the participant is unavailable.
Step 4. Add Participant to Event
- Once all checks pass, the participant is added to the event. This action links the participant to the event in the system.
Step 5. Add Event to Event List
- The event is added to the system's list of events. This ensures that it is now part of the event scheduling database.
Step 6. Priority Assignment
- The method attempts to obtain a priority input from the user. This is typically used to categorize the importance of the event.
- If the user provides an invalid or missing input (e.g., no input at all), the system assigns a default priority of
"NULL".
Step 7. Save Event and Priority
- The event’s priority is saved to the system’s priority list for further reference. Both the event details and its priority are saved to persistent storage, ensuring that the event is stored for future retrieval.
Step 8. UI Update
- The user interface is updated with a success message to notify the user that the event has been successfully added. This provides feedback and confirms that the event addition process has been completed successfully.
Aspect 1: Conflict and Availability Checks
- Alternative 1 (current choice): Perform collision checks and participant availability checks before adding the event.
- Pros: Ensures data consistency by preventing overlapping events and unavailable participants.
- Cons: Might require additional resources and logic for collision detection, especially in large datasets.
Aspect 2: Priority Assignment
- Alternative 1 (current choice): Prompt the user for priority input and assign it to the event.
- Pros: Provides flexibility to users to set priorities.
- Cons: Relies on user input, which can be invalid or omitted.
Aspect 3: Error Handling
- Alternative 1: Throw
SyncExceptionon errors.- Pros: Centralized error handling that clearly defines issues.
- Cons: Requires users to manage exceptions correctly.
The EditEventCommand feature allows users to modify an existing event in their schedule. It is implemented using the Command pattern, where EditEventCommand extends Command.
- Step 1. CLI Input (
editCommand):
- The user inputs the
editcommand via the CLI. This command is parsed, and theParsercreates anEditCommandFactoryobject.
- Step 2. Event Selection:
- The system displays all available events and prompts the user to select an event by index.
- The system verifies that the current user has administrator privileges.
- Step 3. Command Object Creation:
- The
EditEventCommandobject is created with the event index and participant manager.
- Step 4. Editing Menu Loop:
- The system presents the user with options to edit different aspects of the event (name, start time, end time, location, description).
- For each edit, appropriate validation is performed (e.g., checking participant availability for time changes).
- Changes are saved to storage after each successful edit.
- Step 5. Exit Editing:
- The user can choose to exit the editing process when complete.
- All modified data is saved to persistent storage.
Aspect 1: Admin-Only Access
- Alternative 1 (current choice): Restrict editing to administrators only.
- Pros: Maintains data integrity by controlling who can modify events.
- Cons: Limits flexibility for non-admin users who may need to adjust their own events.
Aspect 2: Availability Verification
- Alternative 1 (current choice): Verify participant availability before confirming time changes.
- Pros: Prevents scheduling participants during their unavailable times.
- Cons: Adds complexity to time-editing operations.
Aspect 3: Incremental Editing
- Alternative 1 (current choice): Allow users to edit individual aspects of an event rather than replacing the entire event.
- Pros: Provides fine-grained control and preserves existing data that doesn't need to change.
- Cons: Requires more complex UI flow with multiple edit options.
The ConflictDetector feature checks for overlapping events in a user's schedule.
- Conflict Check: Compares the start and end times of all events in EventList.
- Feedback to User: If conflicts are detected, a warning message is displayed to the user.
- Why this design?
- Ensures users are aware of scheduling conflicts, preventing double-booking.
- Improves event management by highlighting overlapping schedules.
The ListEventCommand feature allows users to list all events in their schedule. It is implemented using the Command pattern, where ListEventCommand extends Command.
- Step 1. CLI Input (
listCommand):
- The user inputs the
listcommand via the CLI. This command is parsed, and theParsercreates aListEventCommandFactoryobject.
- Step 2. Command Object Creation:
- The
ListEventCommandobject is created, which will contain the logic to retrieve and display the events.
- Step 3. Command Execution:
ListCommand.execute()is called. It:- Retrieves the current logged-in user from
ParticipantManager. - Filters the events from
EventManagerbased on those involving the current user. - Sorts the events using the specified
Sortstrategy (SortByPriority,SortByStartTime, orSortByEndTime). - Displays the events via
UI.showEventWithIndex(...)with both event details and priority.
- Retrieves the current logged-in user from
Aspect 1: Event Retrieval
- Alternative 1 (current choice): Retrieve all events directly from the system’s storage.
- Pros: Simple and efficient for small data sets.
- Cons: May become inefficient for large data sets or if there are a lot of events to display.
Aspect 2: Sorting Strategy Implementation
- Alternative 1 (current choice): Uses the Strategy Pattern to dynamically choose a sorting strategy
(
SortByStartTime,SortByEndTime,SortByPriority).- Pros: Promotes open/closed principle — easy to add new sorting strategies without modifying existing code.
- Cons: Adds additional complexity when only one sorting mechanism is used; might be overkill for small use cases.
The DeleteCommand feature users to remove an event from their schedule by keyword. If multiple events share the same name, users are prompted to select the correct one based on the list shown.
- User Input Parsing:
The
Parserreads the event keyword from user input usingreadDeleteName().findMatchingEvents(name)is used to gather all matching events. If more than one match is found, the UI shows them with indices for disambiguation. - Event Deletion Flow: The selected event is passed to
DeleteCommandwith the correct index. Inexecute(), the user is asked to confirm the deletion viaui.confirmDeletion(). - Data Synchronization: If confirmed, the event and its corresponding priority are removed.
- Why this design?
- Maintains consistency between the events list and the priority list.
- Ensures safe deletion by confirming with the user.
The PriorityFilter feature allows users to filter events assigned to him based on priority levels:
- LOW
- MEDIUM
- HIGH
Input Formats Supported:
-
- Single priority (e.g., "LOW"):
- Filters events with exact priority match.
-
- Range of priorities (e.g., "LOW HIGH"):
- Filters events that fall within the inclusive range between the two specified priorities.
- The order of priorities matters。
- User Input Parsing: The Parser class parses input to FilterCommandFactory.
- Message Processing: The FilterCommandFactory class processes input in format {PRIORITY} or {PRIORITY PRIORITY}.
- Event Filtering: The FilterCommand handles the logic of comparing each event’s priority.
- Display: Events are printed to the user by the UI.
- Why this design?
- Provides flexibility for both simple and advanced users.
- Enhances user control and visibility over event prioritization.
- Keeps implementation simple and extensible for future priority levels.
The DuplicateEventCommand feature allows users to duplicate an existing event to their schedule. It is implemented using the Command pattern, where DuplicateEventCommand extends Command.
- Step 1. CLI Input (
duplicateCommand):
- The user inputs the
duplicatecommand via the CLI. This command is parsed, and theParsercreates aDuplicateEventCommandFactoryobject.
- Step 2. Event Selection:
- The system prompts the user to input the index of the event they wish to duplicate.
- Step 3. New Event Name Collection:
- The system prompts the user to input a new name for the duplicated event.
- Step 4. Command Object Creation:
- The
DuplicateEventCommandobject is created with the event index and new name.
- Step 5. Executing Event Duplication:
- The system creates a copy of the selected event with the new name.
- The duplicated event retains all properties of the original event (time, location, participants, etc.).
- The duplicate event is added to the system and saved to storage.
- A confirmation message is displayed to the user.
Aspect 1: Duplication Approach
- Alternative 1 (current choice): Create a complete copy of the existing event with a new name.
- Pros: Simple implementation that preserves all event details.
- Cons: May duplicate unnecessary information if user only wants to reuse part of an event.
Aspect 2: Participant Handling
- Alternative 1 (current choice): Copy all participants from the original event to the duplicate.
- Pros: Maintains team consistency across duplicate events.
- Cons: May require additional participant availability checks.
Aspect 3: Time Assignment
- Alternative 1 (current choice): Keep the same time as the original event.
- Pros: Simplifies the duplication process.
- Cons: May lead to scheduling conflicts if the event is meant for a different time.
The AddParticipantCommand feature enables users to add a participant to a specific event.
- Step 1. CLI Input (
addpCommand):
- The user inputs the
addpcommand via the CLI. This command is parsed, and theParsercreates anAddParticipantCommandFactoryobject.
- Step 2. Event Selection:
- The system prompts the user to input the index of the event to which they want to add a participant.
- Step 3. Participant Information Collection:
- The system prompts the user to input the participant's name.
- The system prompts the user to specify the access level (ADMIN or MEMBER) for the participant.
- Step 4. Command Object Creation:
- The
AddParticipantCommandobject is created with the event index, participant name, and access level.
- Step 5. Executing Participant Addition:
- The system validates that the event index and access level are valid.
- The participant is added to the event with the specified access level.
- The updated event information is saved to storage.
- A confirmation message is displayed to the user.
Aspect 1: Access Level Assignment
- Alternative 1 (current choice): Allow specifying ADMIN or MEMBER access when adding participants.
- Pros: Provides fine-grained control over participant permissions.
- Cons: Adds complexity to the participant addition process.
Aspect 2: Availability Checking
- Alternative 1 (current choice): Check participant availability before adding them to an event.
- Pros: Prevents scheduling conflicts for participants.
- Cons: Requires maintaining availability information for all participants.
Aspect 3: Duplicate Handling
- Alternative 1 (current choice): Prevent adding the same participant to an event multiple times.
- Pros: Maintains data integrity and prevents confusion.
- Cons: Requires additional validation checks.
The ListParticipantsCommand feature lists all participants assigned to a specific event.
- Step 1. CLI Input (
listpCommand):
- The user inputs the
listpcommand via the CLI. This command is parsed, and theParsercreates aListParticipantsCommandFactoryobject.
- Step 2. Event Selection:
- The system prompts the user to input the index of the event for which they want to list participants.
- Step 3. Command Object Creation:
- The
ListParticipantsCommandobject is created with the event index.
- Step 4. Executing Participant Listing:
- The system retrieves the event based on the provided index.
- The system fetches all participants assigned to the event.
- The participant information (names and access levels) is displayed to the user.
Aspect 1: Display Format
- Alternative 1 (current choice): Display participant names along with their access levels.
- Pros: Provides complete information about each participant's role.
- Cons: May clutter the display for events with many participants.
Aspect 2: Sorting Order
- Alternative 1 (current choice): List participants in the order they were added to the event.
- Pros: Simple implementation with natural historical ordering.
- Cons: May not be the most useful ordering for all use cases.
Aspect 3: Access Control
- Alternative 1 (current choice): Allow any user to view the participant list.
- Pros: Promotes transparency in event management.
- Cons: May expose participant information too broadly.
The Storage class handles persistent storage of event data to disk. It implements serialization/deserialization of events with participant associations.
- Step 1. Saving Events:
- Receives List from EventManager
- Formats each event with pipe-separated values
- Writes to specified file path with error handling
- Example:
Meeting | 2025-10-15 15:00 | 2025-10-16 02:00 | Meeting Room | Weekly Meeting | LOW |
- Step 2. Loading Events:
- Reads file line by line
- Parses each line into event components
- Reconstructs Participant objects via UserStorage
- Returns ArrayList for system initialization
Aspect 1: Data Formatting
- Alternative 1 (current choice): Pipe-delimited values with custom participant formatting
- Pros: Human-readable, easy to debug
- Cons: Requires escaping special characters
Aspect 2: Error Handling
- Choice: Skip corrupted lines but continue loading
- Pros: Maintains maximum data availability
- Cons: Potential silent failures
The UserStorage class manages persistent storage of participant data including availability slots.
- Step 1. Saving Users:
- Formats participant data with access levels
- Serializes availability slots as time ranges
- Uses pipe-delimited format with semicolon-separated slots
- Example:
name | ACCESSLEVEL | password | 2023-10-10 14:00,2023-10-10 15:00
- Step 2. Loading Users:
- Parses each line into Participant objects
- Reconstructs availability time slots
- Maintains relationship with Event participants
- Returns ArrayList for system use
Aspect 1: Authentication Data Storage
- Alternative 1 (current choice): Store passwords in plaintext
- Pros: Simple implementation
- Cons: Security vulnerability
The login system manages user authentication and session state through the ParticipantManager class.
- Step 1. Login Process:
- User enters username via CLI
- System checks existence via
getParticipant(username) - Valid user is prompted for password
- Successful authentication sets
currentUser - Failed attempts allow retry or exit
- Step 2. Logout Process:
- Clears
currentUserreference - Notifies UI of session termination
- Maintains all participant data
- Step 3. User Creation:
- New participants added via
create - Immediately persists to storage
- Includes name, password, access level and available slots
Aspect 1: Authentication Method
- Current Choice: Password matching in plaintext
- Pros: Simple to implement and debug
- Cons: Serious security vulnerability
- Future Improvement: Implement password hashing
Aspect 2: Session Management
- Choice: Single active session via
currentUser- Pros: Lightweight implementation
- Cons: No concurrent multi-user support
- Tradeoff: Matches CLI application constraints
Aspect 3: Error Recovery
- Implementation: Recursive retry on failure
- Pros: Good user experience
- Cons: Potential stack overflow risk
- Alternative: Iterative retry with attempt limit
The listall feature displays all events currently stored in the system.
This command is restricted to ADMIN users only.
After invocation, the user is prompted to choose a sorting method to organize the displayed events.
Access Control:
- Only users with ADMIN access level may execute the
listallcommand. - If a non-ADMIN user attempts access, a warning is issued.
Workflow:
-
- Command Parsing:
- The ADMIN user inputs the listall command via the CLI.
- The Parser identifies this input and delegates the creation to a ListAllCommandFactory.
-
- Command Object Construction:
- ListAllCommandFactory checks that the current user is ADMIN.
- Returns a ListAllCommand instance
-
- Command Execution:
- ListAllCommand.execute() does the following:
- Re-validates login and ADMIN status.
- Retrieves all events from EventManager.
- Sorts events using chosen Sort strategy.
- Displays results using the UI.
Aspect 1: Access Control
- Implementation: Restrict access to only ADMIN users.
- Pros: Ensures data confidentiality; prevents unauthorized access.
- Cons: Non-admin users cannot view full event list, even if necessary for context.
- Aspect 3: User Interaction for Sort Type
-
- Implementation: Prompt user for sort input at runtime using
UI.readListCommandInput().
- Implementation: Prompt user for sort input at runtime using
-
- Pros: Allows flexible choice each time the command is called.
-
- Cons: Requires additional input step from the user; might reduce efficiency if used frequently.
Setting up and maintaining the project website:
- We use Jekyll to manage documentation.
- The
docs/folder is used for documentation. - If you are using Intellij for editing documentation files, you can consider enabling ‘soft wrapping’ for *.md files.
Style guidance:
- Follow the Google developer documentation style guide.
- Also relevant is [se-edu/guides] Markdown coding standard
Diagrams:
- See the [se-edu/guides] Using PlantUML.
This project uses Java's built-in java.util.logging package for logging.
- The
EventSyncLoggerclass configures a sharedLoggerinstance. - Logs are written to both the console and a log file named
app.login the root directory. - Logging levels are controlled with:
ConsoleHandler: shows logs of levelINFOand above.FileHandler: captures all logs (Level.ALL) into the file.
Call the following method once at application startup:
EventSyncLogger.setupLogger();
To use the logger in any class:
Logger logger = EventSyncLogger.getLogger();
logger.info("Login successful");
logger.warning("Password attempt failed");
logger.severe("Unexpected null reference during sync");
The target user profile for this application includes individuals who need to manage their personal or professional schedules. These users may be:
- Students who need to track assignments and exam dates.
- Professionals who need to manage meetings, deadlines, and other appointments.
- Anyone looking for a simple, easy-to-use event management tool.
This application addresses the need for a lightweight, easy-to-use solution for managing and organizing events. It provides the following value:
- Simple Event Management: Users can add, list, and organize their events with minimal effort.
- Persistence: Events are saved between application sessions, ensuring that users' data is not lost.
- Flexibility: It allows users to customize events and sort them in the order they choose (chronologically).
By providing these features, the application allows users to focus on their tasks and not on manually managing their schedule.
| Version | As a ... | I want to ... | So that I can ... |
|---|---|---|---|
| v1.0 | team leader | add an event with a description and date/time | keep track of important events and deadlines |
| v1.0 | user | list all my events | see all my events organized by date/time |
| v2.0 | user | store events persistently | ensure my events remain even after restarting the application |
| v2.0 | team leader | edit event details | fix errors or update times |
| v2.0 | user | filter events by priority | focus on high-priority tasks when needed |
| v2.0 | team leader | add participants to events | track who is involved in each activity |
| v2.0 | user | detect scheduling conflicts | avoid double-booking myself |
| v2.0 | team leader | duplicate existing events | quickly create similar events without re-entering all details |
| v2.0 | user | sort events in different ways | view my schedule according to my current needs |
| v2.0 | user | create a user profile | have personalized access to the system |
| v2.0 | user | log in and out of the system | keep my schedule information secure |
- Performance: The application should be able to handle up to 1000 events efficiently, with quick load and save times.
- Usability: The application should be easy to use with minimal training. User commands should be clear and simple.
- Reliability: The application should be stable, with no crashes or errors during typical use cases. Data should not be lost in case of unexpected shutdowns.
- Portability: The application should work on different platforms, such as Windows, macOS, and Linux, as long as Java is installed.
- Maintainability: The codebase should be easy to maintain and extend, with well-documented functions and modular code.
- Scalability: The application should be able to scale to handle more complex user cases, such as handling recurring events or multiple event categories.
- Event - A scheduled activity with a description and a specific date/time.
- EventManager - Component that manages the collection of events and operations on them.
- Command Pattern - A design pattern that encapsulates a request as an object, allowing for parameterization of clients with different requests.
- Factory Pattern - A creational pattern that uses factory methods to create objects without specifying the exact class.
- Strategy Pattern - A behavioral design pattern that enables selecting an algorithm at runtime.
- Serialization - The process of converting an object into a format (such as text) that can be stored or transmitted, and later reconstructed.
- Participant - A user who is assigned to an event with a specific access level.
- Priority - A label indicating the importance level of an event (LOW, MEDIUM, HIGH).
- Steps:
- Run application
- Execute
createUsercommand - Enter:
- Name:
admin1 - Password:
admin123 - AccessLevel:
ADMIN - Availability: Provide valid time slots
- Expected:
- Admin account created successfully
- Account stored in UserStorage
- Steps:
- Execute
logincommand - Enter:
- Username:
admin1 - Password:
admin123
- Execute
- Expected:
- Login success message
currentUserset to admin1 with ADMIN privileges- Admin menu options displayed
- See addtional features listed below
- Steps:
- Execute
logoutcommand
- Execute
- Expected:
- Session terminated
currentUserset to null- Return to login screen
- Steps:
- Execute
createUsercommand - Enter:
- Name:
member1 - Password:
member123 - AccessLevel:
MEMBER - Availability: Provide valid time slots
- Execute
- Expected:
- Member account created
- Stored with MEMBER access level
- Steps:
- Execute
logincommand - Enter:
- Username:
member1 - Password:
member123
- Execute
- Expected:
- Login success message
currentUserset to member1- Member menu options displayed
- See addtional features listed below
- Steps:
- Execute
logoutcommand
- Execute
- Expected:
- Session terminated
- Return to login screen
- Storage Validation:
- Verify both accounts persist after restart
- Check event ownership records
- Access Control:
- Confirm admin can use all commands
- Verify member can use restricted command set
- Session Security:
- Verify proper session termination on logout
- Confirm credentials required for re-login
- Steps:
- Enter
addcommand in CLI - Provide valid event details (name, time, location)
- Specify priority level (e.g., HIGH)
- Enter
- Expected:
- Event added successfully
- Confirmation message displayed
- Event appears in list view
- Steps:
- Enter
addcommand - Omit participant field
- Enter
- Expected:
SyncExceptionthrown- Error message: "Participant must be specified"
- Steps:
- Add event at specific time
- Attempt to add another event at same time/location
- Expected:
SyncExceptionthrown- Error message: "Scheduling conflict detected"
- Steps:
- Enter
editwith valide index - Modify event details
- Confirm changes
- Enter
- Expected:
- Event details updated
- Changes persisted in storage
- Steps:
- Enter
editwith invalid index
- Enter
- Expected:
- Error message: "Invalid event index"
- Steps:
- Create two events with overlapping times
- Run conflict check
- Expected:
- System identifies conflict
- Warning message displayed
- Steps:
- Enter
list
- Enter
- Expected:
- Only events assigned to you displayed with complete details
- Steps:
- Clear all events
- Enter
list
- Expected:
- Message: "No events available"
- Steps:
- Enter
deletewith valid name - Confirm deletion
- Enter
- Expected:
- Event removed from list
- Storage updated
- Steps:
- Enter
deletewith invalid name
- Enter
- Expected:
- Error message: "Event not found"
- Steps:
- Enter
filterand choose priorityHIGH
- Enter
- Expected:
- Only HIGH priority events shown
- Steps:
- Enter
filterand choose priorityLOW(when none exist)
- Enter
- Expected:
- Message: "No events with LOW priority"
- Steps:
- Enter
duplicatewith valid index
- Enter
- Expected:
- New event created with same details
- Original event unchanged
- Steps:
- Enter
duplicatewith invalid index
- Enter
- Expected:
- Error message: "Invalid event index"
- Steps:
- Enter
addParticipantwith valid event index and participant name
- Enter
- Expected:
- Participant added to event
- Role assignment confirmed
- Steps:
- Enter
listParticipants
- Enter
- Expected:
- All participants listed with roles
EventSync Future Development Roadmap Proposed Features
- Event Management
- Advanced filtering and sorting
- Take attendance system
- Collaboration
- Shared calendars
- Invitation system
- Smart Features
- Automated scheduling suggestions
- Performance analytics


















