|
|
Software Design - Case Studies
Each cases is intended to illustrate a relevant lesson in software design. All of these cases use code written by myself. All projects are for the Microsoft Windows® operating system. C and C++ code was written for Visual Studio 6.0.
Some of the projects use UML drawings. Forgive me if you find any technical typos in the UML - that's the risk of using a formal notation. If you haven't already had a near-death experience with UML, I recommend learning it. There are some decent books on it - the bad books just have them outnumbered!
SkyDiving |
This is a very elementary program whose sole purpose is to demonstrate coding a Mealy state machine. Source code is in C++. The design uses a simple [State, Event] table to implement the state machine.
This case illustrates:
|
SkyDiving #2 |
This is the same SkyDiving concept as above, but this example uses the State Design Pattern. There are TWO versions here: the first Implemented in Java using Eclipse 3.3, and the second implemented in C++ with Visual Studio 2008. It includes additional concepts, such as the use of the Flyweight design pattern and the use of Guards in state machines.
This case illustrates:
|
Vroom-Jago Decision Tree |
The Vroom-Jago model identifies five different leadership styles, from autocratic to group consensus, and poses eight questions to determine which style is most appropriate for a given situation. The decision tree is based on human behavior models, so the logic is arbitrary from a computer's perspective.
This program implements a Vroom-Jago decision tree. Source code is in C++. The compiled program is also downloadable.
This case is a simple state machine that uses a [State, Event] table, and illustrates:
|
Currency Conversion |
A WIN23 console application, I wrote this for a school project. Source code is in C. The compiled program is also downloadable.
This case illustrates:
|
Generic Error Object |
Remember the true horror story about the second error variable? This was my response to that situation. Source code is in C++ and is reusable. The source code is from case study below that uses this error object - the Input & Output Formatter case study. This case has the complete interface spec for the error object.
This case illustrates:
|
Input & Output Formatter |
Remember the true horror story about the tightly coupled objects that broke when changed? This is an except from a larger program, and demonstrates the ability to instantiate an object based on the the desired behavior, while isolating the rest of the application from the details of implementation.
In this case, the task was to read and write a particular set of data in one of several possible formats. No source code is provided, other than the minimum required to illustrate the concepts. Source code is in C++.
This case illustrates:
-
Object-Oriented Design.
-
Polymorphism.
-
Delegation of object creation via the Class Factory design pattern.
-
Singleton design pattern.
-
Decoupling of modules to reduce dependencies.
-
Use of UML in design.
|
Fireball |
This is a logic game based on an old HP 41C calculator game. This is a Windows version that provides a user interface for this simple game of logic. The game board holds several hidden posts. On each of the four sides of the board is a row of cannons. The player gets a fixed number of shots. The cannonball travels down the rows and columns, deflecting off the posts until the ball exits the board. The location of the posts can be determined through logical deduction. Source code is in C++.
This case illustrates:
-
Functional decomposition in conjunction with Object-Oriented Design.
-
Singleton design pattern.
-
Bridge design pattern.
-
Decoupling the user interface, so that objects using the UI can remain unaware of the details of UI implementation.
-
Reusable source code. Some of the classes can be reused as-is (CMyBitmap, CAboutDialog, CDice) and some can be reused with minor modification (CSound).
|
SERIM |
This is a tool used in Project Risk Assessment. It has 81 questions in 10 categories, and provides an assessment of the project risk.
This case illustrates:
- Class Factory design pattern.
Click here for the Case Study in PDF.
Click here for the source code in C++.
Click here for the executable program. |
Disk CRC Calculation |
This is a tool used to calculate a 32-bit Cyclic Redundancy Check (CRC) of an entire disk, a directory, or a set of files.
This case illustrates:
- Process Hazard Analysis.
- Use cases in requirements gathering
Click here for the Process Hazard Analysis in PDF.
Click here for the source code.
Click here for the executable program. |
|