SlideShare a Scribd company logo
Object-oriented Analysis,
Design & Programming
Allan Spartacus Mangune
Delivery
• Lectures – 2.5 hours
• 2 case studies and exercises – 30 minutes each
Agenda
Object-oriented Analysis
Object-oriented Design
Object-oriented Programming
Object-oriented Analysis
Best done in iterative and incremental approach
• Refine as you learn more about the system and implementation constraints
Develop the models of the system based on functional requirements
• Does factor implementation constraints of the system into the model
Organize requirement items around objects that interact with one another
• Requirement items are mapped to the real things of the system
• Each item may be defined as object with data and behavior
Process
Model the system of its intended use taking into account the description and
behavior of each object
• Emphasize on what the system does
Define how objects interact with one another
Commonly used process tools
• Use case
• Conceptual models (also referred to Domain Models)
Use Case
Source:
http://en.wikipedia.org/wiki/File:Use_case_restaurant
_model.svg
A sequence of related actions to accomplish a specific goal
Each role in the system is represented as actor
The actor can be a human or other systems
• Identify the main task of each actor
• Read
• Write/Update
• Notification of effects of action taken on internal and/or external system
Conceptual Models
Abstract ideas in problem domain
Describes the each object of the system,
its behavior and how objects interact with
one another
• Attributes, behaviors and constraints
Use this model to build the vocabulary of
concepts and validate your understanding
of problem domain with domain experts
• Defer encapsulation details to the design phase
Source: http://en.wikipedia.org/wiki/File:Domain_model.png
Object-oriented Design
System
planning
process
Solve specific
problem
Promotes
correct
program flow
Starting the Design Phase
Can be started in parallel with analysis phase
• Incremental approach is preferred
Use the artifacts in analysis phase as inputs
• Use case models
• Conceptual models
Key Concepts of Object-oriented Design
Objects and
Classes
Encapsulation
and Information
Hiding
Inheritance
Polymorphism Interface
Objects
The most basic elements in object-oriented design
An object represents a real entity with attributes and behaviors
• Has a unique identity in the system
Objects interactions
• Interface is defined to describe all the actions an object must perform
Class
Represents the blue-print of an object
• An object that is created based on a class is called an instance of
that class
Contains attributes, data and behaviors that act on
the data
Defines the initial state of data
May contain interface that defines how the class
interact with the other parts of the system
• For this purpose, an interface is a set of methods and properties
exposed through public access modifier
Encapsulation and Information Hiding
The internals of an object is hidden
• Restricting access to its data
Prevents external code from setting the data in invalid state
Access to the data can be provided indirectly through public properties and methods
Reduces complexity of the system
Inheritance
When a class derives from another class
• The class that inherits from a based class is called
inheriting class or subclass
Promotes code reuse
• Base class inherits all of the base class operations, unless
overridden
Subclass may define its own implementation
of any of the operations of the base class
Polymorphism
Ability of the inheriting class to change one
or more behaviors of its base class
• This allows the derived class to share the
functionality of the base class
Interface
An abstract class that contains methods
without implementations
• Defines the rules for method signature and return type
• Implementation is deferred to the class the implements
the interface
Enforces rules to one or more classes that
implement the interface
Object-oriented Programming
Classes and
Objects
Access
Modifiers
Member Fields
and Properties
Methods
Inheritance Polymorphism Interface
Access Modifiers
public
• The type or member can be accessed by any other code in
the same assembly or another assembly that references it.
private
• The type or member can only be accessed by code in the
same class.
protected
• The type or member can only be accessed by code in the
same class or in a derived class.
internal
• The type or member can be accessed by any code in the
same assembly, but not from another assembly.
protected internal
• The type or member can be accessed by any code in the
same assembly, or by any derived class in another assembly
Source: http://msdn.microsoft.com/en-
us/library/dd460654.aspx#Interfaces
Classes and Objects
A class describes the object
An object in an instance of a class
• An object is instantiated through the
constructor of the class
public class Customer
{
public Customer() {}
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public Customer Add()
{
return ….
}
}
Customer customer = new Customer()
Member Fields and Properties
Local variables that must be private to the class
• Holds the data of the class
External access to the fields are usually
provided through public Properties
public class Customer
{
private int id;
private string firstName;
private string lastName;
public int Id {
get { return id; }
set { id = value; }
}
public string FirstName { … }
public string LastName { … }
}
Customer customer = new Customer()
customer.FirstName = “Allan Spartacus”
Methods
Defines the behaviors of the class
May or may not return a type
• void – no return type
Can be overloaded
• The signature of each method must be
unique
public class Customer
{
…
public Customer Add () { … }
public Customer Add(Customer customer){ … }
public Customer Edit () { … }
public bool Delete(int id) { … }
private void ConcatName(){ … }
}
Customer customer = new Customer()
customer.Add();
customer.ConcatName();
Inheritance
Enables a new class to reuse, extend and
change the behavior of a base class.
• All classes written in C# implicitly inherits from
System.Object class
• A C# class can only inherit from a single base class
public class Person {
public int Id { get; set; }
public string FirstName { get; set; }
}
public class Customer : Person {
public string CompanyName { get; set; }
}
public class Employee : Person {
public string EmployeeNumber { get; set; }
}
Employee employee = new Employee();
employee.Id = 1;
employee.FirstName = “Allan Spartacus”;
employee.EmployeeNumber = “GF4532”;
Sealed Class
To prevent a class from inheriting
from, define it as a sealed class
public sealed class Vendor : Person {
public string CompanyName { get; set; }
}
public class InternationaVendor : Vendor {
}
Abstract Class
When a class is intended as a base class that
cannot be instantiated, define it as abstract class
• Multiple derived classes can share the definition of an
abstract class
An abstract class can be used as interface by
defining abstract methods
• Abstract methods do not have implementation code
• Implementation code is defined in the derived class
public abstract class Manufacturer {}
Manufacturer manufacturer = new Manufacturer()
public abstract class Item {
public abstract void Add();
}
public class Product : Item {
public override void Add() {
….
}
}
public class Service : Item {
public override void Add() {
….
}
}
Interface
A collection of functionalities that can be implemented by
a class or struct
While a class is limited to inherit from a single base class, it
can implement multiple interfaces
A class that implements an interface must define methods
that have similar signatures defined in the interface
interface class IItem {
void Add();
}
public abstract class Product : IItem {
public void Add() {
….
}
}
public class Service : IItem {
public void Add() {
….
}
}
References
Object-oriented analysis -http://www.umsl.edu/~sauterv/analysis/488_f01_papers/wang.htm
http://en.wikipedia.org/wiki/Use_cases
Object-oriented design - http://en.wikipedia.org/wiki/Object-oriented_design
Object - http://en.wikipedia.org/wiki/Object-oriented_programming
Encapsulation and data hiding - http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)
Polymorphism - http://en.wikipedia.org/wiki/Object-oriented_programming
Interface - http://en.wikipedia.org/wiki/Object-oriented_programming
Inheritance - http://en.wikipedia.org/wiki/Object-oriented_programming
Copyright (C) 2014. Allan Spartacus Mangune
This work is licensed under a Creative Commons Attribution-
NonCommercial-ShareAlike 4.0 International License.
License URL: http://creativecommons.org/licenses/by-nc-
sa/4.0/

More Related Content

PDF
Agile Tools
PDF
Crafting high quality code
PDF
Agile methodologies
PDF
Software design with Domain-driven design
PPTX
Testing, a pragmatic approach
PPT
Unit 5 testing -software quality assurance
PPTX
Fundamentals of Software Engineering
PPTX
Fundamentals of Software Engineering
Agile Tools
Crafting high quality code
Agile methodologies
Software design with Domain-driven design
Testing, a pragmatic approach
Unit 5 testing -software quality assurance
Fundamentals of Software Engineering
Fundamentals of Software Engineering

What's hot (16)

PPTX
Skillwise Integration Testing
PPT
Keyword Driven Testing using TestComplete
PPTX
Unit testing and mocking in Python - PyCon 2018 - Kenya
PPTX
Power-Up Your Test Suite with OLE Automation by Joshua Russell
PPT
Paper Ps
PPT
upload ppt by browse button
PPT
Justin Presentation PPT Upload
PPT
Paper CS
PPT
alka ppt upload no code change
PPT
Paper Ps
PPT
alkatest7
PPT
Paper Ps
PPT
justin presentation upload PPT june 19
PPT
justin presentation slideshare1
PPT
justin presentation upload PPT june 25 ADVANCED
PDF
How to Build Your Own Test Automation Framework?
Skillwise Integration Testing
Keyword Driven Testing using TestComplete
Unit testing and mocking in Python - PyCon 2018 - Kenya
Power-Up Your Test Suite with OLE Automation by Joshua Russell
Paper Ps
upload ppt by browse button
Justin Presentation PPT Upload
Paper CS
alka ppt upload no code change
Paper Ps
alkatest7
Paper Ps
justin presentation upload PPT june 19
justin presentation slideshare1
justin presentation upload PPT june 25 ADVANCED
How to Build Your Own Test Automation Framework?
Ad

Viewers also liked (20)

PPTX
Structured Vs, Object Oriented Analysis and Design
PPT
Object Oriented Analysis and Design
PPT
Dice Game Case Study 11 30 6
PPT
Rosinesita
PPT
Inventions: The computer
PPTX
US in the Middle East Part 2
PDF
Donald Wilhite, University of Lincoln: Integrated national drought management
PPT
A global picture of drought occurrence, magnitude, and preparedness
PPT
On The Day the Last Nuclear Weapon is Destroyed
PPT
Chapter7
PPT
1948 Arab–Israeli
PDF
Report on HISTORY OF MONEY IN CHINA
PPTX
Topic.09 The Civil Rights Movement
PPTX
D3 (drought management and risk reduction in pakistan) brig. kamran shariff
PPT
Chapter9
PPTX
PPTX
Topic 1 intro power and ideas
PDF
Javascript for php developer
PPT
Israeli-Palestinian Conflict
PPTX
“Digital democracy” helen milner digital leaders annual lecture 24 february 2015
Structured Vs, Object Oriented Analysis and Design
Object Oriented Analysis and Design
Dice Game Case Study 11 30 6
Rosinesita
Inventions: The computer
US in the Middle East Part 2
Donald Wilhite, University of Lincoln: Integrated national drought management
A global picture of drought occurrence, magnitude, and preparedness
On The Day the Last Nuclear Weapon is Destroyed
Chapter7
1948 Arab–Israeli
Report on HISTORY OF MONEY IN CHINA
Topic.09 The Civil Rights Movement
D3 (drought management and risk reduction in pakistan) brig. kamran shariff
Chapter9
Topic 1 intro power and ideas
Javascript for php developer
Israeli-Palestinian Conflict
“Digital democracy” helen milner digital leaders annual lecture 24 february 2015
Ad

Similar to Object-oriented Analysis, Design & Programming (20)

PPTX
VB.net&OOP.pptx
PPTX
Better Understanding OOP using C#
PPTX
Introduction to Design Patterns in Javascript
PPTX
C# classes objects
PPT
Core Java unit no. 1 object and class ppt
PPT
Core Java unit no. 1 object and class ppt
PPTX
ECAP444 - OBJECT ORIENTED PROGRAMMING USING C++.pptx
PPT
Design Patterns
PPT
Object Oriented Programming In .Net
PPTX
PPTX
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
PPT
PHP - Introduction to Object Oriented Programming with PHP
PPT
C++ Programming Course
PPT
Ccourse 140618093931-phpapp02
PPTX
UNIT IV DESIGN PATTERNS.pptx
PPTX
03 classes interfaces_principlesofoop
PPTX
OOPS – General Understanding in .NET
PPTX
Java chapter 5
PPTX
Software enginnnering introduction (2).pptx
VB.net&OOP.pptx
Better Understanding OOP using C#
Introduction to Design Patterns in Javascript
C# classes objects
Core Java unit no. 1 object and class ppt
Core Java unit no. 1 object and class ppt
ECAP444 - OBJECT ORIENTED PROGRAMMING USING C++.pptx
Design Patterns
Object Oriented Programming In .Net
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
PHP - Introduction to Object Oriented Programming with PHP
C++ Programming Course
Ccourse 140618093931-phpapp02
UNIT IV DESIGN PATTERNS.pptx
03 classes interfaces_principlesofoop
OOPS – General Understanding in .NET
Java chapter 5
Software enginnnering introduction (2).pptx

More from Allan Mangune (6)

PDF
From the Trenches: Effectively Scaling Your Cloud Infrastructure and Optimizi...
PPTX
DDD and CQRS for .NET Developers
PDF
Configuring SQL Server Reporting Services for ASP.NET Running on Azure Web Role
PDF
Developing Software As A Service App with Python & Django
PDF
Agile planning and iterations with Scrum using Team Foundation Server 2013
PPTX
Game Development with Windows Phone 7
From the Trenches: Effectively Scaling Your Cloud Infrastructure and Optimizi...
DDD and CQRS for .NET Developers
Configuring SQL Server Reporting Services for ASP.NET Running on Azure Web Role
Developing Software As A Service App with Python & Django
Agile planning and iterations with Scrum using Team Foundation Server 2013
Game Development with Windows Phone 7

Recently uploaded (20)

PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPT
Introduction Database Management System for Course Database
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
System and Network Administraation Chapter 3
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Transform Your Business with a Software ERP System
PDF
medical staffing services at VALiNTRY
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Nekopoi APK 2025 free lastest update
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
history of c programming in notes for students .pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Introduction Database Management System for Course Database
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Understanding Forklifts - TECH EHS Solution
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
System and Network Administraation Chapter 3
CHAPTER 2 - PM Management and IT Context
Softaken Excel to vCard Converter Software.pdf
Transform Your Business with a Software ERP System
medical staffing services at VALiNTRY
wealthsignaloriginal-com-DS-text-... (1).pdf
Operating system designcfffgfgggggggvggggggggg
Wondershare Filmora 15 Crack With Activation Key [2025
Nekopoi APK 2025 free lastest update
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PTS Company Brochure 2025 (1).pdf.......
history of c programming in notes for students .pptx

Object-oriented Analysis, Design & Programming

  • 1. Object-oriented Analysis, Design & Programming Allan Spartacus Mangune
  • 2. Delivery • Lectures – 2.5 hours • 2 case studies and exercises – 30 minutes each
  • 4. Object-oriented Analysis Best done in iterative and incremental approach • Refine as you learn more about the system and implementation constraints Develop the models of the system based on functional requirements • Does factor implementation constraints of the system into the model Organize requirement items around objects that interact with one another • Requirement items are mapped to the real things of the system • Each item may be defined as object with data and behavior
  • 5. Process Model the system of its intended use taking into account the description and behavior of each object • Emphasize on what the system does Define how objects interact with one another Commonly used process tools • Use case • Conceptual models (also referred to Domain Models)
  • 6. Use Case Source: http://en.wikipedia.org/wiki/File:Use_case_restaurant _model.svg A sequence of related actions to accomplish a specific goal Each role in the system is represented as actor The actor can be a human or other systems • Identify the main task of each actor • Read • Write/Update • Notification of effects of action taken on internal and/or external system
  • 7. Conceptual Models Abstract ideas in problem domain Describes the each object of the system, its behavior and how objects interact with one another • Attributes, behaviors and constraints Use this model to build the vocabulary of concepts and validate your understanding of problem domain with domain experts • Defer encapsulation details to the design phase Source: http://en.wikipedia.org/wiki/File:Domain_model.png
  • 9. Starting the Design Phase Can be started in parallel with analysis phase • Incremental approach is preferred Use the artifacts in analysis phase as inputs • Use case models • Conceptual models
  • 10. Key Concepts of Object-oriented Design Objects and Classes Encapsulation and Information Hiding Inheritance Polymorphism Interface
  • 11. Objects The most basic elements in object-oriented design An object represents a real entity with attributes and behaviors • Has a unique identity in the system Objects interactions • Interface is defined to describe all the actions an object must perform
  • 12. Class Represents the blue-print of an object • An object that is created based on a class is called an instance of that class Contains attributes, data and behaviors that act on the data Defines the initial state of data May contain interface that defines how the class interact with the other parts of the system • For this purpose, an interface is a set of methods and properties exposed through public access modifier
  • 13. Encapsulation and Information Hiding The internals of an object is hidden • Restricting access to its data Prevents external code from setting the data in invalid state Access to the data can be provided indirectly through public properties and methods Reduces complexity of the system
  • 14. Inheritance When a class derives from another class • The class that inherits from a based class is called inheriting class or subclass Promotes code reuse • Base class inherits all of the base class operations, unless overridden Subclass may define its own implementation of any of the operations of the base class
  • 15. Polymorphism Ability of the inheriting class to change one or more behaviors of its base class • This allows the derived class to share the functionality of the base class
  • 16. Interface An abstract class that contains methods without implementations • Defines the rules for method signature and return type • Implementation is deferred to the class the implements the interface Enforces rules to one or more classes that implement the interface
  • 17. Object-oriented Programming Classes and Objects Access Modifiers Member Fields and Properties Methods Inheritance Polymorphism Interface
  • 18. Access Modifiers public • The type or member can be accessed by any other code in the same assembly or another assembly that references it. private • The type or member can only be accessed by code in the same class. protected • The type or member can only be accessed by code in the same class or in a derived class. internal • The type or member can be accessed by any code in the same assembly, but not from another assembly. protected internal • The type or member can be accessed by any code in the same assembly, or by any derived class in another assembly Source: http://msdn.microsoft.com/en- us/library/dd460654.aspx#Interfaces
  • 19. Classes and Objects A class describes the object An object in an instance of a class • An object is instantiated through the constructor of the class public class Customer { public Customer() {} public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public Customer Add() { return …. } } Customer customer = new Customer()
  • 20. Member Fields and Properties Local variables that must be private to the class • Holds the data of the class External access to the fields are usually provided through public Properties public class Customer { private int id; private string firstName; private string lastName; public int Id { get { return id; } set { id = value; } } public string FirstName { … } public string LastName { … } } Customer customer = new Customer() customer.FirstName = “Allan Spartacus”
  • 21. Methods Defines the behaviors of the class May or may not return a type • void – no return type Can be overloaded • The signature of each method must be unique public class Customer { … public Customer Add () { … } public Customer Add(Customer customer){ … } public Customer Edit () { … } public bool Delete(int id) { … } private void ConcatName(){ … } } Customer customer = new Customer() customer.Add(); customer.ConcatName();
  • 22. Inheritance Enables a new class to reuse, extend and change the behavior of a base class. • All classes written in C# implicitly inherits from System.Object class • A C# class can only inherit from a single base class public class Person { public int Id { get; set; } public string FirstName { get; set; } } public class Customer : Person { public string CompanyName { get; set; } } public class Employee : Person { public string EmployeeNumber { get; set; } } Employee employee = new Employee(); employee.Id = 1; employee.FirstName = “Allan Spartacus”; employee.EmployeeNumber = “GF4532”;
  • 23. Sealed Class To prevent a class from inheriting from, define it as a sealed class public sealed class Vendor : Person { public string CompanyName { get; set; } } public class InternationaVendor : Vendor { }
  • 24. Abstract Class When a class is intended as a base class that cannot be instantiated, define it as abstract class • Multiple derived classes can share the definition of an abstract class An abstract class can be used as interface by defining abstract methods • Abstract methods do not have implementation code • Implementation code is defined in the derived class public abstract class Manufacturer {} Manufacturer manufacturer = new Manufacturer() public abstract class Item { public abstract void Add(); } public class Product : Item { public override void Add() { …. } } public class Service : Item { public override void Add() { …. } }
  • 25. Interface A collection of functionalities that can be implemented by a class or struct While a class is limited to inherit from a single base class, it can implement multiple interfaces A class that implements an interface must define methods that have similar signatures defined in the interface interface class IItem { void Add(); } public abstract class Product : IItem { public void Add() { …. } } public class Service : IItem { public void Add() { …. } }
  • 26. References Object-oriented analysis -http://www.umsl.edu/~sauterv/analysis/488_f01_papers/wang.htm http://en.wikipedia.org/wiki/Use_cases Object-oriented design - http://en.wikipedia.org/wiki/Object-oriented_design Object - http://en.wikipedia.org/wiki/Object-oriented_programming Encapsulation and data hiding - http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming) Polymorphism - http://en.wikipedia.org/wiki/Object-oriented_programming Interface - http://en.wikipedia.org/wiki/Object-oriented_programming Inheritance - http://en.wikipedia.org/wiki/Object-oriented_programming
  • 27. Copyright (C) 2014. Allan Spartacus Mangune This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. License URL: http://creativecommons.org/licenses/by-nc- sa/4.0/