Abstract
Some bad reasons to create classes
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
A record is a simple data structure that groups together a collection of fields.
- 2.
Known as the Open/Closed principle, meaning the class should be open for extension but closed for modification.
- 3.
See the earlier section, “Have Questionable Motives for Creating Classes.”
- 4.
This is called the Single Responsibility Principle (Martin, 2009).
- 5.
A concrete class is a class with no missing implementation details, unlike, say, an abstract class or interface .
- 6.
Because both ArrayList and LinkedList implement the List interface .
- 7.
Ways also exist to do this without the use of inheritance ; for example, by using certain design patterns. However, since this section focuses on inheritance, I’ll stick with that.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Karl Beecher
About this chapter
Cite this chapter
Beecher, K. (2018). Classes and Objects. In: Bad Programming Practices 101. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3411-2_9
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3411-2_9
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3410-5
Online ISBN: 978-1-4842-3411-2
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books