<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE EctropicDesign SYSTEM "EctropicDesign.dtd">

<EctropicDesign name = "Clock system from Squeak: OODMA by Mark Guzdial">

<!-- Note: Additional information has been added to the "Second goes --> 
<!-- by" scenario and related responsibilities to illustrate the -->
<!-- proposed goal and heirarchical information. -->
 
<!-- Further Note: The second goes by scenario and related -->
<!--  responsibilities have a greater level of detail (goals, methods, -->
<!--  etc.) then the other sections.  This is deliberate; it shows the -->
<!--  the state of system in progress, in which some parts have been -->
<!--  worked out and others haven't -->

 <Class name="Clock">
 
  <Responsibility tag="c1">
  <Text>Accept a pulse from SecondsTicker</Text>
  </Responsibility>
 
  <Responsibility tag="c2" collaborator="Time">
  <Text>Inform Time that a second has gone by.</Text>
  </Responsibility>

  <Responsibility tag="c3">
  <Text>Display the time.</Text>
  </Responsibility>

  <Responsibility tag="c4">
  <Text>Get the time.</Text>
  </Responsibility>

  <Responsibility tag="c5">
  <Text>Translate the time into the appropriate display format</Text>
  </Responsibility>

 </Class>
 
 <Class name="Time">
 
  <Responsibility tag="t1" goal="Know-Time">
  <Text>Increment my representation of time.</Text>
  </Responsibility>

  <Responsibility tag="t2" goal="Know-Current-Seconds"
                  method="INCREMENT-SECONDS">
  <Text>Increment my representation of seconds.</Text>
  </Responsibility>
 
  <Responsibility tag="t3" goal="Know-Current-Minutes-and-Hours"
                  method="INCREMENT-MINUTES">
  <Text>Increment my representation of minutes and hours.</Text>
  </Responsibility>
     
  <Responsibility tag="t4">
  <Text>Return the time as hours, minutes, and seconds.</Text>
  </Responsibility>

 </Class>
 
 <Class name="SecondsTicker">
 
  <Responsibility tag="s1" collaborator="Clock">
  <Text>Pulse the clock.</Text>
  </Responsibility>
 
 </Class>
 
 <Scenario name="Second goes by">
 <Text>A second goes by and the time is updated accordingly.</Text>
  <Episode responsibility="s1"/>
  <Episode responsibility="c1"/>
  <Episode responsibility="t2"/>
  <Episode responsibility="t3"/>
 </Scenario>

 <Scenario name="Clock displays time">
 <Text>The clock displays the current time.</Text>
  <Episode responsibility="c4"/>
  <Episode responsibility="t3"/>
  <Episode responsibility="c5"/>
  <Episode responsibility="c3"/>
 </Scenario>

<Goal name="Know-Time">
 <Text>The system always needs to know what time it is</Text>

 <Goal name="Know-Current-Seconds">
 <Text>When the number of seconds reaches 60, the number of seconds returns
 to 0 and the number of minutes increases by 1.</Text>
 </Goal>

 <Goal name="Know-Current-Minutes-and-Hours">
 <Text>When the number of minutes reaches 60, the number of minutes returns
 to 0 and the number of hours increases by 1.</Text>
 </Goal>
</Goal>

</EctropicDesign>
