Professional Documents
Culture Documents
Software Engineering Group Report Stage 2 - Updated
Software Engineering Group Report Stage 2 - Updated
1
2
Contents
Brief Explanation of Functionality and Limitations........................................................................4
UML Class Diagram..................................................................................................................... 4
Threads in Application.................................................................................................................6
Pattern in Application...................................................................................................................6
Extensions in Application............................................................................................................. 6
Git Commit History....................................................................................................................... 6
Development Report.................................................................................................................... 8
Iteration 1................................................................................................................................. 9
Iteration 2................................................................................................................................. 9
Iteration 3................................................................................................................................. 9
Application UI............................................................................................................................ 10
Technical Report........................................................................................................................ 12
Introduction............................................................................................................................ 12
Functionality........................................................................................................................... 12
Architecture............................................................................................................................ 13
Class and Code Explanation..................................................................................................13
Usage of Threads................................................................................................................... 13
Usage of Design Patterns......................................................................................................14
Extensions to the Application.................................................................................................14
Development Process............................................................................................................ 14
Evaluation of the Agile Approach...........................................................................................14
Conclusion............................................................................................................................. 14
Code Snippet............................................................................................................................. 15
3
Brief Explanation of Functionality and Limitations
The application is designed to handle the distribution of parcels to customers. It reads
customer data from a file, displays the data in tables, and then proceeds with the
distribution process. The core functionality of the application includes the following
steps:
1. Reading Data: The application reads customer data from a file, which typically
contains information such as customer names, parcel IDs, parcel weights, and
parcel fees.
2. Displaying Data: After reading the data, the application displays it in tables,
allowing users to visualize the customer details and the parcels associated with
each customer. This provides a convenient overview of the distribution process.
3. Distribution Process: The application uses threads to process customers
concurrently. Each customer is processed in a separate thread, enabling parallel
processing and efficient utilization of computing resources.
4. Fee Calculation: For each customer, the application calculates the fee for their
parcel based on certain criteria or business rules. The calculated fees are then
associated with the corresponding parcels and updated in the tables.
5. Updating Tables: As the distribution process progresses, the application
updates the tables by removing customers and parcels that have been
processed. This ensures that the tables accurately reflect the current state of the
distribution.
6. Pause and Resume: The application includes functionality for pausing and
resuming the distribution process. This allows users to temporarily halt the
processing, perhaps to handle other tasks or address any issues, and then
resume from where they left off.
4
UML Class Diagram
5
Threads in Application
Threads are used in the application to handle the distribution process concurrently. The
log entries indicate that the application is taking customers from a queue, processing
their information, and calculating fees for their parcels. This suggests that each
customer is processed in a separate thread, allowing multiple customers to be handled
simultaneously.
Using threads can improve the efficiency and responsiveness of the application. Instead
of processing customers sequentially, which could result in waiting times for each
customer, threads allow for parallel processing.
By using threads, the application can take advantage of multi-core processors and
utilize available computing resources more effectively. However, it's important to ensure
proper synchronization and thread safety when accessing shared data or resources to
avoid conflicts and inconsistencies.
Pattern in Application
The singleton pattern is used in the application. The singleton pattern ensures that
only one instance of a class exists throughout the application's execution. In the context
of your application, it's likely that the singleton pattern is used among the resources or
components.
For example, in our application logging process is implemented as a singleton. This
ensures that only one instance of the log for entries exists, and it can be accessed from
multiple parts of the application without creating multiple instances.
Extensions in Application
1. Delivery of more parcels arrives
2. Show worker taking break
6
7
GitLab:
8
GitHub:
Development Report
Agile development is an iterative and incremental approach to software development
that emphasizes collaboration, adaptability, and customer satisfaction. It promotes
flexibility and responsiveness to changing requirements, allowing for faster delivery of
valuable software.
The specific features included in each iteration are determined based on several
factors, including priority, complexity, and dependencies. The goal is to deliver the most
valuable and essential functionality to the customer at the end of each iteration.
The success of the agile approach depends on various factors, including effective
communication, collaboration, and adaptability. By involving stakeholders and
9
customers throughout the development process, agile methodologies promote
transparency and align the software with customer expectations.
Here are some potential features that could have been included in the iterations of your
program:
Iteration 1
Reading data from a file and parsing it into customer and parcel objects.
Displaying the customer data in tables.
Iteration 2
Implementing threads to process customers concurrently.
Calculating fees for each parcel based on specific criteria.
Updating the tables to reflect the processed customers and parcels .
Iteration 3
Adding pause and resume functionality to allow users to control the distribution
process.
Implementing basic error handling and logging mechanisms.
The success of the agile approach can be evaluated based on factors such as customer
satisfaction, adherence to project timelines, flexibility to accommodate changes, and
overall product quality. It is important to conduct regular retrospectives and gather
feedback from stakeholders to continuously improve the development process.
10
Application UI
Before Starting:
11
After start button clicks:
12
After Finish button clicks:
Technical Report
Introduction
The solution is designed to automate the process of distributing parcels to customers based on
specific criteria. This technical report provides an overview of the functionality, architecture,
design patterns, extensions, and development process of the application.
Functionality
Aims to efficiently distribute parcels to customers by implementing the following functionalities:
a) Reading Data: The application reads customer and parcel data from a file.
b) Displaying Data: The data is displayed in tables, allowing users to view customer and
parcel information.
13
c) Threads: The application uses threads to enable concurrent processing of parcels,
hence improving performance.
d) Calculating Fees: The application calculates fees for each parcel based on specified
criteria.
Architecture
The application follows a modular architecture, consisting of the following classes:
b) Parcel Class: The Parcel class represents individual parcels with attributes like ID,
weight, and fee. It provides getters and setters for accessing and modifying parcel
attributes.
Usage of Threads
Threads are utilized in the application to enable concurrent processing of customers. By
employing multiple threads, the application can distribute parcels efficiently, improving overall
performance. In our application thread is responsible for processing a customer and his/her
respective parcel(s).
14
Usage of Design Patterns
The application utilizes the Singleton design pattern for the Log.java class. Only one instance is
used to save records & at the end, saved into a file to be viewed. By implementing the class as
a Singleton, only one instance of the queue exists, providing a global point of access throughout
the application. This pattern ensures consistent access to the queue without the need for
multiple instances.
2. Show the worker taking a break: The application allows users to pause and resume
the distribution process. Once pause button is clicked, the thread waits for the signal to
resume the process This feature provides flexibility and control over parcel distribution,
enabling users to manage interruptions or make adjustments as needed.
Development Process
The development process followed agile principles to ensure flexibility, adaptability, and
customer satisfaction. The application was developed in iterations, with each iteration delivering
a subset of features or user stories. The features were prioritized based on value and
complexity. Regular communication and collaboration with stakeholders and customers ensured
transparency and alignment with their expectations.
Conclusion
The Parcel Distribution Application provides an automated solution for efficient parcel
distribution. It employs multithreading, design patterns, and extensions to enhance
performance, usability, and control. The application successfully meets the specified
requirements. The modular architecture and utilization of threads enable concurrent processing,
improving efficiency. The Singleton pattern ensures consistent access to the distribution queue.
The agile development approach allowed for iterative development, resulting in a successful
outcome.
15
Code Snippet
DepotController.java
private void initialize() {
log = Log.getInstance();
// creating handlers for customer & parcel lists
this.readData();
log.generateLogEntry("Reading Data from file.");
16
this.dimensions.setCellValueFactory(new PropertyValueFactory<Parcel, String>("fullName"));
this.parcelDisplayTable.getItems().clear();
this.parcelDisplayTable.setItems(FXCollections.observableList(threadParcelList));
threadCustomerList = Utility.readCustomers();
threadParcelList = Utility.readParcels(false);
threadCustomerList.sort(Comparator.comparingInt(Customer::getSequence));
}
@FXML
private synchronized void pauseDistribution() {
if (isPaused) {
log.generateLogEntry("Resume button clicked.");
breakButton.setText("Break");
17
isPaused = false;
messageTxt.setText("Working!");
notify();
} else {
log.generateLogEntry("Pause button clicked.");
breakButton.setText("Resume");
isPaused = true;
messageTxt.setText("Taking a break!");
}
}
@FXML
private void finishDistribution() {
log.generateLogEntry("Finish button clicked.");
isStopped = true;
executorService.shutdown();
startButton.setDisable(true);
breakButton.setDisable(true);
finishButton.setDisable(true);
messageTxt.setText("Finishing the work!");
}
18