Download presentation
Presentation is loading. Please wait.
Published byAudrey Scott Modified over 9 years ago
1
Dependency Finder 1 Tutorial for Dependency Finder by Jean Tessier, March 30, 2004
2
Dependency Finder 2 What are dependencies? AB C1C1 C2C2 P1P1 P2P2 UML: outboundinbound source dependent target dependable Functioning of A requires the presence of B.
3
Dependency Finder 3 Why Should I Care? Improve compilation time –Smaller parts are easier on the compiler Verify encapsulation –Validate design assumptions Indicator of complexity Assist with maintenance –Impact of change
4
Dependency Finder 4 Where Do They Come From? Class-to-Class –Class inheritance via extends keyword –Interface realization via implements keyword –From fields and methods of the class P1P1 C1C1 F1F1 P2P2 C2C2 F2F2
5
Dependency Finder 5 Where Do They Come From? Feature-to-Class –Field type –Method parameter type –Exception types in throws clause –Local variable type P1P1 C1C1 F1F1 P2P2 C2C2 F2F2
6
Dependency Finder 6 Where Do They Come From? Feature-to-Feature –Field access –Method call –Method cannot depend on itself, as in recursive calls P1P1 C1C1 F1F1 P2P2 C2C2 F2F2
7
Dependency Finder 7 No Dependency on Self Does not add information Compile time –Class is unit of compilation Runtime –Class is unit of loading Maintenance –Already editing class or feature P C F
8
Dependency Finder 8 Explicit Dependencies Source code –static final constants –Needed for compilation Compiled code –Fully qualified names –No 3 rd party JARs –Needed for runtime P1P1 C1C1 F1F1 P2P2 C2C2 F2F2
9
Dependency Finder 9 Implicit Dependencies Derived from explicit Minimize –Reduce space –Augment time Maximize –Augment space –Reduce time P1P1 C1C1 F1F1 P2P2 C2C2 F2F2
10
Dependency Finder 10 Implicit Dependencies C1C1 F1F1 P C2C2 F2F2 F1F1 P F2F2 C P C F classes of a package features of a class self
11
Dependency Finder 11 Package Instability (from Robert C. Martin) (from Robert C. Martin) High Ce or low Ca means hard to change If Ca and Ce are 0, then I = 0 Depend on packages with lower I than you CaCa Number of classes outside the package that depend upon classes inside the package. CeCe Number of classes outside the package that classes inside the package depend upon. C a + C e CeCe I =
12
Dependency Finder 12 A vs I Graph (from Robert C. Martin) (from Robert C. Martin) Depend on abstract packages Concrete packages should have no dependents uselessness pain A + I – 1 = 0 01 1 A I
13
Dependency Finder 13 Are Dependencies Transitive? It depends! Case-by-case, not automatic Is part of B that A depends on impacted by changes in C? ABC ???
14
Dependency Finder 14 Transitive Closure callers dependents dependencies
15
Dependency Finder 15 Transitive Closure 010122++
16
Dependency Finder 16 Package-to-Package Example Complete package-level graph Default configuration
17
Dependency Finder 17 Package-to-Package Example Don’t list dependencies on anything with java Excluding /java/
18
Dependency Finder 18 Why Do I See java <-- jeantessier ? P1P1 F1F1 P2P2 F2F2 P1P1 F1F1 P1P1 C1C1 F1F1 P2P2 F2F2 original copy Scope Factory Filter Factory C2C2 C1C1 C2C2 C1C1 P2P2 F2F2 C2C2
19
Dependency Finder 19 Package-to-Package Example Don’t list dependencies on java.* Excluding /^java/
20
Dependency Finder 20 Package-to-Package Example Only list dependencies with com.jean* Including /^com.jean/
21
Dependency Finder 21 Package-to-Package Example Only list with com.jean* and test.* Including /^com.jean/, /^test/
22
Dependency Finder 22 Package-to-Package Example Don’t list packages in java.* Excluding /^java/
23
Dependency Finder 23 Package-to-Package Example Only list test.* and com.jean* Including /com.jean/, /^test/
24
Dependency Finder 24 Feature-to-Feature Example Calls to *Node.Accept() methods Including /Node.Accept/
25
Dependency Finder 25 Feature-to-Feature Example Calls to *Node.Accept() methods, less output Including /Node.Accept\(/
26
Dependency Finder 26 Feature-to-Feature Example Calls to constructors of Node Including /(Node)\.\1\(/
27
Dependency Finder 27 Feature-to-Feature Example Calls to constructors of classes ending in Node Including /(\w*Node)\.\1\(/
28
Dependency Finder 28 Feature-to-Feature Example Calls to methods of NodeFactory Including /NodeFactory/
29
Dependency Finder 29 Transitive Closure Example Shows Accept*() methods
30
Dependency Finder 30 Transitive Closure Example Direct callers of Accept*()
31
Dependency Finder 31 Transitive Closure Example Second degree callers of Accept*()
32
Dependency Finder 32 Transitive Closure Example Everything reachable from Accept*()
33
Dependency Finder 33 Perl Regular Expressions [A-Z] Capitals \w Alphanumeric [A-Za-z0-9_] \W Non-alpha [^A-Za-z0-9_] \w+ At least one alphanumeric \s Space, including tab and eol \s* Zero or more white space \. ‘.’ as opposed to any character
34
Dependency Finder 34 The End depfind.sourceforge.net
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.