﻿<?xml version="1.0" encoding="utf-8" ?> 
<?xml-stylesheet type="text/xsl" href="../../webpages/courses.xsl" ?>
<!--
/////////////////////////////////////////////////////////////////////////////
//  CSE681designNotes.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>Package Structure is Important!</btitle>
  <theme src="../../webpages/CodeTheme.css" />

  <visible>
  <title>CSE681 - Software Modeling and Analysis</title>
  <subtitle>Design Note #2<br/>Package Structure is Important!</subtitle>
  <revised>13 January 2010</revised>
  
  <hilight>
    <ifile title="Home">../../webpages/FawcettHome.xml</ifile>&#32;
    <ifile title="Courses">../../webpages/Courses.xml</ifile>&#32;
    <ifile title="Code">../../webpages/Code.xml</ifile>&#32;
    <ifile title="Books">../../webpages/Books.xml</ifile>&#32;
    <ilink title="Handouts">www.ecs.syr.edu/faculty/fawcett/handouts</ilink>&#32;
    <ifile title="Research">../../webpages/research.xml</ifile>&#32;
    <ifile title="SWDev">../../webpages/swdev.xml</ifile>&#32;
    <ifile title="WebDev">../../webpages/webdev.xml</ifile>&#32;
    <ifile title="News">../../webpages/news.xml</ifile>&#32;
    <ifile title="OtherLinks">../../webpages/OtherLinks.xml</ifile>&#32;
    <ifile title="SiteDesign">../../webpages/SiteDesign.xml</ifile>&#32;
    <ifile title="AllPages">../../webpages/AllPages.xml</ifile>&#32;
    <notice title="Notices">../../webpages/notices.xml</notice>&#32;
  </hilight>

  <hilight>
    <ifile title="CSE681-SWMAA">../../webpages/CSE681.xml</ifile>&#32;
    <ifile title="CSE686-IP">../../webpages/CSE686.xml</ifile>&#32;
    <ifile title="CSE687-OOD">../../webpages/CSE687.xml</ifile>&#32;
    <ifile title="CSE775-DO">../../webpages/CSE775.xml</ifile>&#32;
    <ifile title="CSE776-DP">../../webpages/CSE776.xml</ifile>&#32;
    <ifile title="CSE778-AWP">../../webpages/CSE778.xml</ifile>&#32;
    <ifile title="CSE784-SWS">../../webpages/CSE784.xml</ifile>
  </hilight>
  
  <hilight>
    <ifile title="Lecture #01">../Lectures/CSE681CodeL1.xml</ifile>&#32;
    <ifile title="Lecture #02">../lectures/CSE681CodeL2.xml</ifile>&#32;
    <ifile title="Lecture #03">../Lectures/CSE681CodeL3.xml</ifile>&#32;
    <ifile title="Lecture #04">../Lectures/CSE681CodeL4.xml</ifile>&#32;
    <ifile title="Lecture #05">../Lectures/CSE681CodeL5.xml</ifile>&#32;
    <ifile title="Lecture #06">../Lectures/CSE681CodeL6.xml</ifile>&#32;
    <ifile title="Lecture #07">../Lectures/CSE681CodeL7.xml</ifile>&#32;<br/>
    <ifile title="Lecture #08">../Lectures/CSE681CodeL8.xml</ifile>&#32;
    <ifile title="Lecture #09">../Lectures/CSE681CodeL9.xml</ifile>&#32;
    <ifile title="Lecture #10">../Lectures/CSE681CodeL10.xml</ifile>&#32;
    <ifile title="Lecture #11">../Lectures/CSE681CodeL11.xml</ifile>&#32;
    <ifile title="Lecture #12">../Lectures/CSE681CodeL12.xml</ifile>&#32;
    <ifile title="Lecture #13">../Lectures/CSE681CodeL13.xml</ifile>&#32;
    <ifile title="Lecture #14">../Lectures/CSE681CodeL14.xml</ifile>&#32;<br/>
    <ifile title="Lecture #15">../Lectures/CSE681CodeL15.xml</ifile>&#32;
    <ifile title="Lecture #16">../Lectures/CSE681CodeL16.xml</ifile>&#32;
    <ifile title="Lecture #17">../Lectures/CSE681CodeL17.xml</ifile>&#32;
    <ifile title="Lecture #18">../Lectures/CSE681CodeL18.xml</ifile>&#32;
    <ifile title="Lecture #19">../Lectures/CSE681CodeL19.xml</ifile>&#32;
    <ifile title="Lecture #20">../Lectures/CSE681CodeL20.xml</ifile>&#32;
    <ifile title="Lecture #21">../Lectures/CSE681CodeL21.xml</ifile>&#32;<br/>
    <ifile title="Lecture #22">../Lectures/CSE681CodeL22.xml</ifile>&#32;
    <ifile title="Lecture #23">../Lectures/CSE681CodeL23.xml</ifile>&#32;
    <ifile title="Lecture #24">../Lectures/CSE681CodeL24.xml</ifile>&#32;
    <ifile title="Lecture #25">../Lectures/CSE681CodeL25.xml</ifile>&#32;
    <ifile title="Lecture #26">../Lectures/CSE681CodeL26.xml</ifile>&#32;
    <ifile title="Lecture #27">../Lectures/CSE681CodeL27.xml</ifile>&#32;
    <ifile title="Lecture #28">../Lectures/CSE681CodeL28.xml</ifile>&#32;
  </hilight>
  
  <hilight>
    <html>
      <a href="../../webpages/cse681.xml#Syllabus">Syllabus</a>
    </html>&#32;
    <ifile title="SG - SMA">StudyGuideSMA.xml</ifile>&#32;  
    <ifile title="SG - OCD">StudyGuideOCD.xml</ifile>&#32;
    <ifile title="SG - Notes">StudyGuideNotes.xml</ifile>&#32;
  </hilight>
  
  <section title="Note #2 - Package Structure:">
    <larger>
      A package is a small piece of code focused on a single activity, e.g., it is cohesive.  
      In order to test and extend packages, designers need to understand their operations, 
      and so spend a lot of time reading their text.  To support this study, we will structure our packages so that:
    </larger>
    <ulist>
    <litem>
      C# packages consist of a single source file, an implementation file with an extension .cs.
      The file contains the definition of one or more classes (usually one) with public declarations and implementation of its services.
      Often there are private helper functions that a client need not be concerned with - they simply support the definition of public
      functions by extracting out some complex or repeated logic.
    </litem>
    <litem>
      Each package file has a block of comments at the top we refer to as manual information.  That contains a prologue briefly summarizing package 
      operation, operating environment, and identifying the author.  After the prologue comes manual information details that describe, in a paragraph
      or two, package operations, followed by a description of the package's public interface.
    </litem>
    <litem>
      Manual information is followed by a block of comments called maintenance information.  That contains the package revision history and instructions
      for building the package.
    </litem>
    <litem>
      Manual and Maintenance comments are followed by public declarations of the packages services.  These should be simple and disclose the
      operations of the package without divulging its implementation.
    </litem>
    <litem>
      The implementation with a set of using statements for all of the libraries  on which the package depends.
    </litem>
    <litem>
      That is followed by a class declaration that implementation of each of the package's member functions inline.
      Each function is preceeded by a single line comment
      that describes the function's responsibility, usually in four or five words.
    </litem>
    <litem>
      Finally, we append a main function that serves as a construction test for the package.  This function is bracketed with compilation constant statements that
      allow us to choose whether to compile the test or not.  We compile during construction testing, but disable that when the package is used as a part
      of a larger subsystem.
    </litem>
    </ulist>
    <image src="CSharpPackageStructure.png" size="400" />
    <caption><p/>C# Package Structure<p/></caption>
  </section>
  <section title="Example:">
    The tokenizer package, Toker.cs, from the <ifile title="Parser Demo">../code/parser</ifile> is a good example of a well
    structured package.
  </section>
  <section title="Conclusions for: Package Structure is Important!">
    <block>
      A published package contains:
      <olist>
        <litem>
          A package file with: prologue, manual info, maintenance info, service definitions, and construction test stub with a compilation
          switch.
        </litem>
        <litem>
          Each of the member functions is preceeded by a single comment line that describes its responsibility in a few words.
        </litem>
      </olist>
      All of the reusable modules provided for your use in our website follow this format, as your submitted code must, as well.
      Demonstration code, intended to illustrate some idea, but not intended for reuse will follow a much simpler format.
    </block>
  </section>
  <p/><hr/><p/> 
  </visible>
</courses>
