Hello,
I Have Super-Class and some Sub-Classes. Some of my Sub-Classes will have same Methodes. How can i achiev this.
TSuperClass
TSubClass1 (TSuperClass )
TSubClass2 (TSuperClass )
TSubClass3 (TSuperClass ) \
TSubClass4 (TSuperClass ) |> this three Classes should have a shared Method.
TSubClass5 (TSuperClass ) /
I want to achiev something like this but without inheritance:
SomeClassWithMethodes = class
Procedure DoSomething;
end;
SubClass3.DoSomething(); //--> Should be able to call this method
SubClass1 //--> Should not See/be able to call this Method
There will be more than 1 "SomeClassWithMethodes", which is why inheritance is not working.
So in Short: i have a Class, lets say "DataOfSOmething", which provides a Method "DoSomething". Many Different Classes Exist, but only 3 of them Share the Same Method("DoSomething"). If i later on create an instance from one of those 3 classes i would like to call something like this: MyClass.DoSomething. But i can't use Inheritance.