CIII - Draft (last updated 11/20/02)

Syllabus - last updated 11/17/02

Programming Survey Course Syllabus

Section 1 - Text File Processing

1 week - Review of Python
  - Objective: Students recall what the whole world of programming is,
    and how to write and run a program.
  - 2 chapters of HTTLACS per day.
  - exercises : to be defined

1 week - Files and exceptions
  - Objective: Students understand and have experience reading from
    and writing to files, and handling exceptions.
  - single chapter of HTTLACS
  - exercises - search, print out cribs in a file, or something similarly
    self-contained.

2 weeks - File reformatting/processing
  - Objective: Students understand Regular Expressions, including how
    they work, what they are good for, and when to use them. Students
    also are able to read a comma-separated-value file into one or
    more Python data structures, and then to extract and to print
    information from that data structure. They understand why this is
    a common task.
  - exercises which first have the student perform some searching
    manually (using 'if' statements, for example), and then they do the
    same thing using regular expressions.
  - Read in comma-delimited file from DB or Excel spreadsheet, build
    Python dictionaries and lists, do magic, print a report. Examples
    could be to sort through test scores and find averages by school,
    or print out all students over 15 years old, or print out a
    histogram on zip codes, etc.

Section 2 - Databases

1 week - Database Introduction
  - Objective: Students understand:
    - what a database is
    - what the 'DBM' model is
      - a primitive database
      - a very easy-to-use database
    - what a database is used for
      - persistence
      - speed
      - scalability (huge data sets)
    - how it works (basically)
      - database organizes data to do searching more quickly
    - what the following terms mean:
      - table
      - index
      - row or record
      - record set
      - transaction
      - flat file
    - what SQL is, and how to use it to create and inspect a database,
      using the main four commands interactively:
      - INSERT
      - DELETE
      - UPDATE
      - SELECT
  - exercise is to build temporary MySQL databases with different
    schemas, to populate them with some simple data (by hand), and
    then to get the information back out

1 week - Using a Database
  - Objective: Students know how to program embedding SQL into Python
    code, and how to build a database from comma-separated-value
    file.
  - exercise is to do all of the same work done in the first section
    on csv file, but use built-in functionality of database instead of
    writing all logic from scratch.
  - additional exercise is to extract subset of data in a large
    database into a much smaller one, which somehow provides extra
    functionality.

1 week - Designing a Database
  - Objective: Students are able to define a database schema such that
    it can easily be used to solve a real-world problem, and to write
    code which performs real-world operations on it.
  - exercise is to have the class do a single project such as:
    - library inventory
    - gradebook
    but to allow them to define the schema for it, and to write a
    handful of key functions for it to perform. Once the schema is
    defined, the data is supplied to them, as well as a simple
    front-end (e.g., a menu-based application to allow updates to the
    database), so that they can focus on the functionality.

Section 3 - Objects

1 week - Introduction to Objects
  - Objective: Students understand all object terms (class, object,
    instance, instantiation, constructor, method), and understand the
    value of grouping data together into objects, as well as the
    revolutionary approach of grouping functions which work on that
    data into it as well. They understand the difference between an
    object and a dicitonary, list, or tuple. They have a good grasp of
    object identity versus value comparison, and know how to overload
    the comparison and other operators. They also understand why
    'self' is the first argument to all methods, and how to call a
    method through the class, instead of the instance.
  - resources - HTTLACS-12, HTTLACS-13, HTTLACS-14, OOPWP-1
  - exercises - all in HTTLACS, others?
   
1 week - Combining Objects Using Composition and Inheritance
  - Objective: Students understand how to implement objects with a
    "has-a" relationship and with an "is-a" relationship, and how to
    tell the difference.  They have experience shifting functionality
    around a class hierarchy, and have a good sense of how to tell
    what should go in the base class and what should go in the derived
    class.  They have a walked through a reasonably elaborate OO
    design, and see how implementing individual objects ultimately
    results in an easy-to-use set of objects with a very simple main
    loop.
  - resources - HTTLACS-15, OOPWP-2,HTTLACS-16
  - exercises - all in HTTLACS. Program their own "go fish" program.
 
1 week - Applying OO Concepts to A New Design
  - Objective: Students understand how to approach a problem from a
    blank sheet of paper, by identifying the key abstractions
    (objects) in a problem, exploring their relationships to each
    other, and defining their responsibilities to the others.  They
    have experience decomposing a problem without having the
    constraints imposed by the DB or GUI paradigms.
  - Activities: Role playing after students have identified some key
    objects, each can pretend they are that object, and explain how
    they will accomplish what they need to, using other objects.
  - Project: Write Checkbook program as a small set of Objects,
    without a command or menu interface.

Section 4 - GUI Programming

3 weeks - ??
  - Objective: Students understand the challenges of GUI programming,
    and how they are handled by a common GUI object framework. They
    are able to write a GUI application with a representative set of
    features and to make it work without the help of super-fancy
    turnkey GUI programming tools. They understand how event-driven
    programming is different from other paradigms. They understand
    that all GUI frameworks have much in common.
  - Key Concepts
    - Event-driven programming
      - contrast with DB or text processing
      - has an event loop at its heart, watching for input, and making
        calls to methods as they occur.
      - matches certain domains, but NOT all.
    - Inheritance
      - Visually demonstrates inheritance, when a dialog is derived
        from another one.
    - Must connect "control" (e.g., button) to a method
      - declared in Python, rather than hidden as in VB
      - certain set of events pre-defined
    - Good GUI design keeps ALL data outside of GUI classes
      - Tempting to put state into GUI classes, especially if you
        start with them, and then flesh out functionality (as in VB).
      - Unless separated, event model will propagate down too far into
        design.
      - Final project, wrapping own OO design in a GUI, should show
        this clearly.
    - Done with regular method invocations, etc.
      - Declared, not "clicked" into being
      - GUI tools NOT necessary
      - Readability IS very important, as with all declarative
        things.
    - OO concepts reinforced
      - GUI objects are ONE SPECIFIC TYPE of object. They will NOT
        typically fit super-cleanly alongside of other objects.
      - Students should experience temptation of allowing GUI paradigm
        to rule implementation, and see the value of separating GUI
      from state.
      - includes scriptability
        - GUI must stay in its proper role of easing interaction with
        real functionality
      - GUI/DB is very simple mix, but NOT ALL PROBLEMS match that
        model.
  - (final) exercise is to put a real GUI on top of the checkbook
    program they wrote in the previous section.  The free GUI toolkit
    wxPython is used.  Students are to make the GUI objects they
    invent look as much like the normal deposit slips, checks, and
    checkbook register or account statements as possible.
 
Section 5 - DataBases Revisited

2 weeks - Final Project
  - Objective: Students learn by experience how to integrate two
    different logical models: Databases and Objects.  They learn that
    the Objects, which embody the clearest understanding of the
    problem, must drive the DataBase implementation, rather than the
    other way around.  They clearly understand the advantages offered
    by a DataBase, as well as the "cost" to the design of the program
    using it.  Each student must modify their checkbook program to
    utilize the database, changing whatever functionality that is
    necessary for that change. For example, they will likely move to a
    model where the database is updated as each check is modified,
    rather than in a "Save" operation.  In addition, each student must
    add some features to their checkbook program. Examples could
    include:
    - Check clearing
    - Checkbook reconciliation
    - Checkbook report writing (e.g., generating a statement of sorts)
    - Categorizing checks
    - Searching through checks using regular expressions
    - Exporting an account to a file, and importing from one.
    - Exporting a report to a file readable by Excel (csv)
    - ...

Section 6 - Bonus Project

  - Objective: Students use what they've learned to design from a
    blank sheet of paper something that interests them. It must
    utilize objects, plus two of the three other technologies
    introduced in the course:
    - GUI
    - DB
    - Flat file processing, potentially with regular expressions
  - Examples:
    - Battleship game (use DB for sharing a game between two players
      on different machines?)
    - ...
 


Review

Review basic concepts of Python programming that were addressed in Computer II.

Review Resources/Exercises

Along with review, possible activities include re-creating German Enigma pseudo-code and locating cribs (minus the I/O commands that appear in these examples).

Text Files, Regular Expressions & Exception Handling

File I/O Resources/Exercises

Regular Expressions Resources/Exercises

Along with exercises included in the above resources, possible activities include Enigma pseudo-code and crib identification with I/O processes; work with very large comma-delimited files (20,000 records / over a dozen fields - data from anonymous K-12 student data in PSD) involving si mple and advanced reporting of characteristics.

Exception Handling Resources/Exercises

Data Base

Data Base Resources/Exercises

Object Oriented Programming

Object Oriented Programming Resources/Exercises

Graphical User Interface

Graphical User Interface Resources/Exercises

Projects

Project Resources

Distribution Issues

Sample Python Programs


Scott Durkin