Object Orientation Fundamentals
Object Orientation Fundamentals
SOFTWARE ENGINEERING
UNIT 03 : Object Orientation Fundamentals
SOFTWARE ENGINEERING
ORGANIZATIONS AND WORKFLOWS
System’s view
Data-driven view
Functional view
Event-based view
State machine view
SOFTWARE AS A PRODUCT
Programs Configuration data
Associated documents Additional services –
– System documentation trainings
– Manuals and websites
– User documentation/guide
– Advertisements
SOFTWARE TYPES
System software
Generally, two types Application software
Generic Mobile software/app
Web applications
– Developers get full control Production line software
Bespoke (customised) Embedded software
AI software
– Users get full control Ubiquitous computing
Wearable computing
OpenSource software
(Classroom discussion) Legacy software
...
SOFTWARE CHARACTERISTICS
Software is developed, Flexibility vs. complexity
but not manufactured. Software qualities
– Portability
Software doesn’t wear – Maintainability
out. – Modular
– Intuitive (ease of use)
Most software are – Reusability
custom built. – Stable
– Dependable
SOFTWARE EVOLUTION
THE EARLY YEARS THE SECOND ERA THE THIRD ERA THE FOURTH ERA
1950s 1960s – 1970S 1980s – 1990S 2000s –
Integration and
Specification Development Deployment
testing
Reference: Philippe Kruchten, The Rational Unified Process – An Introduction, Third Edition, Addison Wesley, 2003
How object-orientation helps model complex systems?
How object-orientation helps reduce
software/development risks?
What are software development problems?
What are the best practices of software development ?
BASIC CONSIDERATION
The world consists of;
Objects, and
Events
FUNCTIONAL VS OBJECT-ORIENTED
Functional approach Object oriented approach
Functions Objects – properties (attributes)
Modules
Data structures Events – methods (capabilities)
Shared space (monolithic)
WHY OBJECT ORIENTED APPROACH?
SOFTWARE PROJECTS
SOFTWARE DEVELOPMENT PROBLEMS -
SYMPTOMS
Inaccurate understanding of end- Poor software quality
user needs Unacceptable software
Inability to deal with changing performance
requirements Team members in each other's way,
Modules that don't fit together making it impossible to reconstruct
Software that's hard to maintain or who changed what, when, where,
extend and why
Late discovery of serious project An untrustworthy build-and-
flaws release process
SOFTWARE DEVELOPMENT PROBLEMS - ROOTS
Ad hoc requirements management Insufficient testing
Ambiguous and imprecise Subjective assessment of project
communication status
Brittle architectures Failure to attack risk
Overwhelming complexity Uncontrolled change propagation
Undetected inconsistencies in Insufficient automation
requirements, designs, and
implementations
SOFTWARE DEVELOPMENT – BEST
PRACTICES
1. Develop software 4. Visually model
iteratively. software.
2. Manage requirements. 5. Continuously verify
3. Use component-based software quality.
architectures 6. Control changes to
software.
1. DEVELOP SOFTWARE ITERATIVELY
1. Serious misunderstandings are made evident early in the
lifecycle when it's possible to react to them.
2. This approach enables and encourages user feedback so as to
elicit the system's real requirements.
3. The development team is forced to focus on those issues that
are most critical to the project and are shielded from those
issues that distract them from the project's real risks.
4. Continuous, iterative testing enables an objective
assessment of the project's status.
1. DEVELOP SOFTWARE ITERATIVELY
5. Inconsistencies among requirements, designs, and
implementations are detected early.
6. The workload of the team, especially the testing team, is
spread more evenly throughout the project's lifecycle.
7. The team can leverage lessons learned and therefore can
continuously improve the process.
8. Stakeholders in the project can be given concrete evidence of
the project's status throughout its lifecycle.
WATERFALL MODEL
ITERATIVE DEVELOPMENT
2. MANAGE REQUIREMENTS
A condition or capability a system must have.
1. A disciplined approach is built into requirements management.
2. Communications are based on defined requirements.
3. Requirements can be prioritized, filtered, and traced.
4. An objective assessment of functionality and performance is possible.
5. Inconsistencies are detected more easily.
6. With suitable tool support, it is possible to provide a repository for a
system's requirements, attributes, and traces, with automatic links to
external documents.
3. USE COMPONENT-BASED
ARCHITECTURE
Organisation of building blocks and their interactions.
Design versions
Design OOD
of the OO models
Construction OOP Actual system
Testing OO Testing Working system
Maintenance All of the above All of the above
EXAMPLE – UNIFIED PROCESS
EXAMPLE
EXAMPLE
ACCORDING TO PRESSMAN
UNIT 03: Object Orientation Fundamentals and UML
THE OBJECT MODEL
References:
• Booch et al., The Unified Modeling Language User Guide, Pearson. and
• Booch et al., Object-Oriented Analysis and Design with Applications, 3 rd ed., Addison-Wesley., Chapter 2 and 3.
Models: simplification of reality
MODELS
Are developed so that we can better understand the
system we are developing.
Conceptual level
Logical level
Physical level
MODELING
Principles of modeling
1. The choice of what models to create has a profound influence on the
how a problem is attacked and how a solution is shaped.
2. Every model may be expressed at different level of precision.
3. The best models are connected to reality.
4. No single model is sufficient. Every nontrivial system is best
approached through a small set of nearly independent models.
OBJECT-ORIENTED MODELING
Object-oriented perspective
Basic building block of a software system is the object or
class.
Object is a thing.
Class is a set of common objects.
Every object has;
– Identity (name)
– State (properties/data associated)
– Behavior (methods)
THE OBJECT MODEL
Generations of programming languages allowed the
shift from programming-in-the-small to programming-
in-the-large
– Object-oriented languages (Smalltalk, C++, Ada83, Eiffel)
– Emergence of framework (Visual Basic, Java, Python, J2EE, .NET,
Visual C#, Visual Basic .NET)
THE OBJECT MODEL
Topology of languages
THE OBJECT MODEL
Topology of languages
THE OBJECT MODEL
Topology of languages
THE OBJECT MODEL
Object-oriented languages
THE OBJECT MODEL
Foundations
Object model is influenced by many factors, not just object-
oriented programming. e.g. design of user interfaces,
databases, and computer architectures.
An object – maintains integrity and there exist invariant
properties that characterize an object and its behavior.
Objects cooperate with other!
THE OBJECT MODEL
Object-oriented programming (OOP)
A method of implementation in which programs are
organised as cooperative collections of objects.
Three features;
i. OOP uses objects, not algorithms, as its fundamental building
blocks (‘has a’);
ii. Each object is an instance of some class; and
iii. Classes may be related to one another via inheritance (‘is a’). (no
inheritance abstract data types, e.g. stack)
THE OBJECT MODEL
Object-oriented programming (OOP)
A language is object-oriented if and only if it satisfies the
following requirements :
It supports objects that are data abstractions with an
interface of named operations and a hidden local state.
Objects have an associated type [class ].
Types [classes ] may inherit attributes from supertypes
[superclasses ].
THE OBJECT MODEL
Object-oriented design (OOD)
A design method encompassing the process of object-oriented
decomposition and a notation for depicting both logical and
physical as well as static and dynamic models of the system
under design.
Design
Notation
THE OBJECT MODEL
Object-oriented analysis (OOA)
A method of analysis that examines requirements from the
perspective of the classes and objects found in the vocabulary of
the problem domain.
An object
– A tangible and/or visible thing
– Something that may be comprehended intellectually
– Something toward which thought or action is directed
OBJECTS
An object
– Has state – static properties and current properties
(dynamic)
– Has well-define behavior – how object acts and reacts in
terms of its state changes and message passing (operations:
modifier, selector, iterator, constructor, destructor; roles and
responsibilities)
– Has a unique identity – every object should be
distinguishable from other objects
OBJECTS
Relationship among objects
Two types
– Links – physical/conceptual connection between two
objects (peer-to-peer or client/supplier)
Choosing operations
– Functional semantics – focusing on reusability, complexity, applicability and
implementation performance
– Time and space semantics
BUILDING QUALITY CLASSES AND OBJECTS
Choosing relationships
– Law of demeter – the methods of a class should not depend on structure of other classes,
except its immediate super class.
– Visibility
Implementation
– Proper representation
– Proper packaging
UNIT 03: Object Orientation Fundamentals and UML
CLASSIFICATION
References:
• Booch et al., Object-Oriented Analysis and Design with Applications, 3 rd ed., Addison-Wesley., Chapter 4.
PROPER CLASSIFICATION
Classification helps generalisation, specialisation,
aggregation hierarchies among classes.
Objects, classes, hierarchies, associations etc. need to
properly identified.
Help maintain proper level of cohesion and coupling.
Challenges – there is no perfect classification, intelligent classification
requires tremendous amount of creative insight
IDENTIFYING CLASSES AND OBJECTS
Three approaches to classification;
Classical cetegorisation - All the entities that have a given property
or collection of properties in common form a category. Such properties
are necessary and sufficient to define the category. e.g. employee
Conceptual clustering – classes are generated by formulating
conceptual descriptions then classifying the entities according to the
descriptions. e.g. love songs
Prototype theory – class represented by prototypical object e.g. game
IDENTIFYING CLASSES AND OBJECTS
UNIFIED PROCESS
References:
Schach, S. R., 2008, Object-oriented software engineering, McGrawHill (Chapter – 3)
Bruegge B., and Dutoit A. H. 2010, Object-oriented Software Engineering using UML, Patterns and Java, 3rd ed., Prentice Hall (Chapter 15)
UNIFIED SOFTWARE DEVELOPMENT PROCESS
Development time – divided into cycles
Cycles – birth, childhood, adulthood, retirement etc.
Each cycle end with release of the system
Each cycle can be in one of four phases
UNIFIED SOFTWARE DEVELOPMENT PROCESS
Each phase might contain a number of iterations
Each iteration
– Use use-cases
– Mitigate risks in the iteration
– Acts as a project
Activities, also known as workflows, in each cycle
are performed in parallel
UNIFIED PROCESS - WORKFLOWS
UNIFIED PROCESS - WORKFLOWS
Engineering workflows
– Requirements – analysis of application domain and creation of
specifications
– Design – design of the software – creation of solution
– Implementation - code
– Test – test cases, benchmarking
UNIFIED PROCESS - WORKFLOWS
Supporting workflows
– Management – project planning
– Environment – development environment, automation of the
software process
– Assessment – verification and validation (reviews, walkthroughs and
inspections)
– Deployment – configuration, transition of the software system to the
end user
UNIFIED PROCESS - WORKFLOWS
IBM RATIONAL UNIFIED PROCESS
❃ Read Chapter 3 from book Object-oriented
software engineering by Stephen R. Schach.
End of Unit 03 : Object Orientation
Fundamentals