Object-oriented programming (OOP) is a widely used approach for software development. In the terminology of languages like Java and C++, the unit of design in OOP is the class, which defines a type consisting of data fields and operations called methods. A class is a template from which objects or instances can be created. Values can be assigned to the fields of an object and the methods can be invoked on it. Classes can organized into a hierarchy by inheritance: one class is derived from another parent class, inheriting the parent's fields and methods, possibly adding fields and methods, and possibly overriding the parent's methods.
The constructs we studied in the previous chapter—packages and private types—support OOP, but without type deriviation and inheritance. This chapter and the next one describe the Ada constructs that support these concepts. The chapter will introduce a case study for the discrete event simulation of a rocket; this case study will be used extensively in the rest of the book. While the details of the case study are artificial, its structure and the use of the language constructs are realistic. The size of the case study will require quite a few forward references to concepts discussed later in the chapter and in other chapters, but we prefer to show the constructs in context, rather than discussing them one-by-one.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag London Limited
About this chapter
Cite this chapter
(2009). Type Extension and Inheritance. In: Ben-Ari, M. (eds) Ada for Software Engineers (Second Edition with Ada 2005). Springer, London. https://doi.org/10.1007/978-1-84882-314-3_7
Download citation
DOI: https://doi.org/10.1007/978-1-84882-314-3_7
Publisher Name: Springer, London
Print ISBN: 978-1-84882-313-6
Online ISBN: 978-1-84882-314-3
eBook Packages: Computer ScienceComputer Science (R0)