backlog
Module-Java π
Mandatory Tasks
These tasks will help consolidate your learning for this sprint. You should complete as many of these as possible before class on Saturday.
Sprint 7 - Challenge 1 π Clone
Sprint 7 - Challenge 1 π
Sprint Challenge 1
Overview
The code you write for this challenge is mandatory homework and should be completed and sent in a PR for review before class.
Build a computer store application that allows customers to configure and purchase custom computers.
Specification
Java application with a console-based menu system:
User options:
- Build Custom PC (choose components manually)
- Select processor (budget/performance/enthusiast)
- Select graphics card (integrated/gaming/professional)
- Select memory (8GB/16GB/32GB)
- Select storage (HDD/SSD/NVMe)
- Customize options (case color, warranty, RGB)
- Quick Build - Budget PC
- Use appropriate factory
- Quick Build - Gaming PC
- Use appropriate factory
- Quick Build - Workstation PC
- Use appropriate factory
- View Available Components
- Exit
- Build Custom PC (choose components manually)
After building, display:
- Complete specifications
- Total price
- Estimated delivery time
Developer Guidance
- Create a PCComponent interface with methods:
String getName()double getPrice()String getSpecifications()ComponentType getType()(enum: PROCESSOR, GRAPHICS_CARD, MEMORY, STORAGE)- Create implementations: Processor, GraphicsCard, Memory, Storage
- With static factory methods for:
- Processor:
budget(),midRange(),performance() - GraphicsCard:
integrated(),gaming(),professional() - Memory:
standard8GB(),standard16GB(),performance32GB() - Storage:
hdd1TB(),ssd512GB(),nvme1TB()
- Processor:
- Create an abstract factory interface for creating complete component families - each factory should coordinate components that work well together for their purpose
interface PCComponentFactoryProcessor createProcessor()GraphicsCard createGraphicsCard()Memory createMemory()Storage createStorage()String getThemeName()String getDescription()
- Implement three themed factories:
BudgetPCFactory(Β£500-700)- Budget processor
- Integrated graphics
- 8GB memory
- HDD storage
GamingPCFactory(Β£1200-1500)- Performance processor
- Gaming graphics card
- 16GB memory
- NVMe storage
WorkstationPCFactory(Β£2000-2500)- Enthusiast processor
- Professional graphics card
- 32GB memory
- NVMe storage
- Create a PC class that uses a builder pattern to create instances,
- with fields:
- Processor (required)
- Graphics Card (required)
- Memory (required)
- Storage (required)
- Case colour (optional, default: “Black”)
- Warranty years (optional, default: 1)
- And methods:
double getTotalPrice(sums price of components)String getDetailedSpecs(returns a nicely formatted string of the component parts β you can also just use an overridden toString here if preferred)
- with fields:
Submission & Review
Fork the coursework repo to your own GitHub account. Make regular small commits with clear messages. When you are ready, open a Pull Request to the CYF repo. Make sure you fill in the PR template provided. A volunteer will review your submission and send you feedback.
Sprint 7 - Sprint Challenge 2 π Clone
Sprint 7 - Sprint Challenge 2 π
Sprint Challenge 2
So far we have only looked in depth at creational design patterns (i.e. patterns that help you create objects), but there are other categories too (see Design Patterns Catalog).
Requirement
- Choose a non-creational design pattern and prepare a 5 minute presentation to deliver to your classmates
- The presentation should cover:
- What the pattern is, its intent
- Pros and cons of using the pattern
- An explanation, including class diagrams of the technical components involved
- A worked Java example for a real world scenario (try to think of one yourself), showing the code without the pattern, and then refactored to use the pattern, thus demonstrating its value
- This should be code written by you, don’t just copy off the internet or use AI as you won’t learn as much!
Submission & Review
Fork the coursework repo to your own GitHub account. Make regular small commits with clear messages. When you are ready, open a Pull Request to the CYF repo. Make sure you fill in the PR template provided. A volunteer will review your submission and send you feedback.