[DGD] object types from a Java perspective
Felix A. Croes
felix at dworkin.nl
Mon Jul 12 00:30:12 CEST 2004
In Java, almost all typechecking is done at compile time. In LPC, object
types are checked at runtime only. In fact, the object type does not even
have to exist as an object, though in that case the check will of course
always fail.
Knowledge of object (class) types in Java also involves a lot of other
knowledge, such as the functions callable in that object, and so on.
In LPC such knowledge only exists if the object is inherited. This is
both a bane and a boon, for in a persistent environment the ability to
arbitrarily change interfaces and functionality can be quite useful. I
am currently considering implementing abstract objects for LPC
(declaration or inheritance of code-less prototypes in an object not
marked as "abstract" results in a compile-time error), but I am not yet
sure if abstract functions & objects would "fit" in LPC.
In Java the object must be explicitly named. In LPC it is named by a
string constant, which may be a concatenation of other string constants.
Since object type checks are performed at runtime, they take ticks at
runtime. However the implementation is quite efficient, and results
are cached.
Regards,
Dworkin
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list