Cloud
Infrastructure as Code: The Automation Fear Spiral
class Stack extends ArrayList { public void push(Object value) { … } public Object pop() { … } }
This is one of the most common beginner issues — because it’s so convenient! — and the reasons why it’s wrong are not often discussed in programming literature, so I’ll say it again: your application-domain classes should use implementation classes, not be one. Keep these taxonomies/domains separated.Unless you are creating an implementation class, you should not inherit from an implementation class.
Disclaimer: The statements and opinions expressed in this article are those of the author(s) and do not necessarily reflect the positions of Thoughtworks.