﻿<?xml version="1.0" encoding="utf-8" ?> 
<?xml-stylesheet type="text/xsl" href="../../webpages/courses.xsl" ?>
<!--
/////////////////////////////////////////////////////////////////////////////
//  CSE687codeL1.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>CSE687 Lecture #1</btitle>
  <theme src="../../webpages/CodeTheme.css" />

  <visible>
  <title>CSE687 - Lecture #1 Design Note</title>
  <title>Single Responsibility Principle (SRP)</title>
  <revised>8 January 2003</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="Lecture #1">../Lecture1/CSE687CodeL1.xml</ifile>&#32;
    <ifile title="Lecture #2">../Lecture2/CSE687CodeL2.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="tok module">../code/semi/tok.h</ifile>, in 
        <ifile title="semi project folder">../code/semi</ifile> is responsible for 
        extracting tokens from a stream.
      </litem>
      <litem>
        tok contains three classes:
        <ulist>
          <litem>
            codeDelimiter is responsible for defining delimiters when parsing C or C++ code.
          </litem>
          <litem>
            xmlDelimiter is responsible for defining delimiters when parsing xml.
          </litem>
          <litem>
            toker is responsible for extracting tokens.
          </litem>
        </ulist>
      </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>
