20135236 Jia na Experiment II

Source: Internet
Author: User

First, the contents of the experiment

1. Initial mastery of unit testing and TDD

2. understanding and mastering the object-oriented three elements: encapsulation, inheritance, polymorphism

3. Initial Mastery of UML Modeling

4. familiarity with s.o.l.i.d principles

5. Understanding Design Patterns

Second, the experimental process

(i) Initial mastery of unit testing and TDD

Percentile five-point system: If the score is less than -, turn into"inferior lattice"If the score is -with the -between, turn into"Pass"If the score is -with the thebetween, turn into"Medium"If the score is thewith the -between, turn into"Good"If the score is -with the -between, turn into"Excellent"other, turn into"Error"

We found a bug when entering 100 in the boundary condition. We modify the Myutil.java to include the condition of the good judgment with the input 100,

The last code!!!

Tdddemo the next series of files

(ii) Understanding and mastering the object-oriented three elements: encapsulation, inheritance, polymorphism

Abstract the meaning of the word refers to people in the cognitive thinking activities in the object of the appearance of the factors of abandonment and the essence of the extraction of factors. Abstract is a kind of thinking tool that people often use when they know complex things and phenomena, abstract ability of abstract thinking is very important in program design, "refine, simplifying, youbiaojili and seeking the same in different ways" has a great extent to determine the programmer's programming ability.

The three elements of object-oriented (object-oriented) include: encapsulation, inheritance, polymorphism.

Encapsulation actually uses methods to hide the data of the class, controlling the user's modifications to the class and the extent to which the data is accessed, resulting in the benefits of modularity (modularity) and information hiding (information hiding) Interface (interface) is an accurate description of the package

Note that at this point, getinfo only need one, the parameter is the parent class animal, when the method parameter type is the parent class, you can pass in the child class object, as shown in line 8th above. You need to understand and remember that "in Java, when we declare references with a parent class, the polymorphism occurs when the object is generated with a subclass, as shown in line 6th above."

(iii) Preliminary design pattern

(1)s.o.l.i.d principle

Object-oriented three elements are "encapsulation, inheritance, polymorphism", and any object-oriented programming language will support these three elements syntactically.

Of course, these principles are not isolated, but closely linked, followed by one principle and followed by one or more principles, contrary to one of the principles is also likely to violate the other one or more principles. Design patterns are the result of the application of these principles in some specific scenarios. Therefore, the design pattern can be regarded as "framework" and the Ood principle as "norm". In the process of learning the design pattern, we should constantly reflect on it, which embodies the principle of object-oriented design.

(iv) Practice

1 use TDD to design the Complex to implement the plural class .

2. report the time of your PSP (Personal software Process)

Steps

Take

Percentage

Demand analysis

25

10.41%

Design

35

14.58%

Code implementation

120

50%

Test

45

18.75%

Analysis Summary

15

6.25%


Pseudo code
(1),3. implementation to have pseudo-code, product code, test code.

Complex Z = A (real part) +bi (imaginary part);

Add/Subtract: real and real parts +/-imaginary and imaginary parts;

Multiply A=a+bi, B=c+di;

a*b=ac-bd+ (AD+BC) i;

20135236 Jia na Experiment II

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.