20090316-LinkedList-II

20090316-LinkedList-II - Traditional implementations...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Traditional implementations • provide a large number of methods – making it difficult to reuse if less functionality is desired; • provide no means, beyond inheritance, to extend functionality to suit a specific situation; and • adding functionality requires knowledge of internal structure of the list.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
So… • These implementations are inflexible, and do not exhibit good OO design. • In lecture we will discuss a state-based list implementation which can be easily extended with new functionality.
Background image of page 2
Variant/Invariant decomposition • Design principle which leads to cohesive and decoupled components • That which is invariant is put into one component • Variant properties/behaviors are factored out into separate components • Compare this to what we saw with e.g. Observer pattern: – decoupling of event generation (invariant) from event handling (variant)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
a list = a Linear Recursive Structure (LRS or LRStruct) • What is a list? 1. the empty list is a list 2. a pair whose tail is a list is itself a list • This is a recursive definition! (1) is called the base case, and (2) is called the recursive case. • Note that traditional implementations do not follow this precise definition of what a list is: many have no explicit representation of an empty list none are recursive on the list; instead they recurse on a list node • This has implications for how the structure can support extension (see Visitor support, in later slides)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 24

20090316-LinkedList-II - Traditional implementations...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online