SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
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/

Weitere ähnliche Inhalte

Was ist angesagt?

Skillwise Integration Testing
Skillwise Integration TestingSkillwise Integration Testing
Skillwise Integration TestingSkillwise Group
 
Keyword Driven Testing using TestComplete
Keyword Driven Testing using TestCompleteKeyword Driven Testing using TestComplete
Keyword Driven Testing using TestCompletesrivinayak
 
Unit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaUnit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaErick M'bwana
 
Power-Up Your Test Suite with OLE Automation by Joshua Russell
Power-Up Your Test Suite with OLE Automation by Joshua RussellPower-Up Your Test Suite with OLE Automation by Joshua Russell
Power-Up Your Test Suite with OLE Automation by Joshua RussellQA or the Highway
 
upload ppt by browse button
upload ppt by browse buttonupload ppt by browse button
upload ppt by browse buttontechweb08
 
Justin Presentation PPT Upload
Justin Presentation PPT UploadJustin Presentation PPT Upload
Justin Presentation PPT Uploadtechweb08
 
alka ppt upload no code change
alka ppt upload no code changealka ppt upload no code change
alka ppt upload no code changetechweb08
 
justin presentation upload PPT june 19
justin presentation upload PPT june 19justin presentation upload PPT june 19
justin presentation upload PPT june 19techweb08
 
justin presentation slideshare1
justin presentation slideshare1justin presentation slideshare1
justin presentation slideshare1techweb08
 
justin presentation upload PPT june 25 ADVANCED
justin presentation upload PPT june 25 ADVANCEDjustin presentation upload PPT june 25 ADVANCED
justin presentation upload PPT june 25 ADVANCEDtechweb08
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?Dmitry Buzdin
 

Was ist angesagt? (16)

Skillwise Integration Testing
Skillwise Integration TestingSkillwise Integration Testing
Skillwise Integration Testing
 
Keyword Driven Testing using TestComplete
Keyword Driven Testing using TestCompleteKeyword Driven Testing using TestComplete
Keyword Driven Testing using TestComplete
 
Unit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaUnit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - Kenya
 
Power-Up Your Test Suite with OLE Automation by Joshua Russell
Power-Up Your Test Suite with OLE Automation by Joshua RussellPower-Up Your Test Suite with OLE Automation by Joshua Russell
Power-Up Your Test Suite with OLE Automation by Joshua Russell
 
Paper Ps
Paper PsPaper Ps
Paper Ps
 
upload ppt by browse button
upload ppt by browse buttonupload ppt by browse button
upload ppt by browse button
 
Justin Presentation PPT Upload
Justin Presentation PPT UploadJustin Presentation PPT Upload
Justin Presentation PPT Upload
 
Paper CS
Paper CSPaper CS
Paper CS
 
alka ppt upload no code change
alka ppt upload no code changealka ppt upload no code change
alka ppt upload no code change
 
Paper Ps
Paper PsPaper Ps
Paper Ps
 
alkatest7
alkatest7alkatest7
alkatest7
 
Paper Ps
Paper PsPaper Ps
Paper Ps
 
justin presentation upload PPT june 19
justin presentation upload PPT june 19justin presentation upload PPT june 19
justin presentation upload PPT june 19
 
justin presentation slideshare1
justin presentation slideshare1justin presentation slideshare1
justin presentation slideshare1
 
justin presentation upload PPT june 25 ADVANCED
justin presentation upload PPT june 25 ADVANCEDjustin presentation upload PPT june 25 ADVANCED
justin presentation upload PPT june 25 ADVANCED
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?
 

Andere mochten auch

Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignMotaz Saad
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignHaitham El-Ghareeb
 
Dice Game Case Study 11 30 6
Dice Game Case Study 11 30 6Dice Game Case Study 11 30 6
Dice Game Case Study 11 30 6Rajesh Kumar
 
Rosinesita
RosinesitaRosinesita
Rosinesitagalcec
 
Inventions: The computer
Inventions: The computerInventions: The computer
Inventions: The computerandreasupertino
 
US in the Middle East Part 2
US in the Middle East Part 2US in the Middle East Part 2
US in the Middle East Part 2skallens
 
Donald Wilhite, University of Lincoln: Integrated national drought management
Donald Wilhite, University of Lincoln: Integrated national drought managementDonald Wilhite, University of Lincoln: Integrated national drought management
Donald Wilhite, University of Lincoln: Integrated national drought managementNAPExpo 2014
 
On The Day the Last Nuclear Weapon is Destroyed
On The Day the Last Nuclear Weapon is DestroyedOn The Day the Last Nuclear Weapon is Destroyed
On The Day the Last Nuclear Weapon is Destroyedkenleybutler
 
1948 Arab–Israeli
1948 Arab–Israeli1948 Arab–Israeli
1948 Arab–Israelijakblack
 
Report on HISTORY OF MONEY IN CHINA
Report on HISTORY OF MONEY IN CHINAReport on HISTORY OF MONEY IN CHINA
Report on HISTORY OF MONEY IN CHINATayyab Farooq
 
Topic.09 The Civil Rights Movement
Topic.09 The Civil Rights MovementTopic.09 The Civil Rights Movement
Topic.09 The Civil Rights Movementmr.meechin
 
D3 (drought management and risk reduction in pakistan) brig. kamran shariff
D3 (drought management and risk reduction in pakistan)  brig. kamran shariffD3 (drought management and risk reduction in pakistan)  brig. kamran shariff
D3 (drought management and risk reduction in pakistan) brig. kamran shariffmuneeb khalid khalid muneeb
 
Topic 1 intro power and ideas
Topic 1 intro power and ideasTopic 1 intro power and ideas
Topic 1 intro power and ideasHafidz Haron
 
Javascript for php developer
Javascript for php developerJavascript for php developer
Javascript for php developerDang Tuan
 
Israeli-Palestinian Conflict
Israeli-Palestinian ConflictIsraeli-Palestinian Conflict
Israeli-Palestinian Conflicttheironegoodson
 
“Digital democracy” helen milner digital leaders annual lecture 24 february 2015
“Digital democracy” helen milner digital leaders annual lecture 24 february 2015“Digital democracy” helen milner digital leaders annual lecture 24 february 2015
“Digital democracy” helen milner digital leaders annual lecture 24 february 2015Helen Milner
 

Andere mochten auch (20)

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

Ähnlich wie Object-oriented Analysis, Design & Programming

Introduction to Design Patterns in Javascript
Introduction to Design Patterns in JavascriptIntroduction to Design Patterns in Javascript
Introduction to Design Patterns in JavascriptSanthosh Kumar Srinivasan
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .NetGreg Sohl
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHPVibrant Technologies & Computers
 
Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02Getachew Ganfur
 
C++ Programming Course
C++ Programming CourseC++ Programming Course
C++ Programming CourseDennis Chang
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxanguraju1
 
03 classes interfaces_principlesofoop
03 classes interfaces_principlesofoop03 classes interfaces_principlesofoop
03 classes interfaces_principlesofoopVladislav Hadzhiyski
 
OOPS – General Understanding in .NET
OOPS – General Understanding in .NETOOPS – General Understanding in .NET
OOPS – General Understanding in .NETSabith Byari
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptRushikeshChikane1
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptRushikeshChikane2
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.Tarunsingh198
 

Ähnlich wie Object-oriented Analysis, Design & Programming (20)

VB.net&OOP.pptx
VB.net&OOP.pptxVB.net&OOP.pptx
VB.net&OOP.pptx
 
Better Understanding OOP using C#
Better Understanding OOP using C#Better Understanding OOP using C#
Better Understanding OOP using C#
 
Introduction to Design Patterns in Javascript
Introduction to Design Patterns in JavascriptIntroduction to Design Patterns in Javascript
Introduction to Design Patterns in Javascript
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHP
 
Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02
 
C++ Programming Course
C++ Programming CourseC++ Programming Course
C++ Programming Course
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
 
03 classes interfaces_principlesofoop
03 classes interfaces_principlesofoop03 classes interfaces_principlesofoop
03 classes interfaces_principlesofoop
 
OOPS – General Understanding in .NET
OOPS – General Understanding in .NETOOPS – General Understanding in .NET
OOPS – General Understanding in .NET
 
Oops
OopsOops
Oops
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.ppt
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.ppt
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
 

Mehr von Allan Mangune

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

Mehr von Allan Mangune (6)

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

Kürzlich hochgeladen

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 

Kürzlich hochgeladen (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

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/