Basic OOAD concepts

Source: Internet
Author: User

 

Objective:

1. Understand and master the object-oriented concepts and methods.

2. Use UML.

3. complete object-oriented analysis and design.

4. Understand the OO design principles and some typical design patterns

 

What Is Object-Oriented?

  1. Object-orientation (OO) is a system modeling technology.
  2. Object-Oriented Programming (OOP) is a process of developing programs according to the OO methodology.
  3. Describes or models A system by analyzing the interaction of objects in the system.
  4. The interaction objects are finally organized in the form of classes.
  5. The OO method consists of three parts: process, identifier, and rule.

 

Object

  1. It is an objective and unique entity.
  2. It is the starting point and basis for analyzing and solving problems in the process of object-oriented programming.
  3. Has its own identity, data, and behavior.
  4. It can be simple or complex.
  5. Can be abstract or specific.
  6. In Oop, it is a dynamic instance of a class.
  7. For example, student-ID, name, age (attribute)

-- Setname, getname, countscore (methods)

-- New student ()

 

Class

  1. Class is the object template.
  2. Objects are generated by class instantiation.
  3. One class can create multiple objects
 
   

 

 

OOAD

OOAD (Object Oriented Analysis and Design), object-oriented analysis and design.

OOAD is a process of analyzing and designing software systems based on OO methodology.

-- OOA
Analysis Phase

-- OOD
Design Phase

 

DefinitionOOAPhase

  1. The analysis phase mainly solves the following problems:

-- Create a clear view of business problem domains.

-- List the core tasks that must be completed by the system.

-- Create a public vocabulary for the problem domain.

-- List the best solutions for this problem.

2. What
Do ?"

 

DefinitionOODPhase

1. the design phase mainly solves the following problems:

--
How to solve specific business problems.

--
Introduce the supporting elements required for system work.

--
Define system implementation policies

2. How
Do ?"

 

OOPMain features

1. Abstract)

2. Encapsulation)

3. Inheritance)

4. polymorphism (polymorphism)

5. Association)

6. Aggregation)

7. Composition)

8. Cohesion and coupling (cohesion &
Coupling)

 

Abstraction

  1. Ignore the details of an object or entity and focus only on its essential features.
  2. Simplified functions and formats.
  3. Helps users interact with objects.

 

Encapsulation

  1. Hide data and implementations.
  2. Provides public methods for users to call.
  3. Two views of an object.

-- External view: the work that an object can do.

-- Internal view: How the object completes its work.

 

Inheritance

  1. Define a New Type through an existing type.
  2. There is usually a relationship like "is a" or "kind of" between two types.
  3. Code can be reused through inheritance, and inheritance is also the basis of polymorphism.

For example, Apple "is a" fruit.

 

Polymorphism

  1. A name in multiple forms.
  2. Inheritance-based Polymorphism
  3. When calling a method, select a different processing method based on the given object.
  4. For example, football-Play (): complete with a script.

Basketball-Play (): complete by hand.

5. Give a specific football or basketball. The user automatically knows who to use to execute play ().

 

Association

  1. A reference method for interaction between objects.
  2. When an object uses the service or operation of another object through the reference of another object, the two objects are associated.
  3. For example, if a person uses a computer, there is an association between the person and the computer.

 

Aggregation

  1. An association. An object is an integral part of another object.
  2. Is a strongly correlated relationship.
  3. There is a relationship like "has a" between two objects. An object exists as an attribute of another object. When an external object is produced, the internal object associated with it can be specified by the client.
  4. For example, an automobile and a tire are an integral part of an automobile. They can be assembled and used after production respectively, but the automobile can be replaced with a new tire and can be unloaded for use by other cars.

 

Combination

  1. When an object contains another object, the external object is responsible for managing the lifecycle of the internal object.
  2. The most intense Association.
  3. Internal creation is controlled by external objects.
  4. Such as televisions and monitors.

 

Domain Model

  1. The domain model is object-oriented. In object-oriented terms, a domain model can also be called a design model. The domain model consists of the following:

-- Domain objects with statuses and Behaviors

-- Relationship between domain objects.

  • · Association
  • · Dependency
  • · Focus
  • · Generalization)

 

Relationship between domain objects

  • · Association)
  • · Dependency)
  • · Aggregation)
  • · Generalization)

 

Association

 

Customer
<---------------------- Order [Customer: Customer]

Multi-to-one association from order to customer

 

Customer [Orders: Set] ----------------- à order

One-to-multiple unidirectional Association from customer to order

 

Customer [Orders: Set] orders ------------ à order [Customer: Customer]

One-to-multiple bidirectional Association from customer to order

 

Dependency

 

BusinessService --------- à customer

BusinessService class depends on customer class

The method used to access the customer class in the businessService class,
Create a customer instance.

 

Clustering relationship

Clustering refers to the relationship between the whole and the part, which is common among object domain objects.

 

Person {set

Aggregation relationship between the person class and the hand class

 

General Relationship

General relationships refer to the inheritance relationships between classes.

 

Cohesion and Coupling

  1. Cohesion: measure the ability of a class to complete a job independently.
  2. Coupling: measure the complexity of dependencies within or between systems.
  3. Design Principle: increase cohesion and reduce coupling (High Cohesion and low coupling ).

 

Development Process Overview

1. Traditional development process-Waterfall Model

2. Unified Software Development Process (usdp)

 

Traditional development process (Waterfall Model)

Requirements à analysis à design à implementation à Test

 

OOADDevelopment Process

  1. Major projects are divided into subprojects.
  2. Use UML tools
  3. Unified Software development is an iterative and incremental development process.

 

Iterative and incremental project lifecycle

  1. Projects are iterative and incremental.
  2. Iteration refers to a step in the lifecycle.
  3. Iteration leads to "increasing" or the growth of the entire project.
  4. Major projects are divided into subprojects.
  5. In each iteration stage, we should do the following:

-- Select and analyze related Use Cases

-- Design Based on the selected Architecture

-- Design at the component level

-- Verify that the component meets the needs of the use case

6. When an iteration meets the target, the development enters the next iteration cycle.

Inception-start up

Elaboration-refine

Construction-Implement

Transition -- Promotion

7. Each cycle contains one or more iterations.

8. The end of a stage is called "Milestone" (milestone)

 

Initialization phase

The increment of this phase is concentrated in:

-- Start the project

-- Establish business

-- Define business problem domains

-- Identify major risk factors

-- Define the extension of project requirements

-- Create instructions for business problem domains

 

Refinement stage

-- High-level Analysis and Design

-- Establish the basic framework of the Project

-- Main risk factors of Supervision

-- Formulate a creation plan to achieve the project objectives

 

Build phase

The increment in this phase is concentrated in

-- Code and function implementation

 

Handover phase

The increment in this phase is concentrated in

-- Publish a product to a user

-- Beta test

-- Perform performance tuning, user training, and Acceptance Testing

 

Workflow contained in each stage

· Each increment is composed of five workflows.

-- Requirement and initial analysis

-- Analysis

-- Design

-- Implementation

-- Test

-- The depth of the workflow executed in each iteration is different.

-- Early iterations cover the initial workflow in depth, while later iterations cover the later workflow in depth.

-- 80/20 Principle

 

Advantages of iteration and incremental Lifecycle

· Reduce costs

· Easy to maintain the project progress

· Facilitates collaborative development by teams

· To adapt to the dynamic changes of user needs

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.