G
Guest
Is it possible to return a class (not an instance of a class) from a
function? For example (actually tried this code, it didn't work, but it's
what I want sort of):
Class EventMessage
Public Function MessageHandler() as Type
Return GetType(EventMessageHandler)
End FUnction
End Class
EventMessageHandler is all class level methods (shared or static or whatever
your terminology). I'm trying to decouple knowledge of a message handler from
the application. The Message object itself will know what it's handler is.
my application can receive an xml message (any message that matches our
interface even those not yet defined), turn the message into an object in an
abstract fashion, ask the object for its MessageHandler class, then pass the
message to the Handler. This seems straightforward except I can't figure out
how to return a class (and not an object) from a function.
Any one willing to tackle this one? If you understand architecturally what
i'm trying to do and have a better suggestion I'll listen to those as well.
ken
function? For example (actually tried this code, it didn't work, but it's
what I want sort of):
Class EventMessage
Public Function MessageHandler() as Type
Return GetType(EventMessageHandler)
End FUnction
End Class
EventMessageHandler is all class level methods (shared or static or whatever
your terminology). I'm trying to decouple knowledge of a message handler from
the application. The Message object itself will know what it's handler is.
my application can receive an xml message (any message that matches our
interface even those not yet defined), turn the message into an object in an
abstract fashion, ask the object for its MessageHandler class, then pass the
message to the Handler. This seems straightforward except I can't figure out
how to return a class (and not an object) from a function.
Any one willing to tackle this one? If you understand architecturally what
i'm trying to do and have a better suggestion I'll listen to those as well.
ken
