Hi,
We're using a class that inherits System.Object in order to assign it to the Tag property of a .NET control. We'd like to use that class also on our appserver which runs Linux.
Is there another way then define two classes one with and the other without inherits System.Object and put all the code in an include?
Richard
Create one class (say: ClassA) which contains all the logic. Let the class (ClassNet) which must inherit System.Object have a private variable to hold a reference to ClassA. Instantiate ClassA in the constructor of ClassNet. Create stub method in ClassA which are wired to the same method in (the instance of) ClassA. Don't use includes, it *will* bite you somewhere later on!
Hi,
We're using a class that inherits System.Object in order to assign it to the Tag property of a .NET control. We'd like to use that class also on our appserver which runs Linux.
Is there another way then define two classes one with and the other without inherits System.Object and put all the code in an include?
Richard
Flag this post as spam/abuse.
Create one class (say: ClassA) which contains all the logic. Let the class (ClassNet) which must inherit System.Object have a private variable to hold a reference to ClassA. Instantiate ClassA in the constructor of ClassNet. Create stub method in ClassA which are wired to the same method in (the instance of) ClassA. Don't use includes, it *will* bite you somewhere later on!
Hi,
We're using a class that inherits System.Object in order to assign it to the Tag property of a .NET control. We'd like to use that class also on our appserver which runs Linux.
Is there another way then define two classes one with and the other without inherits System.Object and put all the code in an include?
Richard
Flag this post as spam/abuse.
Flag this post as spam/abuse.
nice quote in this case: "try to solve it with decoration, not inheritance".
Hi,
We're using a class that inherits System.Object in order to assign it to the Tag property of a .NET control. We'd like to use that class also on our appserver which runs Linux.
Is there another way then define two classes one with and the other without inherits System.Object and put all the code in an include?
Richard
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Hi,
We're using a class that inherits System.Object in order to assign it to the Tag property of a .NET control. We'd like to use that class also on our appserver which runs Linux.
Is there another way then define two classes one with and the other without inherits System.Object and put all the code in an include?
Richard
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Hi,
We're using a class that inherits System.Object in order to assign it to the Tag property of a .NET control. We'd like to use that class also on our appserver which runs Linux.
Is there another way then define two classes one with and the other without inherits System.Object and put all the code in an include?
Richard
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Hi,
We're using a class that inherits System.Object in order to assign it to the Tag property of a .NET control. We'd like to use that class also on our appserver which runs Linux.
Is there another way then define two classes one with and the other without inherits System.Object and put all the code in an include?
Richard
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
Simon,
.NET interface with no members, like System.Web.SessionState.IRequiresSessionState?
I don't understand your suggestion, could you provide an example?
We're not interested in serialization but I would like to compile my app on windows and run it on both platforms with the same .pl without any config changes.
Richard
@Mike, Bronco and Peter I'm to lazy to either change our compile routine or duplicatie a bunch of properties and methods in a wrapper or change our deployment for changes between windows and Linux.
It seems OO was not meant for dynamic inhertance.
I solved my problem by introducing an empty class that inherits sytem.object with just a property that holds the handle to 'my' class.
Thanks!
It seems OO was not meant for dynamic inhertance.
There are those who would say there is a reason for that. :)
The whole idea of ancestors who may or not be there is rather not the way that one thinks about classes in OO. While I understand your dilemma, there are those who would say that it must mean that you had partitioned the problem space incorrectly or the issue would not arise.
Just saying ...
[quote user="Richard.Kelters"]
It seems OO was not meant for dynamic inhertance.
[/quote]
javascript prototype can do that, classical inheritance not... be it for a good reason or not :)