Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>(This is the same kind of problem that people have with header files in C and C++ programs, too.)</p> <p>It isn't just "calls" which create dependencies; it is <em>any</em> kind of reference, to a member variable, a static variable or even a constant definition. </p> <p>Basically what you need to do is to discover all the fine grain dependencies (this usually requires a compiler-like analysis tool that reads the code and discovers such dependencies, between declared language elements (declarations, fields, methods, classes, packages if you are java-centric, etc.) and other language elements. using the semantics of the language in which the libraries are written. (Such an analyis is probably conservative). This is essence gives you a giant graph, with nodes being language elements, and arcs being "uses".</p> <p>The library packaging problem in the abstract is breaking this graph apart into chunks, minimizing cross-chunk dependency arcs. This may give you huge numbers of small libraries. </p> <p>The practical problem is grouping together some chunks which have no actual dependency on one another, but are commonly used together. For instance, a set of buffer access procedures may not have any explicit dependency on a definition of default buffersize, but you probably want one library containing both, rather than two libraries with one containing just the default buffersize declaration. This notion of used-together is really a problem domain artifact, and isn't visible anywhere in the code except for perhaps some statistical co-occurence of uses.</p> <p>The hard part of this problem is discovering the fine-grain semantic dependencies. You can approximate this by hand, but if there is any scale to the problem, you won't have the appetite to do it. (People don't reorganize header files for the same reason). Pretty much you need language tools to do the analysis, big graph management to propose chunks, statistical analysis to get a hueristic grouping, and probably a UI to allow a domain expert to editing the grouping to produce the revised libraries.</p> <p><em>Then</em> you need a tool to go back to code that uses the legacy libraries, and modify them to use the revised libraries. Both the library refactoring and the code base revision requires massive code analysis and change, which needs automation.</p> <p>Our <a href="http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html" rel="nofollow">DMS Software Reengineering Toolkit</a> with its many <a href="http://www.semanticdesigns.com/Products/FrontEnds" rel="nofollow">language front ends</a> is probably a good foundation for implementing such a library reorganization. We've considered doing this for C and C++ [which is why I have this response], but its a big task even for us to do. We'd love some serious additional motivation!.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. CO[Restructure101](http://structure101.com) has this ability out of the box - to organize a large dependency graph (where dependencies are any reference, as described by Ira) into cohesive clusters. It does a pretty good job based on a heuristic algorithm, and you can then revise the clustering by manual drag/drop, and give the clusters (which will become your new sub-libraries) meaningful names. This can be done recursively (cluster the clusters) if you have very large libraries. You need to make code changes yourself but it spits out a list. A C/C++ flavor based on Doxygen just released.
      singulars
    2. CO@spraff: I thought my answer sketched the algorithm you were looking for. How is it unsatisfactory with respect to your question? (I don't think you are going to get a code-like answer as you would for quicksort).
      singulars
    3. COTHe Restructure 101 answer looks like a great interactive tool for handling the graph and manually/semiautomatically organizing the abstract concepts. But I think the hard part of the solution is extracting the dependencies (you need langauge precise parsers and full analysis), generating the restructured libraries, and finally modifying the code to use those. (Restructure 101 "makes a list" of manual work to do... kinda of like "you should refactor this code"). If your system is big, doing all this work manually is likely to be very difficult and hard to justify to management.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload