gvwilson / sdxjs

Software Design by Example with JavaScript
Other
49 stars 12 forks source link

Clarify the description/meaning of Figure 9.3 #25

Closed juananpe closed 1 year ago

juananpe commented 1 year ago

I don't quite understand the different arrows and numbers of Figure 9.3 about how the Visitor pattern works. The visitor should walk the nodes of the DOM tree (depth-first search), opening and closing each node once, but it's difficult for me to follow the logic behind the omission of some numbers (2,3,4,7 from 1,5,6,8,9,10) and why some nodes (p, span) have the walk/open/close steps and some others (h1) not (could it be because otherwise it could be a mess of arrows?)

Perhaps it's just me and it's because I need more coffee today, but I'd appreciate if you could double check that this figure is OK :)

image