Quantcast
Channel: User Filip Milovanović - Software Engineering Stack Exchange
Viewing all articles
Browse latest Browse all 164

Comment by Filip Milovanović on Does changing the default value of a class member violate the Liskov Substitution Principle?

$
0
0
To help clarify a bit what people mean by "adhering to the contract" - it refers to guarantees the type spec makes, that people using it can rely on. Suppose the type in question is a collection of some sort where you can specify a maximum number of elements that cannot change during the lifetime of an object - and that this is stated explicitly about the type. There may be a default constructor, establishing a default value, there might be a constructor that lets you specify a value, and there may be subclasses that have a different default value, or that calculate it in some way. 1/2

Viewing all articles
Browse latest Browse all 164


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>