Quick Index
Video


Video accompanying this page...

Problem Statement (New Objects)


The first thing we want to do is get a feel for the problem at hand.

Let's look at the object types and methods the problem requires.

Problem Statement (New Objects)
These are all the object types and methods we need to code. Wow! This looks like a ton of work.
Arrayed      Linked     Arrayed      Linked        Arrayed      Linked      Arrayed      Linked
 Stack       Stack       Queue        Queue         Deque        Deque        Bag         Bag
 Idea        Idea        Idea         Idea          Idea         Idea         Idea        Idea
------------------------------------------------------------------------------------------------------
(behaviors/methods)
size         size         size         size         size         size         size         size
isEmpty      isEmpty      isEmpty      isEmpty      isEmpty      isEmpty      isEmpty      isEmpty
add          add          add          add          add          add          add          add
removeAll    removeAll    removeAll    removeAll    removeAll    removeAll    removeAll    removeAll
toNativeList toNativeList toNativeList toNativeList toNativeList toNativeList toNativeList toNativeList
toString     toString     toString     toString     toString     toString     toString     toString
push         push         enqueue      enqueue      first        first        contains     contains
pop          pop          dequeue      dequeue      last         last         any          any
peek         peek         peek         peek         addFirst     addFirst     add          add
                                      addLast       addLast      remove       remove
                                      removeFirst   removeFirst
                                      removeLast    removeLast



Given Context (Environment)


Now we want to look at what context (tools) are available for us to work with.

In other words, what objects we can potentially reuse, saving us time and testing.

Object Types Available For Reuse
These object types are available to us. We can reuse them.
         Dynamic
          List
           |
  ---------+---------
  |                 |
Dynamic           Linked
 Array             List

Instance Methods Available For Reuse
These methods are available to us. We can reuse them.
DynamicList
Instance Methods
----------------------
(behaviors/methods)
size
isEmpty
get
first
last
addFirst
addLast
add
addAll
set
insert
removeFirst
removeLast
removeAll
removeIndex
remove
subList
find
toNativeList
toString



Next Steps


We've learned the theory of normalizing (simplifying) an object design. And we've normalized a couple designs in examples featuring graphic turtle objects.

We always start with a 1) problem statement and 2) given context (tools). We have both of these listed above which means we're ready to normalize the design.

We will apply the techniques we've learned to this design: