NOTE: It's just an idea, not a proposal.
I'm a big fan of clarity in design.
Clarity is what makes your design understandable and maintainable.
'implement' - implements an abstract/interface method -
First-time definition
'override' - overrrides a concrete base method - Replaces or
extends existing logic
interface Clickable
{
void onClick();
}
class Component
{
void render()
{
writeln("Rendering generic component");
}
}
class Button : Component, Clickable
{
implement void onClick()
{
// First-time implementation of Clickable.onClick
writeln("Button clicked!");
}
override void render()
{
// Overrides Component.render
writeln("Rendering a button");
}
}
---- currently you can do it this way in D, and it provide very
little clarity at all.
interface Clickable
{
void onClick();
}
class Component
{
void render()
{
writeln("Rendering generic component");
}
}
class Button : Component, Clickable
{
void onClick()
{
writeln("Button clicked!");
}
override void render()
{
writeln("Rendering a button");
}
}