Lecture #3 - Software Architecture

More help with Projects

Synopsis:

Last time we discussed the notions of Software Architecture, the Operational Concept Document, packages and discussed a standard notation, UML, to be used throughout the course. We continue the discussion of the Operational Concept Document (OCD), used to document a system's architecture and provide some more help for Projects #1 and #2.

Lecture Content:

  1. The Syllabus describes topics to be covered, reading material for you to digest before coming to class, and due dates for the assigned projects.
  2. Help Session this Friday, Sept 11th at 9:00am in CST 4-201.
  3. Have you installed Visual Studio 2015? When you've installed VS2015 we will schedule a help session to demonstrate basic C# techniques.
  4. Where are we?

    We've discussed software size and dependencies as motivation for studying architecture. So is defining a software architecture something that someone else does? Something that channels what we do as developers?

    No! Every time you develop a program you define an architecture, either consiously :-) or unconsiously :-(. That's determined by the way you build code in source files, the way you define classes and their relationships inside those files, the way you package the files as executables and dynamic link libraries. You can build an architecture that is:

    • Spaghetti:
      Stuff everything into one huge file with intricate dependencies like spaghetti in a bowl.
    • Baroque:
      So ornate and complicated that it is hard to understand how it functions.
    • Fragile:
      Uses no error handling, uses full path names welded to the development environment, attempts to open files without checking to see if they exist, uses fixed arrays to hold collected data so the storage is almost always used wastefully or insufficient causing exceptions to be thrown.
    • Well Crafted:
      • Avoids the defects listed above.
      • Has packages that are cohesive - do only one thing, but do it well - and are named to reflect their function.
      • Has an Executive that directs program flow without attempting to participate in processing.
      • Has a beginning, where processing inputs are gathered and stored, a middle where inputs are processed, and an end where data is converted to information for the user.

      You build a well crafted architecture by thinking about needs of users, the size and form of program inputs and outputs, deciding the tasks that are required, providing at least one package for each task, then building the task packages, avoiding spaghetti coding, using an editorial "red pencil" to simplify and remove baroque structure, and thinking about errors that could happen and how to avoid or handle them.

  5. Help for Projects #1 and #2

    Project #1
    Context & Motivation ==> Uses and users ==>organizing principles ==> tasks ==> structure ==> risks

    Project #2
    Obligations ==> Tasks ==> activities ==> Subsystems ==> packages
    Core Services ==> packages

    Class Relationships

    Code to peruse:

    Uses and Users:

    Organizing Principles:

    Critical Issues:

    OCD Guide
    One major purpose of OCD preparation is to help you think critically about your architecture and top-level design

    .Net Containers
    Examples of containers that you will need to know about for this and later projects:
    Non Generic: ArrayList, HashTable, SortedList - hold objects
    Generic: Dictionary, HashSet, LinkedList, Queue, Stack - hold instances of parameterized types

  6. Software Architecture:

  7. C# versus C++
  8. C# Code Examples and Tutorials:

  9. Lecture Takeaway:

    The most important things we discussed today where: Next time we will be looking at C# code examples. Please look at these and bring printouts to class. Some of these examples are relevant to Project #2.
    • C# Demos
      Introduces classes, class relationships, generics, enumerable types, and extension methods.
    • C# Syntax Examples
      Demonstrates use of arrays, properties, indexers, simple reflection, and disposing.
    • Navigate Directory Trees
      Shows how to walk through a directory tree, using the services of the Directory and Path classes from the Framework Class Library (FCL).
    • Navigate with Delegates
      Shows how to make the Navigate module reusable by incorporating delegates.