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

presentation player overlay
About This Presentation
Transcript and Presenter's Notes

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


1
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.

2
Starting ECoDE
  • From the workspace, type EctropicDesign start.
  • Select new design.

3
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
4
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.

5
OOA 1 Create Scenarios
  • How will the alarm clock operate?
  • Set the current time
  • User sets the time in the display
  • The internal time changes
  • Update time
  • Time advances one second
  • The internal time changes
  • The display updates
  • Change modes - Display the time in military or
    standard time
  • User switches the display mode
  • The internal representation of time changes
  • The display updates

6
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
  • Remove alarms
  • User selects the appropriate alarm and removes it

7
OOA 1 Create Scenarios
1. Create a new Scenario - Note The naming
convention does not allow punctuation in most
elements of ECoDE
New Scenario
8
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
9
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
10
OOA 2 CRC Cards (Brainstorm Objects)
  • Objects (post-filtering) for the alarm clock
  • Clock
  • AlarmClock
  • Alarm
  • SecondsTicker
  • Time

11
OOA 2 Create CRC Cards
1. Create a new CRC Card
New CRC Card
12
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.
13
OOA 2 Create CRC Cards
3. 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.
14
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
15
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.
16
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.
17
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.

18
OOD 1 Assign Method Names
1. Switch to Design Mode -Note The color
changes.
Design Mode Button
19
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).
20
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?
21
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
22
Object Oriented Programmingi.e. (Program Mode)
  • 1. Generate Classes and Method Stubs.
  • 2. Ensure that you have met your design goals.

23
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.
Generated Classes
CRC Cards
24
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
25
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 Class
Open Class
Write a Comment
User Comments (0)
About PowerShow.com