kymckay / f21as-project Goto Github PK
View Code? Open in Web Editor NEWAdvanced software engineering group project
License: GNU General Public License v3.0
Advanced software engineering group project
License: GNU General Public License v3.0
Result of @jonleesy and I's discussion today on reworking some of our class structure to break the overly complex linking between menu items and order items (which made the OrderList file parsing overly complicated as it had to be aware of class instances we hadn't planned for):
Something we've discussed before, but I think this is more relevant now that we are actually "simulating" transactions and will probably want the customer's names for the UI too.
This would involve:
We need a producer class running as a thread to add orders into the shared object (queue) after reading them in from the file.
The additions should happen gradually so some sleep should be added.
Currently our output report is constructed using repeated string concatenation.
A StringBuilder would be more suitable for this scenario as it's more efficient especially if we're to assume the menu contains many items.
This is just a simple refactor and shouldn't change the behaviour at all.
gui
branch exists the OrderBasket
class so you'll need to work from thereMenu
class should have the getReport
method removedOrderList
class should have the writeFile
method removedOrderBasket
class needs a method writeReport
which has a String
parameter representing the file name to write to.The method should:
ID: NumTimesOrdered (Description)
. These will all be fields you can access on the MenuItem
instances (number of times ordered not yet implemented at time of writing).OrderList
itself to expose the information you need.Now that I've started working on the producer, I think to make our lives simpler we should make the Queue
manage a list of Order[]
that way it can just pass arrays of Order
in and out at once - naturally grouping one customers orders together.
getToalIncome() returns full list instead of a single day
Customer should not be charged for regular milk.
Issue is related to previously brought up issue #51
Issue1:
Water is prices at 2,.00 and with option L only.
Issue 2:
Items that has size options M|L shows a different base price than expected price
"Allow customers to order online in advance. These orders could be handled using an additional queue that has priority over the main customer queue."
The key thing here is the addition of a second queue which the staff should prioritise orders from over the other queue.
The models, views and controllers should be split into separate package
Need a class to log events as they happen (sever finished, producer produced, shop closed etc.)
Stores instances of #6
Currently the kitchen queue section is a JTextArea which presents an issue as more orders are added into the queue and it starts to overflow.
Would be good to make use of these, although not pertinent to the overall function of the program.
The lunchtime discount works a bit weird when item with price under £2 (e.g. honey) is added. Any subsequently added beverages get a price change to £2 despite having a single food item in the food basket.
Have a feeling it has to do with the negative discount. Alternatively we could just remove/increase price for all item under £2 as it only seems to affect those items.
After all servers are finished a report should be generated (presumably similar to the report from stage 1)
Allow members of serving staff to be added and removed during the simulation. This could be done by the user (e.g. by pressing buttons) or automatically based on the queue length.
Accesses the underlying logic of the programme.
As we may all be working on different platforms and using different IDEs, we may want to set up some system of cross platform compatibility.
One such system is to all use EditorConfig. There's a plugin for VS Code and Eclipse which I know some of us are using both of.
I'd like to get JUnit tests set up to run via GitHub Actions (will run any time pushes are made for easy test automation).
Seems like a good run through of one possible setup: https://dev.to/ewefie/getting-started-with-github-actions-run-junit-5-tests-in-a-java-project-with-maven-20g4
Uses #14
The current layout is perfectly functional, but could be improved using a GridBagLayout which allows use of a grid with varied column/row dimensions (e.g. so the tables can take more horizontal space than the controls to the right). However, it is more complex to set up as desired than the currently used GridLayout.
I originally tried to do this but found that elements weren't expanding/contracting as the window was resized.
Deal with user interactions (implements action listeners).
Will be using a JList to show menu items, with buttons to toggle between filters for each item category. Controls at the side to set item properties when adding to an order. Current basket shown below, upon submission order is converted to separate Order instances as per the project specification (one for each item).
This is quite a big issue and we may want to open sub-tasks as issues linked to this for better incremental tracking.
Discount will also be applied to the basket upon submission.
This follows from the issues raised in the PR #79
Currently our OrderList
is hardcoded to use a LinkedList
for storage. This makes sense for the historical list which is primarily having orders appended to it. However, we're also using an OrderBasket
(subclass of OrderList
) for the UI's basket storage which means the UI table is more often accessing the values to display them. Here it would make more sense to use an ArrayList
.
The idea is to have the constructors accept any List
as a parameter and use that for the storage. This way, the different instances can benefit from different List
types as decided when they are instantiated.
Visual display of the GUI.
Subtask of #73
One order per #15
Should be similar with Server Class.
Uses #14
Remember price will need to get basePrice from MenuItem and add any additional cost for features
Need to get the initial project skeleton here on main branch for us to start our workflow on.
As we want to use JUnit for unit testing I may need to investigate build tools such as Maven for an IDE agnostic setup.
Shared object of the application.
Will have a list that's updated with incoming orders from the producer class (Order class). Elements will be removed from the list by the consumer threads (Server class).
List of input orders no longer represents orders that are in the past, but orders that will happen during the simulation (in future).
We should take out the data that isn't known yet (price paid, timestamp) and generate it at runtime (apply discount, etc.)
Keep in mind there will need to be a way of tracking the effect on price for some of these (Size, Colour, possibly Milk). See the lecture notes on enums 😃
Stores instances of #1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.