--

I've remembered another use-case where Interface and Abstract class solves my problem but Delegation won't (or I don't have the knowleged to do it).

Interface X

Abstract class Core : X

Abstract class ProjectBase : Core

- X contains ViewModel factory and ViewBinding logic (private);

- Core implements X and overrides project agnostic logic;

- ProjectBase extends Core and overrides the remaining X (project related) methods.

With Delegation I would need an interface implementation (Impl), but then ProjectBase wouldn't override the desired methods. If Impl was abstract Core couldn't extend from other classes, for instance AppCompatActivity.

I don't know how could I solve this setup with Delegation.

Please feel free to share you knowledge. Thanks.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Guilherme Delgado
Guilherme Delgado

Written by Guilherme Delgado

Software Engineer at BlissApplications 🇵🇹 • github.com/GuilhE • When I’m not coding I’m 🧗🏽or 🏄‍♂️

No responses yet

Write a response