Try OpenEdge Now
skip to main content
Object-oriented Programming
Object-oriented Programming and ABL : Overview of object-oriented programming : Strong typing
 

Strong typing

Strong typing is the enforcement of type conformance. The object types defined by classes and interfaces are analogous to the built-in primitive types of the language. Object types are identified using an object type name that includes the name of the class or interface. For a user-defined class or interface, this name matches the filename of the file that stores the definition of the class or interface type. The object type name that includes this class or interface name allows ABL to locate the specified class or interface definition at both compile time and run time. Thus, the class file also defines the class or interface as a user-defined object type, which the compiler uses to validate references to the class or interface and its members. For built-in classes and interfaces, ABL validates references against internal class and interface definitions.
Object type validation is similar to data type checking for variables. ABL uses the entire class definition, including all of its data members, properties, methods, and events, as a distinct type which must be perfectly matched by all references to the class. Most object type usage is validated at compile time ensuring that a member cannot be accessed on a class unless a member of the same name with the exact data type or signature is defined by the class or its hierarchy. Thus, the compiler ensures that the program will execute without type errors. Again, this is similar to ABL ensuring that you do not attempt to perform a multiply operation on two character strings, because only numeric data types can be operated on using multiplication.
* Comparison with procedure-based programming