Object Oriented Paradigm - ilya-khadykin/notes-outdated GitHub Wiki

TO DO:

Interconnected topics:

  • Object-Oriented Analysis: what is the problem
  • Object-Oriented Design: how we are going to solve it
  • Object-Oriented Programming: implementation of designed solution in one of programming languages

Objects

An object has:

  • identity (name)
  • attributes (data)
  • behavior

Classes

Class is a blueprint of an object

Object is a noun

Class describes attributes and behavior of an object. So, every Class has:

  • name (type)
  • attributes (properties, data)
  • behavior (operations, methods)

Creating a object is an instantiation

Abstraction

  • focus on the essentials
  • ignore the irrelevant
  • ignore the unimportant

Encapsulation

  • data hiding
  • "black boxing"
  • reducing dependencies inside your application

Inheritance

  • code reuse

Superclass (parent class), subclass (child class)

Multiple and single inheritance

Polymorphism

"Many forms"

  • overriding methods of Superclass in subclasses

Object-Oriented Analysis and Design

There are the following steps in designing the system:

  1. Gather Requirements
  2. Describe the app
  • use case
  • user story
  1. Identify the main and most important objects
  2. Describe the Interactions between the objects
  3. Create a Class Diagram

Gather Requirements | Requirement Analysis

  • Functional Requirements: what does it do?
    Features / Capabilies
  • Non-functional Requirements: what else?
    Documentation / Help / Legal / Performance / Support / Security

System must ...

Application must ...

FURPS / FURPS+

  • Functional requirements
  • Usability requirements
  • Reliability requirements
  • Performance requirements
  • Supportability requirements
    • Design requirement
    • Implementation requirement
    • Interface requirement
    • Physical requirement

Describing the system

Use Case

  • Title: what is the goal? (Register new member, Transfer funds, Create new page)
  • Actor: who desires it? (User, Customer, Member, Administrator, ACMESystem)
  • Scenario: how is it accomplished? (A paragraph describing the scenario in detail)

Example:

Title: Purchase items
Actor: Customer

Scenario: Customer reviews items in shopping cart. Customer provides payment and shipping information. System validates payment information and responds with conformation of order and provides order number that Customer can use to check on order status. System will send Customer a conformation of order details and tracking number in an email.

Prompt questions:

  • Who performs a system administration?
  • Who manages system and security?
  • What happens if the system fails?
  • Is anyone looking at performance metrics or logs?

Use Case Diagram

User Story

As a ... (type of user)

I want ... (goal)

so that ... (reason or benefit)

Use Cases vs User Stories

User Stories Use Cases
short - one index card long - a document
one goal, no details multiple goals and details
informal casual to (very) formal
"placeholder for conversation" "record of conversation"

UML | Unified Modeling Language

UML is used to show internal structure of the system

References

⚠️ **GitHub.com Fallback** ⚠️