Graeme Geldenhuys wrote:
On 26/06/07, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
The compiler warns you if you create an instance of a class with
uninmplemented
abstract methods. It even tells you which ones:
It warns you yes, but doesn't prevent you from continuing. So you can
still get a runtime error when you application is doing it's job.
Delphi, I believe does the same think - but I think even worse, by not
even warning you.
Delphi warns if you create an instance from a class with abstract
methods, and doesn't warn if you are using a class reference because the
compiler cannot know which class is being instantiated. Just like fpc does.
I want to prevent developers from not implementing a method and
standing the chance of getting a runtime error. Interfaces seem to be
the only way to get this behavior?
Yes, but this approach will work properly only if you change your
instance references from classes to interfaces.
I don't mind if the developer implements blank methods, but at least
it forces them to pay attention. I have worked with developers that
never seem to look at the Messages window!!
The problem is in the developer, not in your code =)
--
Joao Morais
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives