PC Review


Reply
Thread Tools Rate Thread

adding References of References

 
 
Relaxin
Guest
Posts: n/a
 
      22nd Feb 2008
First an example:

"ClassA" is defined in A.dll
public class ClassA
{...}

"ClassB" is derived from "ClassA" and has a reference to A.dll, and all of
this is defined in B.dll
public class ClassB: ClassA
{...}

"ClassC" is derived from "ClassC" and has a reference to B.dll, and all of
this is defined in C.dll
public class ClassC: ClassB
{...}
ERROR!! --- I need to also include a reference to A.dll !!!

Now when I create "ClassC" and it is derived from "ClassB", why do I also
need to include a reference to "ClassA"?

I'm I doing something wrong...shouldn't B.dll have everything that "it"
needs in order to run?
Why does every app/dll need to include ALL references that the other dlls
(assemblies) are using??

In a very large system with about 40 developers it makes it impossible to
efficiently reuse other classes that are defined in other assemblies.

Can someone please give me some helpful directions?

Thanks




 
Reply With Quote
 
 
 
 
Marc Gravell
Guest
Posts: n/a
 
      22nd Feb 2008
Adding a reference never directly imports the IL; so just because B has a
class that inherits from A in A.dll, it doesn't have the actual
implementation. Indeed, post-implementation you can update A.dll and your
app will pick up the changes without needing a rebuild (versioning
permitting).

So: to instantiate a "B", it needs the base-class implementation (for the
fields etc), so it needs A.dll; and to instantiate a C it needs A.dll and
B.dll.

Re your 40-devs issue I'm nto sure that this directly is the problem; it
sounds like you've got a hugely fragmented assembly base, which is going to
be a nightmare any way you manage it. I'd stick with a small number of
utility libraries, and a few project-specific assemblies... I wouldn't worry
about not using "all" of an assembly... the JIT means that anything surplus
that you never use in your app is largely just fluff and ignored...

Marc


 
Reply With Quote
 
Relaxin
Guest
Posts: n/a
 
      22nd Feb 2008

"Marc Gravell" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Adding a reference never directly imports the IL; so just because B has a
> class that inherits from A in A.dll, it doesn't have the actual
> implementation. Indeed, post-implementation you can update A.dll and your
> app will pick up the changes without needing a rebuild (versioning
> permitting).
>

I wouldn't expect it to import it, but at least know where to get it i.e.
assembly.namespace.class...

I just expected it to work like a regular C++ dll, where each DLL is
self-suffient.

> So: to instantiate a "B", it needs the base-class implementation (for the
> fields etc), so it needs A.dll; and to instantiate a C it needs A.dll and
> B.dll.

I understand that, but I would have expected .NET with all of it's discovery
and reflection technics
would have provided a much better solution to this.

> Re your 40-devs issue I'm nto sure that this directly is the problem; it
> sounds like you've got a hugely fragmented assembly base, which is going
> to be a nightmare any way you manage it.


I'm not sure if you have ever developed a very large system with this many
developers,
but just the nature of it being large with well over 200 different modules
(modules meaning types of applications),
and most of those modules do cross boundries and share classes.
So to have to pull in all of the assemeblies that each module uses for each
module needed is absolutely insane!!

So I don't think it's an issue of over-fragmentation, because the system
works fine as a C++ product and is NOT a nightmare,
I think the issues is short-sightedness on the .NET teams implementaion of a
system that clearly has the capability to
make this part of the system MUCH better.


>I'd stick with a small number of utility libraries...

That would just create more assemblies that would need to be referenced!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How remove invalid references in Tools>References drop down box? EagleOne@discussions.microsoft.com Microsoft Excel Programming 1 7th Jul 2009 09:52 AM
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Microsoft Excel Worksheet Functions 3 13th Dec 2007 11:43 PM
references adding themselves based on references from other projects referenced Brian Henry Microsoft VB .NET 1 22nd Jul 2005 06:35 PM
Question about References in Code Is it possible to conditional compiling on references? Roger Microsoft Access 1 21st Jan 2005 06:32 PM
References - Losing references to basic functions such as left() Chris Strug Microsoft Access Form Coding 0 6th Aug 2003 04:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:16 AM.