Subclass vs Wrapper - Constructor With An Additional Parameter
问题 Which is generally considered the more preferred method when trying to add a constructor with an additional parameter? A subclass or a wrapper? That being, creating a subclass of the class and then just using that subclass' constructor? Or adding a wrapper method which will take the extra parameter and return an object with that parameter set? Thank you for your time! EDIT: I don't have access to the superclass's code. 回答1: The answer is language dependent. In C#/.NET, you would typically use