|Re: abstract with copy inheritance [message #984720 is a reply to message #574509]
||Wed, 14 November 2012 23:05
| Stephan Herrmann
Registered: July 2009
Ups, nobody ever answered this one?|
I'm intrigued by the example, tempted to say we could simply fix the compiler.
But then I wonder: T1.NR has an implementation for foo, OK, but it could still be abstract even if it contains no abstract methods.
In Java, marking a class as abstract is more than acknowledging that it has one or more abstract methods, it could simply be a way to specify: "not intended for instantiation".
In this light the "empty" role is an relevant override (and should be marked with @Override) re-declaring the role from abstract to non-abstract.
Let's briefly try the other way around: assume that without overriding the implicit role T1.NR would be non-abstract: how would I achieve it to be abstract (to prohibit instantiation)? I would need to "override" the abstract role with an empty abstract role. This might be a contrived example but this solution certainly feels even more weird.
From this I conclude it is indeed better, to not implicitly "improve" the role from abstract to not-abstract. Even if this is likely what you want, if it ever happens that you don't want this "improvement", you'll be much bewildered by this unsolicited magic.
does this make sense?
Powered by FUDForum
. Page generated in 0.07215 seconds