Java Reference
In-Depth Information
analysis model expresses a problem-oriented view; it provides entities and
relationships that capture everything of importance in the system to be
developed. OO methods encourage analysts to represent a system the way it
is perceived, without being constrained by how it will be implemented.
Domain models play an important role any time we address a new appli-
cation domain (e.g. enterprise information systems, simulation environ-
ments, text editors). The requirements that we are likely to analyse have
often been studied and are well understood. Therefore, it is important to
refer to the related literature and to find hints and help from it.
Object-oriented design is concerned with the transformation of analysis
models into design models with desirable functional (e.g. browsing a cata-
logue in alphabetic order) and non-functional (e.g. high performance and
safety) properties.
An important step is the transition from the design model to the imple-
mentation code. This process must meet the capabilities of the implemen-
tation language, which we begin to explore in this first part of the topic. Here
we assume a working knowledge of the basic constructs of the Java language.
The case studies will focus on basic design and implementation techniques
such as many-to-one associations, generalization and collections. These
techniques will be coded in a reusable format and form the base of the
reader's development vocabulary.
Basic building blocks
In the OO paradigm objects are characterized by state, behaviour and iden-
tity. Each object has a state, i.e. the data it contains. The behaviour consists
in the set of operations that the object can perform on its data. Finally, each
object has an identity that identifies it univocally within the application.
Classes define the common data structure (i.e. the data types that are used
to represent the state), and behaviour (i.e. the set of operations that can be
performed by an object) of a family of objects. Objects with similar pro-
perties belong to the same class. They are program units, which encapsulate
both data and algorithms.
The OO paradigm supports the development of software applications by
offering three basic techniques. (1) Encapsulation , which consists in con-
structing new classes around data. (2) Inheritance , which consists in deriving
new classes as specializations of other classes. (3) Polymorphism , which
allows two or more subclasses of the same class to respond to the same
message (the invocation of an operation) in different ways.
New classes can be defined on the basis of existing ones by means of
inheritance. This technique allows both reusing characteristics defined in
already existing classes and to factor common characteristics of several
classes within a single class. The latter options leads to two advantages: first
it reduces development effort, second it simplifies maintenance by providing
a single point of change.
Search WWH ::

Custom Search