Java Reference
In-Depth Information
Data Type
ADT:
Type
Operations
Data Items:
Logical Form
Data Structure:
Storage Space
Subroutines
Data Items:
Physical Form
Figure1.1 The relationship between data items, abstract data types, and data
structures. The ADT defines the logical form of the data type. The data structure
implements the physical form of the data type.
given data structure. Other sections use the logical ADT for the data structure in
the context of a higher-level task.
Example1.9 A particular Java environment might provide a library that
includes a list class. The logical form of the list is defined by the public
functions, their inputs, and their outputs that define the class. This might be
all that you know about the list class implementation, and this should be all
you need to know. Within the class, a variety of physical implementations
for lists is possible. Several are described in Section 4.1.
1.3
Design Patterns
At a higher level of abstraction than ADTs are abstractions for describing the design
of programs — that is, the interactions of objects and classes. Experienced software
designers learn and reuse patterns for combining software components. These have
come to be referred to as design patterns.
A design pattern embodies and generalizes important design concepts for a
recurring problem. A primary goal of design patterns is to quickly transfer the
knowledge gained by expert designers to newer programmers. Another goal is
to allow for efficient communication between programmers. It is much easier to
discuss a design issue when you share a technical vocabulary relevant to the topic.
Specific design patterns emerge from the realization that a particular design
problem appears repeatedly in many contexts. They are meant to solve real prob-
lems. Design patterns are a bit like generics. They describe the structure for a
design solution, with the details filled in for any given problem. Design patterns
are a bit like data structures: Each one provides costs and benefits, which implies
 
Search WWH ::




Custom Search