I want to create a class library that contains an interface from which objects can arise, say ISaveableObject.
Now this interface should implement the following functions:
- Objects that display this interface must have a method
ToSaveableObject(similar to a method System.Object.ToString()). - And it should contain a specific constructor that takes an array of objects as a parameter.
The connection between the two should be that the method ToSaveableObjectreturns a string that takes all the properties necessary for object[], and converts them to a readable string and returns it.
Am I going in the right direction, wanting to use an interface, or is an abstract class more suitable for this case?
Unfortunately, interfaces cannot be implemented by designers, is there any other way to achieve my goal?
source
share