Pick the fix
A team has BaseActivity → BaseNetworkActivity → BaseListActivity → FeedActivity, and changes in the base classes keep breaking screens. Better design?
Hint 1 of 1
Is inheritance the only way to share behaviour?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Compose behaviour from small helpers and delegates instead of a deep hierarchy
Correct. Composition keeps each piece separate and replaceable.
Why not the others?
- B Add another base class. Makes it deeper.
- C Make every method open. More ways to break.
- D Copy the code into each Activity. Duplication, not design.