Relative Content

Tag Archive for abstract-class

Interface Dependencies or Abstract Classes

I have a decision to make and I am wondering what would be the better solution. I am refactoring an older application and intend to really get into the nuts and bolts of it.

Interface Dependencies or Abstract Classes

I have a decision to make and I am wondering what would be the better solution. I am refactoring an older application and intend to really get into the nuts and bolts of it.

Would it make sense to add parameters of an inferred type to inheritance?

I’ll write this in PHP (where this thought originated), but this is generic to any object-orientated language. Basically, this is an addition to abstract classes that defines the implementation of its subclasses. Obviously, this could never go into interfaces because it defines how classes will be implemented, an immediate contradiction. Here are two examples:

Would it make sense to add parameters of an inferred type to inheritance?

I’ll write this in PHP (where this thought originated), but this is generic to any object-orientated language. Basically, this is an addition to abstract classes that defines the implementation of its subclasses. Obviously, this could never go into interfaces because it defines how classes will be implemented, an immediate contradiction. Here are two examples:

Would it make sense to add parameters of an inferred type to inheritance?

I’ll write this in PHP (where this thought originated), but this is generic to any object-orientated language. Basically, this is an addition to abstract classes that defines the implementation of its subclasses. Obviously, this could never go into interfaces because it defines how classes will be implemented, an immediate contradiction. Here are two examples: