Relative Content

Tag Archive for constructors

Matching the superclass’s constructor’s parameter list, is treating a null default value as a non-null value within a constructor a violation of LSP? [duplicate]

This question already has answers here: Liskov substitution and abstract classes / strategy pattern (2 answers) Closed 9 years ago. I kind of ran into this when messing around with FlashPunk, and I’m going to use it as an example. Essentially the main sprite class is pretty much class Entity. Entity’s constructor has four parameters, […]

Matching the superclass’s constructor’s parameter list, is treating a null default value as a non-null value within a constructor a violation of LSP? [duplicate]

This question already has answers here: Liskov substitution and abstract classes / strategy pattern (2 answers) Closed 9 years ago. I kind of ran into this when messing around with FlashPunk, and I’m going to use it as an example. Essentially the main sprite class is pretty much class Entity. Entity’s constructor has four parameters, […]

Matching the superclass’s constructor’s parameter list, is treating a null default value as a non-null value within a constructor a violation of LSP? [duplicate]

This question already has answers here: Liskov substitution and abstract classes / strategy pattern (2 answers) Closed 9 years ago. I kind of ran into this when messing around with FlashPunk, and I’m going to use it as an example. Essentially the main sprite class is pretty much class Entity. Entity’s constructor has four parameters, […]

Wrapping constructor arguments

Given a base class with around 25 or so subclasses, I have found that adding an argument to the base constructor is painful.

Wrapping constructor arguments

Given a base class with around 25 or so subclasses, I have found that adding an argument to the base constructor is painful.