Java Object-Oriented programming overview

Source: Internet
Author: User

One

01. Software Development Experience Cycle:

    • Software Analytics: Analyzing problem areas to understand customer needs
    • Software Design: Determine the overall structure of the software, the entire software system into a large and small number of subsystems, the design of the specific structure of each subsystem
    • Software Coding: Write program code in a selected programming language to achieve the software blueprint outlined in the design phase
    • Software Testing: Testing the software for specific functions and testing the software's operational performance
    • Software deployment: Install software systems for users to help them use the software correctly
    • Software maintenance: Fix bugs that already exist in the software, modify the appropriate software section when the user needs change (add new features or modify the implementation of existing features)

  In order to improve the efficiency of software development and reduce the cost of software development, an excellent software system should have the following characteristics:

    • Re-usability
    • Scalability
    • Maintainability

Features of the 02.Java language: object-oriented, cross-platform, direct support for distributed network applications, security and robustness; simplicity and efficiency

The scalability (extensiblity) is good .

When the software must add new functions, can be in the existing system structure (the system is composed of multiple subsystems, and the subsystem is composed of more smaller subsystems) based on the convenience of creating a new subsystem, which is called scalability

II. Introduction to structured software development methods

  In the process of structured programming, the main body of the program is a method, the method is the smallest function module, each method is a subsystem with input and output, the input data of the method comes from the method parameters, global variables and constants, the output data of the method includes the method return value, as well as the method parameters of the pointer type. A set of related methods combined into a dozen function modules.

#include <stdio.h>/**Defining Constants*/#define Circle1#define Rectangle2#define Line3/**Draw a circle module*/voidDrawcircle () {...}//omit display Implementation Details/**draw a rectangular module*/voidDrawRectangle () {...}//omit display Implementation Details/**draw a linear module*/voidDrawLine () {...}//omit display Implementation Details/**Select Shape Module*/voidDrawRectangle () {...} intshape; scanf ("%d", &shape);//receive user-entered Shapes    Switch(shape) { CaseCircle:drawshape ();  Break;  CaseRectangle:drawrectangle ();  Break;  CaseLine:drawline ();  Break; default: printf ("The input shape does not exist!" ")    }    }/**Program Entry Method*/voidMain () {selectshape (); }

Disadvantages of structural development:

① from top to bottom to partition software modules by function

The smallest subsystem in ② software system is the method

2. Introduction to Object-oriented software development methods

The software system is regarded as a collection of objects, and the object is the smallest subsystem, and a group of related objects can be combined into more complex subsystems.

Advantages:

① the software system as a collection of objects, closer to the natural way of thinking of humans.

② System Structure stability

③ improve the software maintainability, reusability, scalability

Three, the object model

1. Bottom-up abstraction

2, top-down decomposition

3. UML Visual Modeling Language

4. Rational Rose Visual modeling tool

Iv. core ideas and concepts in object-oriented development

Problem domain, object, attribute, state, behavior, method, implementation

Objects are abstractions of things in the problem domain. Object characteristics:

1. All things are objects

2. Each object is unique

3. Object has properties and behavior

4. Object has Status

5. Objects belong to a class

V. Class, type

A class is an abstraction of a set of objects that have the same properties and behavior. The relationships between classes and classes form the main content of the object model

VI. messages, Services

  Each object has a specific function, and its function is to provide services to other objects, as opposed to other objects. For example, TV features include: Power on, power off, select channels, adjust volume, and play VCD. In order to get the service of the TV, the remote control needs to make a request to the TV to obtain a specific service, the process of making the request is called sending a message

Seven, interface

In the real world, the interface is also an entity, such as a power outlet, a button on a washing machine, and a light switch. In the object-oriented category, the interface is an abstract concept, which refers to all the services provided by the system externally.

In the Java language, interfaces have two meanings:

1, refers to all the services provided by the system to the public, the Declaration of the method of expressing the public type in the object

2, refers to the interface keyword defined by the actual interface, also known as the interface type. It is used to describe all the services provided by the system, and more clearly to separate the implementation details of the system from the interface.

Eight, packaging, transparent

Encapsulation refers to the properties and implementation details of hidden objects.

Two principles:

1. Hide as many things as possible and provide a simple interface to the outside.

2. Hide all attributes.

Nine, abstract

Abstraction is a way of thinking from concrete to abstract, from complex to concise. In the object-oriented development process, the abstract is reflected in the following aspects

1. From the problem domain to the abstraction of the object in the software model

2. Abstraction from object to class

3. Abstraction from subclass to parent class

X. Inheritance, expansion, coverage

There is an inheritance and extension relationship between the parent class and the child class. Subclasses inherit the properties and methods of the parent class, and can also extend the new properties and methods in the subclass, and also override how the methods in the parent class are implemented. Overrides are also specialized terms, meaning that methods in the parent class are re-implemented in the subclass.

Note:

Subclasses can inherit only a subset of the properties and methods of the parent class, and the child class is transparent to the parent class with the properties and methods of the private adornment.

Some of the most popular architecture software in the Java World are:

①j2ee

②struts

③jsf

④spring

Xi. Combination

Composition is an effective means of assembling complex systems with multiple simple subsystems. The personal computer system is a typical combination system. It consists of a host, a keyboard, a mouse, a monitor, and a peripheral printer. The host consists of a processor, memory, one or more hard disks, video cards, network cards, and sound cards.

12, polymorphic, dynamic binding

13. Introduction to UML language

14. Relationships between classes

XV, relevance, dependency, aggregation, generalization, implementation

Association: refers to a particular correspondence between classes, represented by arrows with solid lines in UML

Dependency: Refers to a call relationship between classes

Aggregation: Refers to the relationship between a whole and a part

Generalization: Refers to the inheritance relationship between classes

Implementation: Refers to the relationship between a class and an interface

Summary:

Java Object-Oriented programming overview

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.