Re: Using "abstract" on a class with no abstract method
Daniel Pitts <newsgroup.spamfilter@virtualinfinity.net> writes:
how about replacing your command structure with method calls:
clock.adjustClock();
clock.incrementCounter();
I think this idea illustrates the meaning of
?straightforward?.
However, my idea is to have a program that can be changed
at runtime. That is, components can be added or removed
from the program as plug-ins at run-time.
Say, the clock component issues a call to the text console
component. In your notation, this is:
textConsole.println( "clock ready." )
However, the user might not have added any text console
component to his program instance. So this can not work.
Instead, the clock component uses:
container.process( new PrintConsoleCommand( "clock ready." ));
Now, if the container happens to be a text console itself,
it will print the text. Otherwise, the text will be
forewarded in such a manner that it will reach all text
console components, if any is present in the program at
all at this moment, otherwise, the message will eventually
be ignored.
I also do not like to have a single communication manager,
because I want local interaction of components. That is,
each component interacts directly only with its container
and its containees.