Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
Generics & Inheritence
Tyler Copple
Jan 25 2008 1:00 PM
6.4k
I'm designing an object model which needs a few constraints and I'm not sure how exactly to do what I want in C#, any help is appreciated.
Basically
Class A {...}
Class B : A {...}
Class C : B {...}
Class AGroup : Collection<A> {...}
Class BGroup : AGroup {...}
Class CGroup : BGroup {...}
The feature I need is to make sure that BGroup's collection only has B objects in it, but retains all the methods and members from AGroup.
While CGroups's collection only has C objects in it but has both A and B methods and members accessible.
Strong typing which gets stronger each level of inheritance.
Is this possible?
Thanks in advance,
Tyler Copple
Reply
Upload Source Code
Select only zip and rar file.
Post
Reset
Answers (
4
)
can i get a tiny time interval like 0.01 ms?
Getting Started