[Introduction] [Programming Languages] [Java Programming] [C++ Programming] [Abstraction] [UML Diagrams] [Visual Studio .NET] [J2EE Web Services] [Software Engineering] [RSA Encryption]
See also the in-class notes
Programming in Java, including Classes, Inheritance, Exceptions, Collections, GUI building, and differences from C++
Programming in C++ from the perspective on an experienced C or Java programmer.
See these University of Toronto lecture notes based on the first few chapters of Liskov. See also pages 6-8 of these similar lecture notes from cs.sunysb.edu enumerating different kinds of abstractions.
See also Liskov's lecture notes on Chapter 4. (See the "software guarantee" for Cosmotronic Software on p. 2, and the specifications for find on p. 8)
Programs have historically been developed using pseudocode. Problem: this is a linear, algebraic way of modelling programming. The Unified Modelling Language (UML) is a more graphical way of modelling programming, more appropriate to Object-Oriented Programming (OOP). See a first example of UML class diagrams.
Access specifiers for fields (instance variables) and methods are:
- private
+ public
# protected
~ package accessStudents at a University model. Sketch, and more detailed class diagram. Upon more careful examination, we see that Student and Professor share the Name, Address, Phone, and email fields. We use inheritance to create a Person class to extract these shared behaviors, shown here.
This above document offers good explanation, particularly in explaining how composition (solid diamond) differs from association (arrow): composition is used when something is "part of" something else, such as a room is part of a building. Association is used when something has something else, but it is not logically part of it, such as a person has an address. In practice there is little difference in the writing of the code to implement these two.Examples: (find related material using a Google search on: UML diagrams tutorial)
- Elevator model description, brief class diagram, and detailed class diagram.
- This Borland site gives a detailed diagram.
- Consider how you would create the class diagram for:
- A school, combining Person, Student, Professor, Building, Room, Class, ClassList, Address, ...
- An adventure game, combining Room, Artifact (to be picked up), CourseMap, Player, ...
- A graphics drawing program, combining Square, Circle, Rectangle, Triangle, Line, ...
- A sales program, with Customers, ItemsForSale, Order, Address, ...
(See the MS Word class handout reflecting the diagrams from the above articles)
An article by Robert Martin describes how interfaces can be modelled by adding an "antenna" (aka lollypop) to a class, giving it a separate set of "ears" to listen.
Design Patterns are an additional level of abstraction that give design outlines that apply across a variety of software applications.
Microsoft Visual Studio .NET is a mature IDE with a rich feature set.
See the Notes and Demos for Visual Studio .NET. You can download all the examples as a single zip file (18 MB).
See the overview of J2EE Web Services. Browse the directory of files, or download the zip file. Note that Web Services can also be designed using Visual Studio .NET, which is described above.
Background & the Need
Spectacular software failures reflect general problems with software design.
W. Edwards Deming was directly responsible for inspiring and guiding the spectacular rise of Japanese industry after World War II. He has been described as a national folk hero in Japan. In 1980 Deming was "discovered" in America in an NBC television program entitled, "If Japan Can...Why Can't We?" The preface to his book "Out of the Crisis" refers to 14 points for Management, which also apply to software engineering. His approach has been called Total Quality Management (TQM). (See also the class handout (doc) excerpting from the above.)
His version of the national anthem (pdf), which addresses people's inability to hit all the notes, serves as a metaphor for one of his points for management: don't blame the singers (workers) if the song is written poorly (the system is the problem); instead, rewrite the music (fix the system).Carnegie Mellon's Software Engineering Institute (SEI) has developed 5 levels of competency for software development, called Capability Maturity Model Integration (CMMI). See the summary of these 5 levels. This work is based on the original Capability Maturity Model (CMM) paper. See also the nice tabular representations of CMM, based on Phillip Crosby's Quality Management Maturity Grid (QMMG).
See this tutorial (from UMass) on using CMM.
Object-Oriented Design
Object and Class Design (pdf)
Developing Classes Example (pdf)Cases to Consider
To get into thinking about the problem of software design in the real world, consider this problem (doc)
One aspect of software engineering is testing. Consider how you would test these pieces (doc) of code.
Also consider these questions (doc) having to do with issues surrounding software engineering.Links
Ponder software engineering proverbs at http://www.multicians.org/thvv/proverbs.html
See these well-organized software engineering links, including a description of CMM, design patterns, and the waterfall design model.
This nice RSA Encryption example is taken from http://www.profactor.at/~wstoec/rsa.html