Android/Kotlin learning repo for practicing design patterns through incremental branches.
This repository is intentionally organized as a step-by-step exercise. The master branch acts as the index, while each practice branch captures one stage of the implementation so readers can follow the evolution of the code over time.
The first practice explores the Strategy pattern using a small Android duck simulation inspired by the classic "encapsulate what varies" example.
The goal is to show how behavior can move from concrete classes into interchangeable strategy objects, making the app easier to extend without changing every duck type.
| Step | Branch | Focus |
|---|---|---|
| 1 | 1-StrategyInit |
Initial setup for the Strategy pattern practice. |
| 2 | 1-1-StrategyNewFeatureRequested |
Adds a new flying feature directly, exposing the need for a better design. |
| 3 | 1-2-StrategyEncapsulateWhatVaries |
Encapsulates behaviors that vary behind interfaces. |
| 4 | 1-3-StrategyIntegratingDuckBehaviors |
Integrates fly and quack behaviors into the duck types. |
| 5 | 1-4-StrategySettingBehaviorDynamically |
Demonstrates changing duck behavior at runtime. |
Start from the earliest branch and move forward one branch at a time:
git checkout 1-StrategyInit
git checkout 1-1-StrategyNewFeatureRequested
git checkout 1-2-StrategyEncapsulateWhatVaries
git checkout 1-3-StrategyIntegratingDuckBehaviors
git checkout 1-4-StrategySettingBehaviorDynamicallyThe value of the repo is in the progression between branches, not only in the final state.
This is a public learning project. It is included as evidence of design-pattern practice, incremental refactoring, and the ability to explain architecture concepts through small Android examples.