25
An Ectropic Example: The alarm clock, in ECoDE, ad nauseam • Order of Operations: – I. Object Oriented Analysis (OOA). – II. Object Oriented Design (OOD). – III. Object Oriented Programming (OOP). • This is a User Interface Walkthrough of the ECoDE (pronounced “echcoed”) design tool using the alarm clock example.

An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

Embed Size (px)

Citation preview

Page 1: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

An Ectropic Example: The alarm clock, in ECoDE, ad nauseam

• Order of Operations:– I. Object Oriented Analysis (OOA).– II. Object Oriented Design (OOD).– III. Object Oriented Programming (OOP).

• This is a User Interface Walkthrough of the ECoDE (pronounced “echcoed”) design tool using the alarm clock example.

Page 2: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

Starting ECoDE

From the workspace, type “EctropicDesign start.”

-Select new design.

Page 3: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

The Main Window

Note:

-You start in Analysis mode.

- In this mode, you can create new Scenarios and CRC Cards.

New CRC Cards

New Scenarios

Page 4: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

Object Oriented Analysisi.e. (Analysis Mode)

– 1. Create scenarios for use that satisfy specific goals.

– 2. Brainstorm objects in the domain.– 3. Apply responsibilities to objects (or several

objects via collaborators) that implement scenarios.

Page 5: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #1 – Create Scenarios

How will the alarm clock operate?1. Set the current time

• User sets the time in the display• The internal time changes

2. Update time• Time advances one second• The internal time changes• The display updates

3. Change modes - Display the time in military or standard time• User switches the display mode• The internal representation of time changes• The display updates

Page 6: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #1 – Create Scenarios

How will the alarm clock operate? (cont.)4. Create/Edit alarms with individual actions

• Set the alarm time and action

• Save the alarm

5. Execute alarms at the appropriate time• When a second advances, check all alarms against the current

time

• Execute all alarms that apply

6. Remove alarms• User selects the appropriate alarm and removes it

Page 7: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #1 – Create Scenarios

1. Create a new Scenario

- Note: The naming convention does not allow punctuation in most elements of ECoDE

New Scenari

o

Page 8: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #1 – Create Scenarios

2. Open the Scenario, add responsibilities

- Note: When you add design notes, you must save that screen with “alt-s” or you will lose your notes.

CRC Cards to be named later

Design notes not saved yet

Page 9: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #1 – Create Scenarios

3. Finish all your Scenarios

- Note: You can also yellow button (“right-click” in Windows) on items for more detailed menus.

“Right-Click-Able”

Page 10: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #2 – CRC Cards (Brainstorm Objects)

Objects (post-filtering) for the alarm clock:

– Clock

– AlarmClock

– Alarm

– SecondsTicker

– Time

Page 11: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #2 – Create CRC Cards

1. Create a new CRC Card

New CRC Card

Page 12: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #2 – Create CRC Cards

2. Open the CRC Card, add responsibilities

-Note: These responsibilities should map to the scenario responsibilities they satisfy. In fact, you can select the responsibilities we created earlier in the scenarios.

Page 13: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #2 – Create CRC Cards3. Finish creating CRC Cards and begin assigning Responsibilities

-Note: “Time” became “InternalTime” and “Alarm” became “AlarmSetting” because ECoDE does not let you create classes that already exist in Squeak. You could create the CRC Cards, but you cannot generate them.

Page 14: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #3 – Assign Responsibilities

1. Assign collaborators and new responsibilities to accomplish our tasks

-Note: Because we add “Execute all alarms that match current time” to AlarmClock, AlarmSetting now needs “Execute alarm action”

Page 15: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA #3 – Assign Responsibilities

2. Break responsibilities into atomic units

-Note: “The internal time changes” has been divided into “Set time” and “Set mode”. This change was made in the scenarios as well.

Page 16: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOA # 3 – Assign Responsibilities

3. Ensure that all responsibilities in the Scenarios have been assigned to a CRC Card.

-Note: We have adjusted responsibility names to reflect the reduction into atomic units.

Page 17: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

Object Oriented Designi.e. (Design Mode)

– 1. Assign method names to responsibilities. – 2. Use ECoDE notes to build a UML class

diagram. – 3. Check design integrity and make any

necessary changes.

Page 18: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOD # 1 – Assign Method Names

1. Switch to Design Mode

-Note: The color changes.

Design Mode Button

Page 19: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOD # 1 – Assign Method Names

2. Open CRC Cards and assign all your responsibilities a method name.

-Note: You will be prompted for a method category (within the class) and a description (general comments).

Page 20: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOD # 2 – Build UML Class Diagram

Use your design to build a UML Class Diagram.

-Note: This is a very limited design with glaring flaws. How would you design the Alarm Clock?

Page 21: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOD # 3 – Integrity Check

(Re)-Check the integrity of your design.

-Note: The most basic checks will be made when you switch to Program Mode, but do not rely on ECoDE to find flaws in your design.

Program Mode Button

Page 22: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

Object Oriented Programmingi.e. (Program Mode)

– 1. Generate Classes and Method Stubs. – 2. Ensure that you have met your design goals.

Page 23: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOP # 1 – Generate Classes

1. Switch to Program Mode

-Note: (At the top) In the left hand frame are CRC Cards and in the right hand frame are classes that ECoDE has generated for this design.

CRC Cards

Generated Classes

Page 24: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOP # 1 – Generate Classes

2. Select the CRC Cards and click the “Code” button.

-Note: You will be prompted for parent class and instance variables.

-Note: I generated “Clock” before “AlarmClock” so I could specify “Clock” as the parent class of “AlarmClock”.

“Code” this CRC Card

Page 25: An Ectropic Example: The alarm clock, in ECoDE, ad nauseam Order of Operations: –I. Object Oriented Analysis (OOA). –II. Object Oriented Design (OOD)

OOP # 2 – Ensure Design Goals

At this point, you can open classes, browse classes, and open scenarios within program mode. This is how you can make sure the scenario requirements are met and the classes implement them how you want them too.

GOOD LUCK!!

Browse

ClassOpenClass