Class Graph - PowerPoint PPT Presentation

About This Presentation
Title:

Class Graph

Description:

D is in two traversals. Remember the copies in a traversal graph? Show them with colors. ... Each module should only talk to its friends that share the same concerns. ... – PowerPoint PPT presentation

Number of Views:10
Avg rating:3.0/5.0
Slides: 14
Provided by: Karl157
Category:
Tags: class | graph | pattern

less

Transcript and Presenter's Notes

Title: Class Graph


1
Class Graph
2
Project Output
from A via X to F sourceA -gt X X -gttargetF
A
B
C
U
0..1
Problem Information loss A B D E F not allowed!
D
R
S
X
E
F
3
Better Project Output
Remember the copies in a traversal graph? Show
them with colors.
from A via X to F sourceA -gt X X -gttargetF
A
U
B
C
0..1
Problem Information loss A B D E F not
allowed! But now we know that D is in two
traversals
D
R
S
X
E
Dashed multiple
F
4
Better Project Output
from A via R to F sourceA -gt R R -gttargetF
A
U
B
C
0..1
No information loss
D
R
S
X
E
F
5
Project Output
A
from A to F
B
C
U
Selects all Nodes and edges
0..1
D
R
S
X
E
F
6
Project Output
7
object graph a1111
class graph
new A( new B( new D( new E( new
F(7)), new X( new F(9), new D(
new E( new F(27)), new X(
new F(35),null))))), new C( new R( new
X( new F(15), null), new F(20))))
8
ObjectGraph a
class graph
9
object graph
4 way pattern matching
class graph
a1111 new A( new B( new D( new E(
new F(7)), new X( new F(9), new
D( new E( new F(27)), new X(
new F(35),null))))), new C( new R(
new X( new F(15), null), new F(20))))
Visitor A,B,C,D,E,F,X
( before ) after
from A via X to F sourceA -gt X X -gttargetF
after X
after A
after C
10
cg.gather(a,from A via X to F) Returns list of
size 1!!!
Object graph
3 way pattern matching
aA
B
C
D
S
X
from A via X to F
E
f2F
f1F
11
A
cg.gather(a,from A to F) Returns list of size 2
Class graph
B
C
U
Object graph
3 way pattern matching
aA
0..1
D
R
S
X
B
C
E
F
D
S
X
But S is not a target
E
f2F
f1F
12
cg.gather(a,from A to S) Returns list of size 1
A
from A to S
3 way pattern matching
aA
B
C
U
0..1
B
C
D
R
S
X
D
E
S
X
F
E
f2F
f1F
13
Law of Demeter for Concerns
  • Each module should only talk to its friends that
    share the same concerns.
  • Some concerns are inherently linked that it is
    not worthwhile separating them.
  • Each module deals with a small number of concerns.
Write a Comment
User Comments (0)
About PowerShow.com