Abstract
ion of data by support of polymorphism can thus be seen to be a way to economise in the amount of code a programmer has to generate for any particular application. Because the data remains in generic form (data abstraction) right up to the time when an object is required to perform its function/s (method/s), the same class definition can be used at run time to represent many 'external' objects which have identical generic attributes. Application software does not need to encapsulate the associated coding more than once (in generic form). 'Dynamic binding' (1.2 & 1.3) is recognised as one of the most important properties of object orientation. The concept enables methods which are features of a class, as well as attributes, to take different forms in different sub classes; the appropriate form only being specified at run time as part of the create operation. For example, the class centrifugal pump may be a 'parent' to a number of sub-classes, each having not only different inlet and outlet diameters, impeller diameters, suction pressures etc., but also design differences such as, for instance, shrouded or unshrouded impellers. This means that the procedure to be used to calculate say discharge pressure, though similar, need not be the same for any two pumps. At run time, appropriate procedures for calculating discharge pressure, mass flow rate etc. will be selected dynamically as part of the process of creating an instance of the appropriate sub-class. In the examples given above, not only the dynamic values of the attributes but, given support for dynamic binding, correct operations (methods) could be decided at run time. Not only attributes, but also methods can remain in generic form until run
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
More From: WIT Transactions on Information and Communication Technologies
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.