Click here to Skip to main content
16,007,126 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
QuestionOOAD Books Pin
mpavas20-Apr-09 18:28
mpavas20-Apr-09 18:28 
QuestionProject documentation Pin
yesu prakash19-Apr-09 22:40
yesu prakash19-Apr-09 22:40 
QuestionManaging software complexity Pin
MidwestLimey17-Apr-09 4:33
professionalMidwestLimey17-Apr-09 4:33 
AnswerRe: Managing software complexity Pin
led mike17-Apr-09 4:59
led mike17-Apr-09 4:59 
AnswerRe: Managing software complexity Pin
riced17-Apr-09 6:15
riced17-Apr-09 6:15 
QuestionAvoiding cycles with interfaces [modified] Pin
Quake2Player15-Apr-09 12:06
Quake2Player15-Apr-09 12:06 
AnswerRe: Avoiding cycles with interfaces Pin
Quake2Player16-Apr-09 14:49
Quake2Player16-Apr-09 14:49 
AnswerRe: Avoiding cycles with interfaces Pin
Luc Pattyn16-Apr-09 15:25
sitebuilderLuc Pattyn16-Apr-09 15:25 
I don't see the problem.

A Group holds zero, one or more Contacts.
and each Contact wants to hold a list of all the Groups it belongs to.

So a Group either *is* a list, or *contains* a list.
and a Contact contains a list.

IIRC that is called aggregation: putting information (list of Groups) in members of the class (Contact).


Refinement: I didn't provide type information for the lists; it could be that:
a Group either *is* a list, or *contains* a list of Contacts.
and a Contact contains a list of Groups.

or you could define a common ancestor for Group and Contact, and use that type as the type held in both lists (Inheritance).


Conclusion: I don't need interfaces to "break" the cycle, there wasn't really a cycle if you ask me.

If you insist on having an interface, how about IListable; both Group and Contact implement IListable (not sure what the functionality would be though); and both lists could contain IListables.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


GeneralRe: Avoiding cycles with interfaces Pin
Quake2Player16-Apr-09 16:04
Quake2Player16-Apr-09 16:04 
GeneralRe: Avoiding cycles with interfaces [modified] Pin
Luc Pattyn16-Apr-09 16:13
sitebuilderLuc Pattyn16-Apr-09 16:13 
GeneralRe: Avoiding cycles with interfaces Pin
CodingYoshi27-May-09 3:41
CodingYoshi27-May-09 3:41 
AnswerRe: Avoiding cycles with interfaces Pin
Keld Ølykke9-Jun-09 4:48
Keld Ølykke9-Jun-09 4:48 
QuestionLooking for Suggetions Pin
FISH7868-Apr-09 12:58
FISH7868-Apr-09 12:58 
AnswerRe: Looking for Suggetions Pin
Luc Pattyn8-Apr-09 13:32
sitebuilderLuc Pattyn8-Apr-09 13:32 
GeneralRe: Looking for Suggetions Pin
FISH7868-Apr-09 14:43
FISH7868-Apr-09 14:43 
GeneralRe: Looking for Suggetions Pin
Luc Pattyn8-Apr-09 14:53
sitebuilderLuc Pattyn8-Apr-09 14:53 
GeneralRe: Looking for Suggetions Pin
FISH7868-Apr-09 15:06
FISH7868-Apr-09 15:06 
GeneralRe: Looking for Suggetions Pin
pxmedia10-Apr-09 2:47
pxmedia10-Apr-09 2:47 
QuestionIE6 and IE7 problem Pin
anujbanka17842-Apr-09 20:56
anujbanka17842-Apr-09 20:56 
Questionmaking a new file extension Pin
moonshaddow2-Apr-09 17:27
moonshaddow2-Apr-09 17:27 
AnswerRe: making a new file extension Pin
Roger Wright2-Apr-09 19:23
professionalRoger Wright2-Apr-09 19:23 
GeneralRe: making a new file extension Pin
moonshaddow2-Apr-09 19:46
moonshaddow2-Apr-09 19:46 
GeneralRe: making a new file extension Pin
dybs15-Apr-09 14:41
dybs15-Apr-09 14:41 
GeneralRe: making a new file extension Pin
moonshaddow21-Apr-09 16:04
moonshaddow21-Apr-09 16:04 
GeneralRe: making a new file extension Pin
jmussetter4-May-09 19:09
jmussetter4-May-09 19:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.