OOP vs. readability

  • Authors:
  • Jeffrey R. Carter

  • Affiliations:
  • PragmAda Software Engineering, 1540 Coat Ridge Road, Herndon, VA

  • Venue:
  • ACM SIGAda Ada Letters
  • Year:
  • 1997

Quantified Score

Hi-index 0.00

Visualization

Abstract

A previous paper discussed the relationship between the object-oriented-programming (OOP) feature known in Ada 95 as dispatching and Ada's expressed design goal of emphasizing ease of reading and understanding over ease of writing [1]. A comparison of Barnes' alert-system example [2] using Ada-95 dispatching and using Ada-83 composition showed that dispatching emphasized ease of writing over ease of reading, while composition emphasized ease of reading over ease of writing. This led to the conclusion that the goals of dispatching conflict with Ada's expressed design goals.Dispatching is half of OOP; the other half is inheritance, correctly called type extension in Ada 95. This paper examines the relationship between inheritance and Ada's expressed design goal of emphasizing ease of reading and understanding over ease of writing.Object-oriented design (OOD), as introduced by Booch [3], emphasizes the software-engineering principles of locality, encapsulation, and information hiding. Ada 83 supports such OOD well; using OOD and Ada results in easy-to-read programs that exhibit low coupling and high cohesion. OOD is independent of OOP: Fully object-oriented designs may be implemented using composition methods familiar to Ada-83 users without any need for OOP features (inheritance and dispatching). OOP features may likewise be used without OOD.