Say, for example, I have many web applications using the same class library compiled into a dll in C# and I want to update a specific method of a class for a particular application. I don’t want to change the existing code because it will affect everyone, and I don’t want to inherit from a class to create a new one. I just want to change an existing method of a class for an individual application.
One way to achieve this would be to have the compiled classes as ‘base’ classes and have a separate file containing all the override classes inheriting the base classes. Then the applications will use the inherited classes. Then to change a class for an individual application you could just update the inherited classes. The only problem I see with this method is that every application would need 2 files, one of base classes and one of inherited (probably not compiled).
Can anyone recommend a better way of doing this?
Polymorphism seems to be the best solution for this. This way base classes can be compiled and left alone and inherited classes can be changed for individual applications without changing the way the original is used (unless necessary).
BaseClasses.cs
Classes.cs
Application