What is a Program?
What an odd question to ask in a Computer Engineering Graduate class! Here are some reasonably sensible answers:
- A sequence of machine language instructions
- An execution image and perhaps child dynamic link libraries
- Source code text
- An application we run on a device of some kind
- One or more files stored at some directory location
- A set of communicating threads
- A process interacting with its operating system and machine environment
Each of these emphasizes some different aspect of what a program is; and we shall be concerned with
several of them in this course. We will also be discussing the interactions of programs in different
processes and different machines.
Program Structure:
One aspect of program structure is the mechanisms it uses to communicate with its environment. That may be to:
- Accept inputs on its command line and provide output to a terminal window
- Accept input and display output with controls embedded in a Graphical User Interface (GUI)
- Accept requests and supply results to other programs through operating system and web services
- Accept inputs and provide outputs through hardware devices using device drivers and enqueued messages
A program also has both physical and source package structure. It may:
- Consist of a monolithic executable with one or more threads of execution
- Be composed of an executable that loads shared dynamic link libraries (DLLs) at load time or possibly on demand during its execution
-
Aggregate components or pluggins that expose an interface and are built as DLLs so that a component can be modified,
rebuilt, and loaded by the aggregate without rebuilding any other part. That's what Windows does when it updates.
Each program has a source code package structure defined by:
- The source packages that make up the program
- The types and global functions that make up each package
- The network of dependencies between each of its types and packages
We will discuss most of these program structures in
Software Modeling and Analysis, in
Object Oriented Design, and
Distributed Objects.
But this isn't the end of the Program Structure story.
Software Systems
A software system is a collection of cooperating programs that jointly provide some service or environment that
supports inquiry, collaboration, and control. While in industry I worked on a Radar product whose digital makeup
consisted of about a dozen processors that jointly provided beam-forming, detection, data management, operator control,
and communication with theater management systems. Each processor communicated with others in the system through enqueued messages
and was responsible for a major part of the radar functionality.
These systems also have structure, which may take the form of:
- Client-Server
- Model-View-Controller using web services and database management systems.
- Peer-to-Peer
- Server Federations
Your final project in this course will focus on one of these kinds of system structures. For example, in Fall 2012 we investigated the
construction of a
Virtual Display System designed to be a wall display interface into a sophisticated
software development environment called VRTS - Virtual Repository Testbed System which is a federation of development servers.
Modeling
A software system may become far too large for any one person to understand in detail all of its source code
1. The modeling part of SMA focuses on
a set of modeling abstractions that help us understand an entire large system by focusing on its design features and behavior
rather than its detailed implementation.
To do that we introduce a superset of the Universal Modeling Language (UML) diagrams. Specifically:
-
Package Diagrams:
Each package consists of one C# or Java source file or two C++ files - header and implementation. A package diagram shows all of the pertinent
packages and their dependency relationships.
-
Activity Diagrams:
Activity diagrams show processing structure, dependencies, and synchronization.
-
Class Diagrams:
Class diagrams show classes and their relationships, e.g., inheritance, composition, aggregation, and using.
-
Sequence Diagrams:
Sequence diagrams show communications between each of the objects in a system.
-
Structure Charts:
Structure charts show calling relationships between functions. They are very effective
for deeply nested call graphs.
-
State Diagrams:
States are alternate sets of processing (states) that are selected by some event.
State diagrams show designated states and the events that trigger moving from one state to another.
-
Use Case Diagrams:
These diagrams show a set of actors and the system features they use.
-
Ad Hoc Architectural Diagrams:
Custom diagrams that illustrate some key feature of the structure or behavior of a software system.
Summary:
-
There are several different views of a program which will be important for us in SMA - code of course, but also physical and logical structure.
-
One person cannot understand all the source code in a large system. We need other ways of thinking about software in addition to its code. That's why we will be talking about modeling
and use model abstractions.
-
The last few versions of the Windows operating systems have more than 50 million lines of source code. Even the "small" Linux operating system has,
according to Dr. Google, more than 15 million lines of code.