tmesias
asked on
I want masterclass.subclass.function to work ( need easy way to exposing a subclass?)
this probably has a simple answer
I want to create a class library that has itself some sub classes, which in turn have functions.
I mostly want to do this so that the functionality that is being developed for one county in a state to be contained in a single manageble class.
I want the classes to contain instructions specific to that county, and I expose these as public functions.
Now what I want is to take the classes for each county and put them under a class library for the whole state.
For instance, say I have a class library for colorado, I want to then be able to refrence that colorado class library in another application like this:
ColoradoJobLibrary.CoArapa hoeJobs.do something
so ColoradoJobLibrary is one object, but then CoArpahoeJobs is another object and dosomething is a function in coArapahoeJobs
I suspect that inheritace, interfaces or imports has something to do with this, but can't quite figure out how to expose the subclass through another class without having to write a property or function for each function in the county class in the state class. Is there an easier way?
I want to create a class library that has itself some sub classes, which in turn have functions.
I mostly want to do this so that the functionality that is being developed for one county in a state to be contained in a single manageble class.
I want the classes to contain instructions specific to that county, and I expose these as public functions.
Now what I want is to take the classes for each county and put them under a class library for the whole state.
For instance, say I have a class library for colorado, I want to then be able to refrence that colorado class library in another application like this:
ColoradoJobLibrary.CoArapa
so ColoradoJobLibrary is one object, but then CoArpahoeJobs is another object and dosomething is a function in coArapahoeJobs
I suspect that inheritace, interfaces or imports has something to do with this, but can't quite figure out how to expose the subclass through another class without having to write a property or function for each function in the county class in the state class. Is there an easier way?
ASKER
Thank you for your reply,
We got the right idea of how I want to be able to refer it but I don't want to write this:
Namespace States
Public Class ColoradoJobLibrary
Public Class CoArapahoeJobs
Public Shared Function dosomething() As String
Return "Hey"
End Function
End Class
Public Class CoDenverJobs
Public Shared Function dosomethingelse() As String
Return "Hey from denver"
End Function
End Class
End Class
End Namespace
I want coDenverJobs and coArapahoeJobs to be different cls files (so I can divide the work of creating them).
We got the right idea of how I want to be able to refer it but I don't want to write this:
Namespace States
Public Class ColoradoJobLibrary
Public Class CoArapahoeJobs
Public Shared Function dosomething() As String
Return "Hey"
End Function
End Class
Public Class CoDenverJobs
Public Shared Function dosomethingelse() As String
Return "Hey from denver"
End Function
End Class
End Class
End Namespace
I want coDenverJobs and coArapahoeJobs to be different cls files (so I can divide the work of creating them).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks that's what I was looking for.
Namespace States
Public Class ColoradoJobLibrary
Public Class CoArapahoeJobs
Public Shared Function dosomething() As String
Return "Hey"
End Function
End Class
End Class
End Namespace
you can then use it on a page by:
Imports YourProjectName.States
and then in page_load you can:
Response.Write(States.Colo
of course, you can play with the nesting of classes and/or add more namespaces to 'expose' things the way you want.