PDA

Click to See Complete Forum and Search --> : Dependencies by *class* in a DLL?


tendim
Aug 10th, 2009, 02:11 PM
G'day all.

I've been perusing the forums for a few days now and searching all over, but haven't found an answer so far..

I've got a host of applications (about 10) which all use a common library that I developed some time ago. The library has upwards of 100 classes in it, but I no longer have a definitive list of which classes are currently being used. All of the search results I've found so far only point to being able to tell me which files are required dependency-wise, but not which classes in those files.

I.e., if my library has 5 classes:


MyLibrary.dll:

Public Class SomeClass1
Public Class SomeClass2
Public Class SomeClass3
Public Class SomeClass4
Public Class SomeClass5

But my program only uses "SomeClass1" and "SomeClass4", I'm trying to find out how to list that -- right now all dependency programs I've found will simply tell me that "MyLibrary" is a dependency, but not "SomeClass1" and "SomeClass4" in "MyLibrary". This way, I can see all of the classes that are used in all 10 of my applications that depend on MyLibrary.dll, and remove anything that isn't used anymore.

Does anyone know of a tool that will do this?

LaVolpe
Aug 16th, 2009, 10:39 AM
If you have your source code for those 10 apps, you can simply look through the source code. If you are setting any variables to the dll's classes, then you are most likely using them.

If you created a DLL with x number of public classes and then decide to add or remove any, the general rule of thumb is to leave the old classes in, add new classes if needed. Or if old classes need to have functions added, removed, or additional parameters assigned to existing functions, then create a new class with those functions.

You can see this quite often in other DLLs where you will have: SomeClass and SomeClass2 for example. The SomeClass is the older one and still works, but SomeClass2 is a new version of the class with more capabilities/functions. This way the compiled app can still use the new DLL because it contains the older class/functions too.