B
Brett Romero
Say I have a library (A.dll) with a method that accepts a collection of
a specific type. The type is defined in B.dll. In A.dll, I need to
loop through this collection and reference fields of the type.
For example, a Person type. It may have arm, leg, feet, and hands.
Hands is a collection containing types of fingers. The only way to get
at fingers is by accepting the parameter as its true type. This means
I'll need a file reference to B.dll so I can declare a variable of type
Person to hold the Person parameter coming in.
Is there a way to do this without including B.dll? I want A.dll to be
stand alone. Referencing B.dll means any application that uses A.dll
will need to drag around B.dll as well. Also, if the application is
already referencing B.dll, that means I'm redundant once the reference
to A.dll is made (since it is too referencing B.dll).
Some one may say to use an interface here. Just have all of the B.dlls
implement the interface. Any other library such as the application or
A.dll will reference the interface, which is a conduit to all of the
B+.dll libraries. That doesn't work either because if the application
is referencing the interface already and then includes A.dll, which
also references the interface, I'm still including the interface twice.
Is this good logic or am I mistaken in my thinking on it? Is there a
way to get at the type or specifically, something in the type without
declaring the type in A.dll? Does .NET 2.0 offer anything for this?
Thanks,
Brett
a specific type. The type is defined in B.dll. In A.dll, I need to
loop through this collection and reference fields of the type.
For example, a Person type. It may have arm, leg, feet, and hands.
Hands is a collection containing types of fingers. The only way to get
at fingers is by accepting the parameter as its true type. This means
I'll need a file reference to B.dll so I can declare a variable of type
Person to hold the Person parameter coming in.
Is there a way to do this without including B.dll? I want A.dll to be
stand alone. Referencing B.dll means any application that uses A.dll
will need to drag around B.dll as well. Also, if the application is
already referencing B.dll, that means I'm redundant once the reference
to A.dll is made (since it is too referencing B.dll).
Some one may say to use an interface here. Just have all of the B.dlls
implement the interface. Any other library such as the application or
A.dll will reference the interface, which is a conduit to all of the
B+.dll libraries. That doesn't work either because if the application
is referencing the interface already and then includes A.dll, which
also references the interface, I'm still including the interface twice.
Is this good logic or am I mistaken in my thinking on it? Is there a
way to get at the type or specifically, something in the type without
declaring the type in A.dll? Does .NET 2.0 offer anything for this?
Thanks,
Brett