﻿<?xml version="1.0" encoding="utf-8" ?> 
<?xml-stylesheet type="text/xsl" href="../../webpages/courses.xsl" ?>
<!--
/////////////////////////////////////////////////////////////////////////////
//  CSE687dnL1.xml - provides links Lecture #1 materials                   //
//                     on the ECS college server                           //
//                                                                         //
//  Jim Fawcett, CST 2-187, Syracuse University, jfawcett@twcny.rr.com     //
/////////////////////////////////////////////////////////////////////////////
-->

<courses name="Fawcett">

  <btitle>Design Note #1</btitle>
  <theme src="../../webpages/CodeTheme.css" />

  <visible>
  <title>Design Note #1</title>
  <subtitle>Single Responsibility Principle (SRP)</subtitle>
  <revised>31 January 2007</revised>
  
  <hilight>
    <ifile title="Home">../../webpages/FawcettHome.xml</ifile>&#32;
    <ifile title="Courses">../../Courses.xml</ifile>&#32;
    <ifile title="Code">../../Code.xml</ifile>&#32;
    <ifile title="Books">../../Books.xml</ifile>&#32;
    <ilink title="Handouts">www.ecs.syr.edu/faculty/fawcett/handouts</ilink>&#32;
    <ifile title="Research">../../research.xml</ifile>&#32;
    <ifile title="SWDev">../../swdev.xml</ifile>&#32;
    <ifile title="WebDev">../../webdev.xml</ifile>&#32;
    <ifile title="News">../../news.xml</ifile>&#32;
    <ifile title="OtherLinks">../../OtherLinks.xml</ifile>&#32;
    <ifile title="SiteDesign">../../SiteDesign.xml</ifile>
  </hilight>

  <hilight>
    <ifile title="CSE681-SWMA">../../CSE681/CSE681Code.xml</ifile>&#32;
    <ifile title="CSE687-OOD">../../CSE687/CSE687Code.xml</ifile>&#32;
    <ifile title="CSE691-IP">../../CSE691/CSE691Code.xml</ifile>&#32;
    <ifile title="CSE775-DO">../../CSE775/CSE775Code.xml</ifile>&#32;
    <ifile title="CSE776-DP">../../CSE776/CSE776Code.xml</ifile>&#32;
    <ifile title="CSE778-AWP">../../CSE778/CSE778Code.xml</ifile>&#32;
    <ifile title="CSE784-SWS">../../CSE784/CSE784Code.xml</ifile>
  </hilight>
  
  <hilight>
    <ifile title="SG - Design">StudyGuideDesign.xml</ifile>&#32;
  </hilight>
  
  <br/>
  <section title="Single Responsibility Principle (SRP):">
    <block>
    Each class should have only one reason to change.
    <p/>
    Each module should be responsible for only a single activity.
    </block>
  </section>
  
  <section title="Examples:">
    <olist>
      <litem>
        The <ifile title="tokenizer module">../code/parser/tokenizer.h</ifile>, in 
        <ifile title="Parser project folder">../code/parser</ifile> is responsible for 
        extracting tokens from a stream.
      </litem>
      <litem>
        tokenizer contains a single class, Toker, responsible for extracting tokens from a stream.  Since it refers
        to the istream class, it can also work with streams derived from istream, like istringstream.
      </litem>
    </olist>
  </section>
  
  <section title="Elaboration:">
    <lquote source="Robert C. Martin, Agile Software Development, Prentice-Hall">
      If a class has more than one responsibility, then the responsibilities become coupled.  
      Changes to one responsibility may impare or inhibit the ability of the class to meet 
      the others.  This kind of coupling leads to fragile designs that break in unexpected 
      ways when changed.
    </lquote>
  </section>
  
  </visible>
</courses>
