TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tyler Copple
NA
3
0
Generics & Inheritence
Jan 25 2008 1:00 PM
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
Answers (
4
)
can i get a tiny time interval like 0.01 ms?
Getting Started