Quick Index


Videos


A quick video on this chapter is here....

Overview


The purpose of this ideas doc thing is to be a simple way to capture and coerce ideas that will lead to simpler code.

As usual, we'll run through an example to demo the concepts. In addition
to the example on this page see the detailed examples in here....

We want to capture available components (for potential reuse), object diagrams, class diagrams and method listings/comparisons.

Ideas Doc File Type


The preferred document type is a spreadsheet (.ods) -- capabillity plus simplicity.

TXT (.txt) docs are also simple but tend to be tedious for the needed content.

Example ⭐



Our challenge here is to code a "Drawing" object that will draw graphic elements.

We have one object (to code) for this example challenge -- "Drawing".

This is a high level look at our work TO-DO list.
We now browse through our toolbox of available code looking for components that may help us solve the challenge.
We simply list methods for the components we need to code (our TO-DO list).

The list shows us we have one class and about ten methods to code.
Drawing

From our available toolbox components, we select "Frame" and "Drawable" as viable candidates for reuse.
Frame
Methods
Drawable
Methods
centerdraw
left
top
right
bottom
expand
shrink

Duplication alert! We do not want to reinvent the duplicate methods.

We should try to use the available component "Frame".
Drawable
Methods
(Proposed)
Frame
Methods
(Available)
drawAll
changeColor
invertColor
centercenter
leftleft
toptop
rightright
bottombottom
expandDrawingexpand
shrinkDrawingshrink

We do yes have any ideas for reuse by composition. In the previous step, we decided that we should try to reuse a component of type "Frame".

Frame is reasonable child (ivar) of "Drawing", so we show that here in an odiagram.
Drawing
    ----- frame ------------- Frame

We now jot down a class diagram.

We do not have any ideas for reuse by inheritance, so we note that.
========== Class Diagrams ==========

No ideas yet

Just for demo purposes if we did have inheritance in the game, we would show that something like is shown here.

A superclass (Drawing in this case) with whatever subclasses we come up with.
========== Class (Type) Diagrams ==========

Drawing
   \--------------- LineArtDrawing
   \--------------- FractalDrawing

Here is our method listing.

Almost all our methods are delegated.

At this point, we can iterate on the document, or begin coding.

To begin coding, we would start with object structure using the object and class diagrams.

Drawable
Methods
Method
Type
drawAll
changeColor
invertColor
centerdelegated
leftdelegated
topdelegated
rightdelegated
bottomdelegated
expandDrawingdelegated
shrinkDrawingdelegated


Ideas Doc


Here is the ideas doc file for download....

References


Object Diagrams


Object Type/Class Diagrams