[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Abstract classes in Oberon / OOC
At 06:33 AM 14/12/98 EST, Mike Griebling wrote:
>> Would it be possible to add something like this to OOC? Here are two
>> possibilities:
>>
>> 1) Allow [ABSTRACT] tags to be used on RECORD and PROCEDURE declarations.
>> For ABSTRACT procedures the body is ignored if specified.
>> -- OR --
>> 2) Interpret a procedure with a single HALT(abstractMethod) statement as an
>> abstract method.
>>
>
>I have no real problem with this addition but also don't see it as a big
>deal. I have yet to have a problem where an abstract class not being
>implemented has caused a problem. Most problems are caused by incorrectly
>implemented classes and/or methods. If someone intentionally leaves some
>methods unimplemented, would the compiler generate errors or warnings during
>compilation of the class module?
The compiler would generate an error. If you decalare a concrete class that
has not implemented all abstract methods, it is not a concrete class - its
still abstract. Therefore it should be recognised as an error.
> If they are errors, then I see the same
>problem since people may just stub a method with a dummy procedure.
Sure. You can always circumvent this sort of thing. It only stops you from
making mistakes. You can accidentally forget to implement a method - you
can't accidentally write a stub procedure.
> If they
>are warnings, then people tend to ignore warnings--especially if there are
>a lot of them. Witness, the many C++ compiler warnings.
- Stewart