Software Structure, Design, & Documentation
-
Design Study Guide
Design presentations, concepts, and notes.
- UML Notation
Universal Modeling Language notation, used in the course to illustrate designs and design ideas.
- Encapsulation
Fundamental design mechanism, fully supported by OO Languages like C++.
- Packages
Defines structure for packages, motivates their use.
- Partitioning: classes, packages, processes, and machines
Intercommunication between these levels differ in performance by orders of magnitude!
- Fragile Designs
Things you Don't and Do want to write into your code.
- OOD Principles
Four important OOD Principles:
Liskov Substitution (LSP),
Open Closed (OCP),
Dependency Inversion (DIP),
Interface Segregation (ISP).
-
Programming to Interfaces
Very important topic: This is the primary mechanism for designing loosely coupled systems.
- Distinguish between interface, abstract class, and concrete class
Tri-level inheritance structure: combined substitution and code sharing.
- Component: an isolated part
Key design idea.
- Using Inheritance
Summarizes several ways inheritance is found to be useful in SW Designs.
- Software Structure Research
Research presentation - illustrates dangers of miss-using dependencies.
- XML
Syntax of the XML metalanguage.
C++ Language
-
Course Context
Substrate of background knowledge required for this course (not all required at beginning).
- Brief Survey of C++ Language
A quick tour of the language.
- Introduction to C++
Broad survey of C and C++. Compilation, Memory, and Computation models. We will step throught this very quickly.
-
Value Types,
Str String Class
ADTs are user defined types that that support almost all of the operations expected of primitive types.
- C++ Operators
Discloses C++ operator model.
-
Hierarchy,
Demo Composition,
Demo Inheritance
Study of class relationships. There is a lot of material here you will need to master for the midterm,
for interviews, and for professional work.
-
Templates,
Basic sample code,
Template Techniques,
Template Functors
Template functions and classes, some useful techniques, and template function objects.
-
HashTable Template with Iterators,
HashTable code
A usefule reusable component that nicely illustrates sophisticated template techniques.
- Template Policies and Traits
Template techniques essential for STL and many template classes like Hashtable.
-
Namespaces,
Namespace Taxonomy concept
Way to partition code names to avoid ambiguity. Can be used to help disclose design.
-
Exceptions,
Sample code
Object Oriented Error Handling - effective mechanism, but not without its problems.
- Run-Time Type Information (RTTI)
A very weak form of reflection: retrieves type names and some hierarchy information.
-
Template MetaProgramming (incomplete),
Sample code
Bizarre, occasionally very useful program constructions using C++ compile-time template processing.
Standard Libraries:
|
Basic C++ Language Demos
-
Elementary Syntax
Illustrates C++ pointers vs. C++ references, classes and objects, Template classes, composition, and inheritance.
- Basic inheritance demo
Public inheritance implies an "is-a" relationship.
- Class Relationships
Illustrate composition, aggregation, using, and inheritance.
- Syntax variations required for different contexts
Six ways to call void Ctor, four ways to call copy Ctor, two ways to call an operator!
- str string class
Str class illustrates design of Value Types. You should prefer std::basic_string<T>.
-
Templates,
Advanced template techniques
Simple template demos, then exploration of some more advanced technques.
- Nodes for Linked List
Good exercise with C++ pointers and references.
- Function Pointers
Invoke global and member functions through function pointers.
- Casts
Illustrate traditional casts, static_cast, reinterpret_cast, const_cast, and dynamic_cast.
- Exceptions
Demonstrates standard and user-defined exceptions.
- Pure virtual functions
You can supply a definition for a pure virtual function.
- Class Layout
Illustrates how composite classes are layed out in memory.
C++ Standard Library Demos
Custom Containers
Interesting design ideas
Issues with C++ Language
-
Failure to initialize properly
Illustrates a surprising problem that occurs if you don't use constructor initialization sequences.
See, specifically, deminher2 (error) and deminher2b (error fixed).
- Hiding
Hiding is a subtle flaw, caused by inappropriate function overloading.
Form Demonstrations
System Programming
-
File Information
Extract file information from specified file, using Win32 API.
- WinTools
Provides Directory, file, and string conversions, using Win32 API.
- Component: Interface, factory, DLL - a demo
Packaging code in Dynamic Link Libraries (DLLs)
Dynamic Link Libraries are a standard packaging mechanism, required to make components.
- Packaging socket code in DLL
A more realistic example of DLL packaging, using socket demo code.
-
Win32 Sockets,
Win32 Socket Demo,
Sockets examples
Sockets are a low-level, byte oriented communication mechanism. Supports interprocess communication and network programming.
-
Windows Threads,
Process-Threads Model
Discussion of processes, threads, scheduling, and thread synchronization.
-
Reusable Thread class,
Thread class structure,
Locks classes
Implementation of threads class and several kinds of locks.
-
Blocking Queue,
Blocking Queue
Reusable component, important for passing messages between threads.
- Process enumeration
Display names of all currently running processes.
- Spawn Windows Process
Create a process programmatically, passing it command line arguments.
- Embedded Resources
Demonstrates how to embedd a text resource into an execution image, and how to use it too.
- Base64 Encoding
Base64 Encoding is used to convert binary data into character arrays.
Application Prototypes
-
Parser Prototype,
Parser Structure
Core of code and XML analyzer - has Tokenizer, TokenCollector, Parser, Rules, and Actions.
-
Simplified Test Harness,
Test Harness,
Test Harness Structure
Test Harness loads assemblies, looks for ITest interface, creates test objects and executes them.
- Peer-to-Peer System Structure Diagrams
Model for communicating systems, uses WCF. Each peer has a message sender and receiver.
Special Purpose Reusable Packages
-
Concurrent Access to Files
Provide safe access to files for reading and writing when there are concurrent clients.
- Smart Pointer
Smart pointer manages access to heap objects with reference counting.
|