Overview

 < Day Day Up > 



Chapter 1 contains the background material for the rest of the book. Definitions of concurrent programming and components are given. This chapter points out that the intuitive definition of concurrency (i.e., multiple activities occurring at the same time) is not useful in understanding the problems in concurrent programming and the mechanisms required to solve those problems. A better definition is provided using activities that can interleave execution order, and the mechanisms to control that interleaving are discussed. The chapter also considers the different reasons for using concurrent programming and how they impact the type of solution generated.

Chapter 2 covers the basics of concurrency in computer programs. How concurrency is implemented is discussed to explain the behavior of the programs - for example, why stack-based local variables are safe in a concurrent program but instance variables are not. Chapter 2 also covers the mechanisms for synchronization in Java, how they are implemented, and why the decisions were made to implement them in these manners. It is important that students understand the reasoning behind the implementation details because often students try to memorize the effects of using synchronization constructs in programs. This normally leads to not understanding how to use the construct, invalid programs, and frustration with the language in general. All of these problems can be avoided simply by understanding why synchronization is implemented as it is.

Chapter 3 provides a simple method for designing concurrent programs around passive and active objects. The active objects are simple procedural entities, and the passive objects are designed using state diagrams that are translated using simple rules into Java classes. While this technique is not sufficiently powerful to implement all programs, the concepts are simple to understand and provide a good mechanism for evaluating many components.

Chapter 4 deals with the concept of an object in Java. Objects in Java differ from some languages, such as C++, and these differences are substantial enough that they affect the way a program is developed. The advantages of this model are discussed in detail.

Chapter 5 is an overview of programming with interfaces. While the Java programming language does not have parameterized data types (generics or templates), it is possible to work around this lack by using interfaces. This chapter explains what an interface is and how it can be used to implement classes that will work with generic objects.

Chapter 6 covers exceptions. Exceptions are covered in nearly every introductory text for Java. But the point of view of these texts is normally how to use exceptions in Java; however, an exception handling strategy is an important part of any design for a program. This chapter explains how exceptions can be used to effectively handle problems that occur at runtime.

Chapter 7 covers the Java Event Model using an animator program. This animator is a component that allows any object that is drawable to register with it and then allows the object to be animated. The animator is implemented using the Java Event Model and is built in stages by solving problems until the form of the Java Event Model has been completed.

Chapter 8 introduces examples of cooperative synchronization using the animator and several threads that suspend while they are moving in an animation. In this way, the effects of trying several different synchronization schemes is shown graphically so the race, deadlock, and starvation situations are obvious.

Chapter 9 combines techniques from Chapters 3, 7, and 8 and introduces some others such as confinement to show more robust solutions to concurrent problems.

Chapter 10 introduces object design in terms of reuse and specifically deals with how to do reuse with objects that are essentially utility objects or objects that are not part of the problem design but provide a service to one or more applications. Procedural as well as object-oriented reuse is covered, with object reuse being demonstrated using both composition and classification. The final result is to argue that composition should always be used for reuse of what essentially is a utility class.

Chapter 11 looks at the more traditional topics in OOP of composition vs. classification in regard to designing objects to solve a problem, which involves the simple "is" and "has" rules, as well as the concepts of aggregation and association of objects in composition design. This chapter covers these concepts in terms of the choices that need to be considered when designing a program and why some designs result in more robust systems than other designs. Also covered is the impact of concurrency on the different designs.

Chapter 12 looks at the topic of program management, or the issues involved in actually implementing a program after it has been designed. This chapter includes a number of Java-specific items that make enforcing good program management easier.

Chapter 13 applies the principles covered in the first 12 chapters to several distributed computing problems using RMI. This chapter shows how some distributed computing programs are just types of component programs.



 < Day Day Up > 



Creating Components. Object Oriented, Concurrent, and Distributed Computing in Java
The .NET Developers Guide to Directory Services Programming
ISBN: 849314992
EAN: 2147483647
Year: 2003
Pages: 162

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net