Lab 1 Introduction To Object Oriented Software Engineering and Object Orientation in Uml
Lab 1 Introduction To Object Oriented Software Engineering and Object Orientation in Uml
Learning objective:
After this lab student should be able to:
What is object oriented software engineering?
Review of object oriented programming.
Understanding of system models.
Understanding Object Oriented Analysis and Design (OOAD).
Software Development activities in OO.
Artefacts of OBJECT-ORIENTED software development.
1
Principles of Object orientation
When modelling a solution in object-oriented software development, principles of object
orientation form the foundation of the constructed system, therefore it is important to understand
them.
1. Abstraction
Abstraction means a representation of a real-world entity, thing or a concept as an Object.
It focuses on ignoring irrelevant features, properties, or functions of the real-world object
and emphasizing the ones relevant to the scope of the problem. For example: A Student
class in a university’s course registration system represents a real-world student at a
university. This student may have grandparents, but for a course registration system, this
information about the student is irrelevant. Only his/her name, registration number and
semester details are relevant. Hence only relevant details are kept when modelling the
system.
2. Polymorphism
Polymorphism is the phenomenon of an something existing in more than one form. It
ensures that the appropriate method is called for an object of a specific type when the
object is disguised as a more general type.
3. Inheritance
A class can extend another class, inheriting all its data members and methods while
redefining some of them and/or adding its own. Inheritance represents is a relationship
between data types. For example: a Circle is a Shape. A Software Engineering Student is
a Student.
2
4. Encapsulation
Encapsulation means that all relevant information and behavior of a real world object are
enclosed as a class/object and is also hidden from the other objects to protect it from
unauthorized access (such as private attributes and functions of a class). Other classes
interacts with this class only through its interface (i.e. constructors and public methods).
Software Lifecycle in OO development
The activities associated with software development are:
3
1. Requirements Elicitation: During requirements elicitation, the client and developers
define the purpose of the system. The result of this activity is a description of the system
in terms of actors and use cases. Non-functional requirements are also elicited.
2. Analysis: During analysis, developers aim to produce a model of the system that is
correct, complete, consistent, and unambiguous. Developers transform the use cases
produced during requirements elicitation into an object model that completely describes
the system.
3. Design:
System design: During system design, developers define the design goals of the project
and decompose the system into smaller subsystems that can be realized by individual
teams. The result of system design is a clear a subsystem decomposition and a
deployment diagram representing the hardware/software mapping of the system.
Object Design: During object design, developers define solution domain objects to
bridge the gap between the analysis model and the hardware/software platform defined
during system design.
5. Testing: During testing, developers find differences between the system and its models
by executing the system (or parts of it) with sample input data sets. During system
testing, typical and exception cases are run through the system and compared with the
requirements model. The goal of testing is to discover as many faults as possible such
that they can be repaired before the delivery of the system.
6. Maintenance: The maintenance phase of the SDLC occurs after the product is in full
operation. Maintenance of software can include software upgrades, repairs, and fixes of
the software if it breaks.
4
Issue Model: Issue Model covers the important change management aspects.
a. The Functional Model describes the functionality of the system from the user’s point of
view. “What the system is supposed to do?” and “Who uses which behaviour of the
system?” – These questions are answered through model.
b. The Object Model describes the structure of the system in terms of objects, attributes,
associations, and operations. Answers questions of “What classes/objects is the system
divided into?” and “How are these classes inter-related?”
c. The Dynamic Model describes the internal behaviour of the system in reaction to an
external trigger. This model helps answer the following questions about the system under
construction: “What is the sequence of functionality executed by the system?” and “How
does an object behave when its function is called by some external trigger?”
5
Unified Modelling Language: The Unified Modelling Language (UML) is a general-purpose,
developmental, modelling language in the field of software engineering that is intended to
provide a standard way to visualize the design of a system, including elements such as: any
activities (jobs); individual components of the system; and how they can interact with other
software components; how the system will run; how entities interact with others (components
and interfaces); external user interface. UML is originally intended for object-oriented design
documentation, however now it has been extended to a larger set of design documentation and
been found useful in many contexts. UML is a tool for modelling an Object-Oriented system.
UML has many types of diagrams, which are divided into two categories:
a. Static (or structural) diagrams emphasize the static structure of the system using
objects, attributes, operations and relationships. It includes class diagrams and composite
structure diagrams.
b. Dynamic (or behavioural) diagrams emphasize the dynamic behaviour of the system
by showing collaborations among objects and changes to the internal states of objects.
This view includes sequence diagrams, activity diagrams and state machine diagrams.
Some types represent structural information, and the rest represent general types of
behaviour, including a few that represent different aspects of interactions. These
diagrams can be categorized hierarchically as shown in the following class diagram.
6
Unified Modeling Language (UML):
a) UML Notations Each UML diagram consists of symbols (which depict a concept),
directed lines or arcs (which depict relationships between concepts), and labels for these
symbols and lines (depicting their name or nature). Following example shows is the UMl
notations diagrams.
b) UML Versions: UML has been evolving since the second half of the 1990s and has its
roots in the object-oriented programming methods. UML started from version 1.0 and
has reached 2.5 currently. Each version supports a variation of symbols and
diagramming elements.
c) UML Tools: Many professional UML tools are available on the internet (for free and/or
paid) that let you draw UML diagrams with ease. This course will use Microsoft Visio as
the standard UML tool for modelling.
Object Oriented Analysis and Design using UML Diagrams: UML diagrams are used to
understand and elicit system requirements and helps in providing a visual picture of the
system to be constructed. Therefore, Analysis and even design heavily involves diagramming
using UML. However, it is important to distinguish that a diagram is a partial graphic
representation of a system's model. The set of diagrams need not completely cover the
system model and deleting a diagram does not change the model. The model may also
7
contain documentation that drives the model elements and diagrams (such as written use
cases). The following diagrams are associated with the given system models:
8
Lab Task: [Total Marks = 10]
Note: You may browse online to answer the following questions. But you must write references
Lab Instructor: