Saturday, October 15, 2022

Fundamentals of Object Oriented Analysis and Design - Complexity - Part 01

 The following are the notes from Object Oriented Analysis and Design 3rd edition. 

Why software is inherently complex?

Reason

Description

Complexity of the problem domain

 

Software systems are inherently complex, non- functional requirements such as performance, communication gap between domain experts and software developers.

Management of software development

 

Geographically dispersed teams, millions of lines of code

Flexibility available through software

Everything can be built from scratch

Discreate systems

Computer is finite state machine. An unexpected input can lead system to an unexpected state.

 

Attributes of complex software

Attribute

Description

Hierarchical structure

Consists of sub systems that in turn can be decomposed to further.

Relative primitives

 

The manageable primitive from decompose is arbitrary and relative to user

Separation of concerns

 

High frequency Intra component dynamics and low frequency Inter component dynamics leads to separation of concerns

Common patterns

All complex systems exhibit common patterns leading to reuse

Stable intermediate forms

 

Complex systems are built layer by layer. High level abstractions become primitives that become base for new high-level abstractions.

 

Canonical form of complex system

Software systems can be organized in two hierarchical, orthogonal views - Part of and Is of.

Part of hierarchy is called object structure. Example, human body can be decomposed into different organs - brain, heart, liver, kidney etc.

Is of  hierarchy is called class structure. Example, DNA of every cell is same across human body; Upon which specialized cells such as neurons, renal cells etc. are built to provide different functionality.


Combining class structure with object structure along with 5 attributes of complex system leads to canonical form.

The Role of Decomposition

The world is viewed as autonomous agents that collaborate to perform higher level behavior. Each object embodies its own unique behavior and models some object in the real world. 

As the decomposition is based on objects, it’s called object-oriented decomposition.


The principle of object-oriented analysis views software as a set of collaborating objects where each object is an instance of a class in the hierarchy of classes.

Object oriented decomposition
  • Helps organize software complexity as done in nature
  • Yield smaller software through reuse of common mechanisms
  • Yield stable systems and reduces risk as they are based stable intermediate forms
  • Make intelligent decisions on separation of concerns thus reducing overall complexity in a large state space
  

The Role of Abstraction

As limited processing of human brain a complex system can be viewed at different levels of abstractions. For example, in an internal combustion engine, fuel injection mechanism can be studied for torque generation leaving power transfer mechanism alone.

The Role of Hierarchy

Software systems can be grouped based on the basis of class structure and object structure.
Object structure illustrates how different objects collaborate with one another through pattern of interaction called mechanisms.

Class structures highlights common structures and behavior in the system. Even though an individual object can be viewed distinctly, yet it shares same behavior as other instances of similar kind of objects. For example, while studying anatomy of healthy heart in humans, study of one individual should be sufficient as it’d be same in all humans.

By classifying objects into groups of related abstractions, it helps to identify their common and distinct behaviors helping us to master inherent complexity. For example, cells of different human organs such as brain, liver, kidney etc.

Identifying hierarchy of objects within a complex system is not trivial as it requires discovery of pattern amongst objects that may observe complicated behavior. Once exposed, understanding the structure of the complex system becomes simple.

The meaning of design

The purpose of software design is to convert requirements into an implementation that conforms to the functional requirements, non-functional requirements such as performance, implicit/explicit design criteria. The purpose of design is to create a simple internal structure also known as architecture. The result of design are models that can be modified and provide blueprint for implementation.

The Importance of Model Building

Object oriented decomposition involves building models that focuses on things in the problem domain. Object oriented analysis and design leads to object-oriented decomposition.

  • Model building appeals to the principles of decomposition, abstraction and hierarchy. 
  • Each model within the design describes an aspect of the system under consideration.
  • New models are built on old models upon which confidence is built.
  • Models are evaluated against happy path and unexpected conditions. They are altered till they behave correctly under all conditions.
  • To correctly describe all the subtleties of a complex system, more than one model is needed.

The process of software design process is an incremental and iterative process. Object oriented design uses notation and process to build complex models.

Notations

Language for expressing models

Process

Activities leading to model creation

Tools

Artefacts that eliminate tedium of model building


Summary

  • Software is inherently complex; the complexity of software systems often exceeds the human intellectual capacity.
  • The task of the software development team is to engineer the illusion of simplicity.
  • Complexity often takes the form of a hierarchy; it is useful to model both the “is a” and the “part of” hierarchies of a complex system.
  • Complex systems generally evolve from stable intermediate forms.
  • There are fundamental limiting factors of human cognition; we can address these constraints through the use of decomposition, abstraction, and hierarchy.
  • Complex systems can be viewed by focusing on either things or processes; there are compelling reasons for applying object-oriented decomposition, in which we view the world as a meaningful collection of objects that collaborate to achieve some higher-level behavior.
  • Object-oriented analysis and design is the method that leads us to an object oriented decomposition; object-oriented design uses a notation and process for constructing complex software systems and offers a rich set of models with which we may reason about different aspects of the system under consideration.

No comments:

Post a Comment