---
# System prepended metadata

title: 'Jam 07 - Inheritance, Interfaces, and Polymorphism'
tags: [polymorphism, "2 \U0001F4DD in writing", inheritance, uml, interfaces, junit, abstract-classes, "3 \U0001F9EA in testing", "4 \U0001F973 done"]

---

---
title: "Jam 07 - Inheritance, Interfaces, and Polymorphism"
tags: 
  - 2 📝 in writing
  - 3 🧪 in testing
  - 4 🥳 done
  - inheritance
  - interfaces
  - polymorphism
  - uml
  - abstract-classes
  - junit
---
<!-- markdownlint-disable line-length single-h1 no-inline-html -->
<!-- markdownlint-configure-file { "ul-indent": { "indent": 4 }, "link-fragments": {"ignore_case": true} } -->

{%hackmd dJZ5TulxSDKme-3fSY4Lbw %}

# Jam 07 - Inheritance, Interfaces, and Polymorphism

:::spoiler **Course Development Team**
<center>
    <table width="100%">
    <tr align="center">
        <td width="50%">
            <img src="https://www.dropbox.com/scl/fi/uz9dn7vc9y5k43160pdb0/Fun-Artsy-Square.png?rlkey=2zmgqgblwsagukfsb343tl3ye&raw=1" alt="Lily Romano" width="100" style="border-radius: 50%"/><br/>
            <a href="https://lilyromano.com">Lily Romano</a>
        </td>
        <td width="50%">
            <img src="https://www.bucknell.edu/sites/default/files/styles/faculty_page_photo/public/libris/C00001GOQFVeT0YE/G0000hRJySpIobZY/20160419-7C8A4469.jpg" alt="Brian King" width="100" style="border-radius: 50%"/><br/>
            <a href="https://www.bucknell.edu/fac-staff/brian-king">Brian King</a>
        </td>
    </tr>
    </table>
</center>
:::

|                        |                                         |
| ---------------------- | --------------------------------------- |
| **Working Directory:** | `src/main/java/jam07`                   |
| **Points:**           | 10 pts                                   |
| **Team-based?**       | NO (but discussion encouraged)           |
| **Due:**             | Wednesday, 2025-Mar-19 11:59 PM           |

# Objectives

- Implement inheritance hierarchies with abstract classes
- Create and use interfaces for behavior contracts
- Apply polymorphism through method overriding
- Design role-based access control using inheritance
- Implement advanced search functionality with interfaces
- Write effective JUnit tests to validate code behavior

# Introduction & Outcomes

Welcome to Jam 07! This jam represents a significant milestone in your Java journey, where you'll move from working with individual classes to creating sophisticated class hierarchies and relationships. Building on your experience with classes from previous jams, you'll now explore more advanced object-oriented concepts through inheritance and interfaces. You'll also take your first steps in writing your own JUnit tests, building on the test-driven development experience you gained from working with provided tests in Jams 05 and 06.

These concepts are fundamental to professional software development, enabling you to:

- Create flexible, maintainable code through inheritance
- Define clear contracts between components using interfaces
- Ensure code quality through comprehensive testing
- Model complex system behaviors with state diagrams

By the end of this jam, you'll have transformed your retail system into a professional-grade application with role-based access control, sophisticated search capabilities, and robust error handling.

## What You'll Learn & Accomplish

1. **Object-Oriented Design**
    - Create abstract classes and interfaces
    - Implement inheritance hierarchies
    - Apply polymorphic behavior
    - Design role-based access systems
    - **Outcome**: Design and implement an employee management system with different roles and permissions

2. **Interface Implementation**
    - Define interface contracts
    - Implement interfaces across multiple classes
    - Create search functionality using interfaces
    - Apply interface-based polymorphism
    - **Outcome**: Build a flexible search system that works across different object types

3. **Testing Skills**
    - Write JUnit test cases
    - Design test scenarios
    - Validate code behavior
    - Practice test-driven development
    - **Outcome**: Create comprehensive test suites for your implementations

4. **Professional Development**
    - Document class hierarchies
    - Write maintainable tests
    - Follow testing best practices
    - **Outcome**: Produce well-tested, maintainable code with clear documentation

<!-- Embeds Jam07-Checklist.md -->
{%hackmd e-TXt0nRRMua_mXjs4Mqlg %}

<!-- Embeds Jam07-Exercise1.md -->
{%hackmd CO7fGrniRpqnJrm1RtzNjA %}

<!-- Embeds Jam07-Exercise2.md -->
{%hackmd euHUoxTcT3id5yIKObaApw %}

<!-- Embeds Jam07-Exercise3.md -->
{%hackmd p3sjaGMnQHGIpeUvAqER1w %}

<!-- Embeds Jam07-Exercise4.md -->
{%hackmd -Oc5DgywQpGl20eh4OEtMg %}

<!-- Embeds Jam07-Exercise5.md -->
{%hackmd ERc5atoBQUa3TFNWy67V3A %}

<!-- Embeds Jam07-Summary_Submission.md -->
{%hackmd 0fN9fvp-T9eLC8j-t7DvpA %}
