Ooad Basic Concepts

Source: Internet
Author: User

Learning Goals:

1. Understanding and mastering object-oriented concepts and methods.

2. Use UML.

3. Complete object-oriented analysis and design work.

4. Understand OO design principles and some typical design patterns

What is object-oriented?

    1. Object-oriented (Object-orientation, OO) is a system modeling technique.
    2. Object-oriented programming (Object-orientation programming, or OOP) is the process of developing programs according to OO methodology.
    3. Describe or model a system by analyzing the interaction of objects within the system.
    4. Objects that interact are eventually organized in the form of classes.
    5. The OO approach consists of three parts: process, logo, and rule.

Object

    1. is an objective and unique entity.
    2. Is the starting point and foundation of analyzing and solving problems in object-oriented programming process.
    3. have their own identity, data and behavior.
    4. Can be simple or complex.
    5. can be abstract or concrete.
    6. In OOP is a dynamic instance of a class.
    7. such as Student-id,name,age (attribute)

--setname,getname,countscore (methods)

--new Student ()

Class

    1. A class is a template for an object.
    2. object is generated through the instantiation of the class.
    3. A class can create multiple objects

Ooad

OOAD (object Oriented Analysis and design), objects-oriented analyses and designs.

Ooad is the process of analyzing and designing software systems according to OO methodology.

--OOA Analysis Phase

--ood design Phase

definition OOA Stage

    1. The analysis phase mainly addresses the following issues

--Establish a clear view of the business problem domain.

--Lists the core tasks that the system must complete.

--Establish a common glossary for problem domains.

--List the best solution for this issue.

2. The core issue to be addressed at this stage is "what does?"

definition OOD Stage

1. The design phase mainly addresses the following issues

--How to solve specific business problems.

--Introduce the supporting elements required for the system to work.

--Define the implementation strategy of the system

2. The core issue to be addressed at this stage is "How to do?"

OOP The main characteristics

1. Abstraction (abstract)

2. Package (encapsulation)

3. Inheritance (inheritance)

4. Polymorphism (polymorphism)

5. Association (Association)

6. Aggregation (aggregation)

7. Combination (composition)

8. Cohesion and coupling (cohesion & coupling)

Abstract

    1. The process of ignoring the details of an object or entity and focusing only on its essential characteristics.
    2. simplifies functionality and formatting.
    3. Helps users interact with objects.

Packaging

    1. Hide data and implementations.
    2. Provides a public method for the user to invoke functionality.
    3. Two views of the object.

--External view: The work an object can do.

--Interior View: How the object completes its work.

Inherited

    1. A mechanism for defining new types through the types that exist.
    2. There is usually a relationship of "is a" or "kind of" between the two types.
    3. Inheritance enables code reuse, and inheritance is also the basis for polymorphism.

such as: Apple "is a" fruit.

Polymorphic

    1. A name, multiple forms.
    2. Inheritance-based polymorphism
    3. The method is invoked according to the different options of the given object.
    4. such as Football-play (): Use the foot to complete.

Basketball-play (): Use hand to complete.

5. Give a specific football or basketball, the user automatically know who to use the way to perform play ().

Association

    1. A way to refer to objects as they interact with each other.
    2. When an object passes another object's reference to another object's service or operation, an association is generated between the two objects
    3. For example, there is an association between person using Computer,person and computer.

Polymerization

    1. One of the associated relationships in which an object becomes part of another object.
    2. is a strong correlation.
    3. There is a "has a" relationship between two objects, an object that exists as a property of another object, and can be specified by the client as an internal object associated with it when externally produced.
    4. such as automobiles and tires, tires as a part of the car, it and the car can be produced separately after the installation of the use, but the car can be replaced by new tires, tires can also be unloaded for other vehicles to use.

Combination

    1. When an object contains another object, the external object is responsible for managing the life of the internal object for the same period.
    2. One of the strongest associations in the relationship.
    3. Internal creation is controlled by the external object itself.
    4. such as televisions and monitors.

Domain model

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

--domain object with state and behavior

--The relationship between domain objects.

    • • Association
    • • Reliance
    • • Focus
    • • Generalize (generalization)

Relationships between domain objects

    • • Correlation (Association)
    • • Dependency (Dependency)
    • • Focus (Aggregation)
    • • Generalization (generalization)

Association relationship

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

A many-to-one one-way association from order to customer

Customer[orders:set]-----------------Àorder

One-to-many unidirectional association from customer to order

Customer[orders:set]ß------------Àorder[customer:customer]

A one-to-many bidirectional association from customer to order

Dependent relationships

Businessservice---------Àcustomer

The Businessservice class relies on the customer class

Accesses the method of the customer class in the Businessservice class, and constructs a customer instance.

Aggregation relationships

Aggregation refers to the relationship between a whole and a part, which is common between entity domain objects.

person{set< hand> Hands}<--hand

The aggregation relationship between the person class and the hand class

Generalized relationships

Generalized relationships refer to the inheritance relationships between classes

Cohesion and coupling

    1. Cohesion: A measure of the ability of a class to accomplish a task independently.
    2. Coupling: Measures the complexity of dependencies within or between systems.
    3. Design principle: increase cohesion, reduce coupling (cohesion poly, low coupling).

Overview of the development process

1. Traditional development process-waterfall model

2. Unified software Development process (USDP)

Traditional development process (waterfall model)

Requirementsàanalysisàdesignàimplementationàtest

OOAD the development process

    1. Large items are broken down into sub-projects
    2. Using UML Tools
    3. The unified software development process is an iterative, incremental development process.

Iterative, incremental project life cycle

    1. The project is iterative and incremental.
    2. An iteration refers to a step in the life cycle.
    3. Iterations result in an "increment" or an increase in the entire project.
    4. Large items are broken down into sub-projects.
    5. In each iteration phase, the following work should be done

--Select and analyze related use cases

--Design According to the selected architecture

--Implement design at the component level

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

6. When an iteration satisfies 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 phase is called a "milestone" (milestone)

Initialization phase

The increments of this phase are concentrated in:

--Project Launch

--Establish business

--Define the business problem domain

--Identify the major risk factors

--Define the extension of the project requirements

--Create a description document for the business problem domain

Refinement phase

--high-level analysis and design

--building the foundation framework for the project

--monitoring of key risk factors

-Create a plan to achieve the objectives of the project

Build phase

This phase of the increment is focused on

--Implementation of code and functions

Handover phase

This phase of the increment is focused on

--Publishing products to users

--beta Test

--Perform performance tuning, user training and receiving tests

Workflows included in each phase

• Each increment consists of a 5-part workflow

--Demand and initial analysis

--Analysis

--Design

--Achieve

--Test

--The depth of the workflow is different for each iteration of the execution

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

--80/20 Principles

Benefits of iterative, incremental life cycle

• Reduce costs

• Facilitates better maintenance of project progress

• Facilitates collaborative development of the team

• Easy to adapt to dynamic changes in user needs

Ooad Basic Concepts

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.