Circular references between children objects

Circular references between children objects

Old forum URL: forums.lhotka.net/forums/t/8117.aspx


dberkov posted on Wednesday, December 09, 2009

Hi,
I have some design question.
Let decide that I have root object that calling "Project". Every project has list of Policies that belong only to him and list of TraceTypes that belong to this project.
Every TraceType in addition to his own properties has on additional property that references to some Policy from project.
Class diagram will be like:

Policy { Id: int,Name: string , Data: string}
TraceType { Id: int, Name : int, DefaultPolicy : Policy}
Project { Id: int, Name: string, Polices : list of Policy, TraceTypes : list of TraceType}

I have an use case where user should be able to open the project for edit and to do the following operations:
1) add/remove/update policy
2) change policy assignment to TraceType.
The use-case can not be split to 2 use-cases like add/delete/update Policy and change policy assignment to TraceType.

How I can define the Policy object that can be attached to several parents (policies list and one of more trace types)?

Thanks,
Dima

Copyright (c) Marimer LLC