Sprint Challenge Overview
This sprint challenge will test your understanding of Lists, Big O notation, and object comparison/sorting in Java. You will apply concepts learned throughout the sprint to solve problems involving ArrayList operations, algorithm analysis, and implementing both Comparable and Comparator interfaces.
Key Learning Objectives
This challenge covers the following learning objectives from the modules:
Module 1: Lists
- Implement code to iterate over the elements of a List
- Add and remove objects from a List
- Access elements by index from an ArrayList
- Understand ArrayList's runtime complexity for different operations
Module 2: Big O
- Analyze algorithm time and space complexity using Big-O notation
- Identify and explain constant, linear, and polynomial complexity
- Compare algorithms based on their time and space complexities
Module 3: Comparable
- Design and implement the Comparable interface for natural ordering
- Create a consistent implementation between equals() and compareTo()
- Use a type's natural comparison method to compare objects
Module 4: Comparators and Using sort()
- Implement Comparators for custom ordering strategies
- Choose between Comparable and Comparator for different scenarios
- Use Java's sort implementations to sort collections
Mastery Tasks
Mastery Task 4: Inevitable
Change is inevitable, and it's time to bring a big change to the Missing Promise CLI. You'll redesign the PromiseDao to support multiple clients and implement an OrderFulfillmentServiceClient class.
Milestones:
- Redesign the PromiseDao to support multiple clients, including the OFS client and future clients
- Implement your OrderFulfillmentServiceClient class following the pattern of other service clients
- Update the PromiseDao to match your design and retrieve the packaging promise from your client
Exit Checklist:
- Create mastery-task4.txt in the src/resources folder
- Implement OrderFulfillmentServiceClient
- Update the PromiseDao to retrieve the packaging promise from OFS
- Ensure all tests pass locally
- Push your code and verify TCTs are passing in CodeGrade
Mastery Task 5: Devil in the Details
Enhance the Missing Promise CLI to display promises for each item in an order and implement sorting to make it easier for CS representatives to use the tool.
Milestones:
- Modify the code to return the promise(s) for each item in an order
- Implement sorting so that item promises are sorted alphabetically by their ASINs
- Create a PromiseAsinComparator in a new package
Exit Checklist:
- Modify code to return promises for each item in an order
- Implement PromiseAsinComparator for sorting promises by ASIN
- Write unit tests to ensure proper functionality
- Ensure all tests pass locally
- Push your code and verify TCTs are passing in CodeGrade
Important: Use the same forked repository from Sprint 5 to complete these Mastery Tasks.