← Back to Home
Sprint Challenge: Java OOP
This sprint challenge is designed to assess your understanding of Java Object-Oriented Programming concepts covered in this unit.
Submission Deadline: Friday at 5:00 PM
Overview
In this sprint challenge, you will design and implement a Library Management System using the Java OOP principles we've covered: encapsulation, inheritance, polymorphism, and generics. Your system should be well-structured, maintainable, and demonstrate proper use of these concepts.
Instructions
Project Setup
Create a new Java project with the following structure:
LibrarySystem/
├── src/
│ ├── model/
│ │ ├── items/
│ │ ├── users/
│ │ └── library/
│ ├── util/
│ └── Main.java
└── README.md
Part 1: Core Item Classes
Design and implement the core classes for library items:
- Create an abstract LibraryItem class with common properties like id, title, isAvailable, etc.
- Implement concrete item classes: Book, DVD, and Magazine extending LibraryItem
- Include appropriate constructors, getters/setters, and override toString() method
- Add specialized methods and properties specific to each item type
Part 2: User Classes
Create user-related classes:
- Implement a User class with properties like id, name, contactInfo, etc.
- Create two types of users by extending the User class: Student and Faculty
- Add different borrowing privileges for each user type (e.g., students can borrow up to 5 items, faculty up to 10)
Part 3: Library Management
Implement the core functionality of the library system:
- Create a Library class to manage the collection of items and users
- Implement methods for adding items, registering users, borrowing/returning items
- Use appropriate data structures to store the collections
- Implement proper validation and error handling
Part 4: Generics Implementation
Demonstrate your understanding of generics:
- Create a generic Catalog<T extends LibraryItem> class to manage different types of items
- Implement a PairContainer<K, V> class that can be used to store key-value pairs (e.g., for tracking borrowed items)
- Create appropriate utility methods that use wildcards or bounded type parameters
Part 5: Main Application
Create a main application that demonstrates your system:
- In Main.java, create a simple demo showing how your system works
- Create sample items and users
- Demonstrate borrowing and returning items
- Show how different user types have different privileges
- Include examples of using your generic classes
Requirements
Submission Requirements
- Submit a ZIP file containing your project directory
- Include a README.md file explaining how to run your application and any design decisions you made
- Code should be well-documented with appropriate comments
- Follow Java naming conventions and best practices
Grading Criteria
- Encapsulation (20%): Proper use of access modifiers, getters/setters, and defensive copying
- Inheritance and Polymorphism (25%): Effective class hierarchy and use of polymorphic methods
- Generics (25%): Correct implementation of generic classes and methods
- Functionality (20%): Working system that meets all requirements
- Code Quality (10%): Clean, readable code following best practices