Types, Interfaces, and Dependencies

Posts   
 
    
jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 04-Jun-2004 01:53:28   

Hello all, slightly generic, off-topic post here, hope you don't mind:

I'm trying to figure out how to deal with some assembly dependency issues I have. Here's the situation


Assembly A: "CustomReportCore" Contains: -Type: CustomDataObject, Implements IDataObject from Assembly B -Type: DataField, Implements IDataField from [b]Assembly B[b/]

-Type: DataFieldCollection

Assembly B: "CustomReportInterfaces" Contains: -Interface: IDataField

-Interface: IDataObject

Since a CustomDataObject contains a DataFieldCollection (basically a collection of fields) , the interface it implements IDataObject must show a property of type DataFieldCollection. This of course would result in a circular depency.

Is the answer simply to create an interface for DataFieldCollection called IDataFieldCollection? It just seems a little ridiculous to create an interface for a basic, strong-typed collection. I tried to declare the property as type ICollection, but the implementing class must use the exact type specified in the interface (OK, so I know I can use "Shadows", but don't want to)

I know this is probably a common situation, but I'm not sure how to set it up. TIA for any thoughts.

Jeff...

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 04-Jun-2004 04:18:10   

Not really sure what you are trying to do, but it soulds to me like your are trying to create a collection, similar to that of a DataTable.Columns collection.

I created a visualization (static structure diagram) of a typed dataset that might shed some light on a few things. I also wrote a quick sample if you want, I can email it to you.

My email is in my profile.