Skip to main content
Top

1997 | Book

Objects and Systems

Principled Design with Implementations in C++ and Java

Author: Bernard P. Zeigler

Publisher: Springer New York

Book Series : Undergraduate Texts in Computer Science

insite
SEARCH

About this book

The author's aim in this textbook is to provide students with a clear understanding of the relationship between the principles of object-oriented programming and software engineering. Professor Zeigler takes an approach based on state representation to formal specification. Consequently, this book is unique through its - emphasis on formulating primitives from which all other functionality can be built; - integral use of a semi-formal behaviour specification language based on state transition concepts; -differentiation between behaviour and implementation; -a reusable heterogeneous container class library; -ability to show the elegance and power of ensemble methods with non-trivial examples. As a result, students studying software engineering will find this a distinctive and valuable approach to programming and systems engineering.

Table of Contents

Frontmatter
1. Object Orientation and State Systems
Abstract
This chapter uses simple state machines to introduce the basic concepts of object orientation. You have run across state-system concepts in earlier courses, such as discrete math. One immediate advantage of using such concepts is that they enable us to describe the functioning of an object in a form independent of any particular software implementation. Using state diagrams, we can specify what functionality we want to obtain and then investigate different ways to achieve it. One of the simplest, yet nontrivial, examples of a finite state machine is the binary counter. First we implement this machine in C using a nonobject-oriented implementation. Then we will show how this machine can be implemented in C++. This will provide the basis for comparing the two kinds of approaches to programming and thereby demonstrate the advantages of object orientation.
Bernard P. Zeigler
2. Object Behavior Specification: Software Blueprints
Abstract
It may be difficult to imagine yourself simultaneously playing the roles of designer, implementor, tester, and user of a software tool. But that’s what best describes your activities if you are writing a program for your own later use. When you graduate, you might participate in a software development team where it is now common that designer, implementor, tester, and other roles are assumed by specialists on the team. For now, let’s stick with the case where you are the designer, implementer, tester and user of a software tool. Some form of abstract specification of the software is needed to facilitate communication among designer, implementor, and user. We will call it a blueprint (playing the same role as design sketches used by building architects) as illustrated in Figure 1. Suppose you are developing a set of classes in C++ or some other object-oriented language.
Bernard P. Zeigler
3. Lists: Behavior Specification, Models and Implementations
Abstract
You are familiar with linked lists from earlier courses in programming. Some languages, such as Lisp and Scheme, provide lists as built-in data structures together with some essential associated operations. But most languages don’t provide lists as basic data structures, so we must create and manipulate them using their basic data-structuring and procedure definition facilities. How would we go about defining a class of list objects and methods in such a language?
Bernard P. Zeigler
4. Inheritance Hierarchies and Hierarchical Construction
Abstract
This chapter introduces the concept of inheritance in object-oriented programming and design. Inheritance is an essential and powerful mechanism that enables new classes to be constructed on the basis of existing classes. Inheritance also helps to organize large software systems into manageable pieces through inheritance hierarchies. We also discuss a related concept, hierarchical construction often called aggregation in database contexts, that allows software modules to be connected together to form larger systems.
Bernard P. Zeigler
5. Containers: An Object Behavior Specification
Abstract
Chapter 3 presented an object behavior specification of the list class and explained the advantages of such a specification. We saw that there are many ways to implement list behaviors — in particular, sequential and parallel implementations differ radically. In Chapter 1 we mentioned that containers are basic classes that help store, retrieve and organize interacting objects. We said then that containers were generalized forms of lists. Actually, once we have freed ourselves from thinking in sequential processing terms, we can start with container as the more basic concept and derive lists as one of the special subclasses that happen to be natural for sequential processing but are not really fundamental in general.
Bernard P. Zeigler
6. C++ Implementation of a Heterogeneous Container Class Library
Abstract
This chapter discusses an implementation of the containers hierarchy in C++ called Heterogeneous Container Class Library (HCCL). Recall that “container” refers to a list-like structure to store data items, and “heterogeneous” means containers can hold different kinds of items. Therefore, HCCL provides a collection of list-like structures that are able to store different kinds of items. HCCL mitigates typing constraints in C++ since programmers are spared the task of implementing new container types for each new kind of object they develop.
Bernard P. Zeigler
7. Testing Based on Behavior Specification
Abstract
While “getting it right the first time” is an admirable goal, no one is able to write code that is guaranteed to work as intended without testing and debugging. Testing is the process of uncovering errors or “bugs” in code. Debugging is the process of removing them. The many books on object-oriented programming, C++ and Java in particular, tend not to deal with these issues. Books on software engineering do discuss testing as an important phase within software system development, but a good approach to testing that is tuned to the special characteristics of object orientation is not yet available. This chapter will provide the beginnings of such an approach that emerges naturally from the concepts of behavior specification that we have developed.
Bernard P. Zeigler
8. Constructing Inheritance Class Hierarchies
Abstract
In this chapter we formulate a heuristic procedure that can produce an inheritance class hierarchy. The procedure is heuristic since we don’t spell out how to make key decisions, such as finding common features for a group of classes. These decisions have to be made based on your knowledge of the application domain.
Bernard P. Zeigler
9. Ensemble-Based Implementation of Containers
Abstract
In earlier chapters, we discovered primitives for list implementation in serial computers. Historically, these pointer-based primitives were the first to be developed. But with the advent of parallel processing, and in view of new technologies likely to emerge for computation, we should not be limited to the conventional primitives. Ensemble methods are very suited to exploit parallel computation. This chapter shows that the ensemble methods for containers can serve as primitives for implementing all the behaviors of the containers’ hierarchy that we have identified.
Bernard P. Zeigler
10. Ordered Containers and Their Implementation
Abstract
We continue with the second branch of the containers specification hierarchy, that of ordered containers Figure 1 Consideration starts with class order, which is general enough to serve as a base class not only for classes stack, queue, and list, but also for a great many other applications. The underlying new concept is a linear ordering method, called greater-than?, which is assumed to be available to order the items in a container. By characterizing this method as a state-representing query, we obtain a generic capability to order container contents that can be readily specialized to any appropriate subclass. In particular, by properly defining greater-than? for stack, queue, and list, we can derive their behaviors from the base class order. (We will show later in this chapter how this differs from the usual specifications of stacks and queues, which don’t take advantage of state-representing queries.)
Bernard P. Zeigler
11. More Useful Concepts for Containers
Abstract
This chapter starts by showing how predicate logic constructs, such as ∀ (for all) and ∃ (there exists), can be formulated as ensemble methods for containers. Such methods are not really new since they can be derived from those already discussed. However, for efficiency reasons, it may be desirable to implement them as primitives in an OOP environment.
Bernard P. Zeigler
12. Design Based on Hierarchical Decomposition and Ensemble Methods
Abstract
This chapter presents a variety of examples of fairly complex systems that can be given quite elegant constructions using the concepts developed in the previous chapters. The key concept is to decompose a system in a top down manner so that a hierarchically constructed container is obtained. This enables the required behavior to be implemented with ensemble methods at each level.
Bernard P. Zeigler
13. Java and Threaded Containers
Abstract
Java was developed as an object-oriented language especially suited to programming for the World Wide Web. It can be regarded as a kind of hybrid between C++ and Smalltalk. Syntactically, it resembles the former. Java is more similar to Smalltalk, however, in several semantic respects. It is interpreted rather than compiled into executable form. Its suitability as an open language for Web programming stems from the fact that source code is translated into an intermediate form, called bytecode, which can be interpreted on major platforms such as PCs, Macs, and Unix workstations. This enables code residing on a server to be sent to a client for interpretation. This means that users can transparently run applications, called applets, that were developed at some other remote site.
Bernard P. Zeigler
Backmatter
Metadata
Title
Objects and Systems
Author
Bernard P. Zeigler
Copyright Year
1997
Publisher
Springer New York
Electronic ISBN
978-1-4612-1912-5
Print ISBN
978-1-4612-7335-6
DOI
https://doi.org/10.1007/978-1-4612-1912-5