06-10-2012, 04:20 PM
UML INTRODUCTION
UML INTRODUCTION.pdf (Size: 1.22 MB / Downloads: 103)
DESCRIPTION:
The heart of object-oriented problem solving is the
construction of a model. The model abstracts the essential details of
the underlying problem from its usually complicated real world.
Several modeling tools are wrapped under the heading of the UML,
which stands for Unified Modeling Language. The purpose of this
course is to present important highlights of the UML.
CLASS
A class is a blueprint or prototype from which objects are
created. This section defines a class that models the state and
behavior of a real-world object. It intentionally focuses on the basics,
showing how even simple classes can cleanly model state and
behavior. For example, the class Dog would consist of traits shared by
all dogs, such as breed and fur color (characteristics), and the ability
to bark and sit (behaviors).
OBJECT ORIENTATION CONCEPTS:
Object-Orientation goes beyond just modeling attributes and
behavior. It considers the other aspects of objects as well. Objectoriented
programming (OOP) is a programming paradigm that uses
"objects" – data structures consisting of data fields and methods
together with their interactions – to design applications and computer
programs. Programming techniques may include features such as data
abstraction, encapsulation, modularity, polymorphism, and
inheritance. These aspects are called abstraction, Inheritance,
polymorphism and encapsulation.
ENCAPSULATION :
Encapsulation conceals the functional details of a class from
objects that send messages to it.
For example, the Dog class has a bark () method. The code for the
bark() method defines exactly how a bark happens (e.g., by inhale()
and then exhale(), at a particular pitch and volume). Timmy, Lassie's
friend, however, does not need to know exactly how she barks.
Encapsulation is achieved by specifying which classes may use the
members of an object. The result is that each object exposes to any
class a certain interface — those members accessible to that class.
The reason for encapsulation is to prevent clients of an interface
from depending on those parts of the implementation that are likely to
change in the future, thereby allowing those changes to be made more
easily, that is, without changes to clients. For example, an interface
can ensure that puppies can only be added to an object of the class
Dog by code in that class. Members are often specified as public,
protected or private, determining whether they are available to all
classes, sub-classes or only the defining class. Some languages go
UNIFIED MODELING LANGUAGE
POLYMORPHISM :
Polymorphism allows the programmer to treat derived class
members just like their parent class's members. More precisely,
Polymorphism in object-oriented programming is the ability of objects
belonging to different data types to respond to calls of methods of the
same name, each one according to an appropriate type-specific
behavior. One method, or an operator such as +, -, or *, can be
abstractly applied in many different situations. If a Dog is commanded
to speak(), this may elicit a bark(). However, if a Pig is commanded to
speak(), this may elicit an oink(). Each subclass overrides the speak()
method inherited from the parent class Animal.
Why is UML important?
Let's look at this question from the point of view of the
construction trade. Architects design buildings. Builders use the
designs to create buildings. The more complicated the building, the
more critical the communication between architect and builder.
Blueprints are the standard graphical language that both architects
and builders must learn as part of their trade.
Writing software is not unlike constructing a building. The more
complicated the underlying system, the more critical the
communication among everyone involved in creating and deploying
the software. In the past decade, the UML has emerged as the
software blueprint language for analysts, designers, and programmers
alike. It is now part of the software trade.