Three years of work, special support for program understanding, three years of process understanding

Source: Internet
Author: User

Three years of work, special support for program understanding, three years of process understanding

I am an ordinary programmer who struggles to work in humdu. I carry my dreams and lofty aspirations. To realize my ideals, I need to constantly improve myself and strengthen myself.

After three years of work, I have developed the habit of taking notes since I went to school. This also makes some summative records in my development process, but my ideas have not been verified, so today I came with questions.

I have some personal opinions and ideas on some aspects of development, which are neither advanced nor new. I just want to verify the correctness of my ideas so that I can correct them in the future.

 

Here is my personal opinion. I want to prove its correctness and give some advice to laruence!

Thinking 1: Changing

It can be encapsulation, inheritance, polymorphism, Ioc/DI, AOP, SOA, including abstract classes and interfaces, they all want to solve the same problem from different levels, such as the Code layer and architecture layer, through their respective "tricks and tricks,

Achieve the same purpose:High Cohesion, low coupling, scalability, maintainability, and stability...... We have been fighting around a point for N years. For a point, we encapsulate inherited polymorphism, abstract class interface, and cut-line programming can be seen as implementing this point from the code layer,

Similar to DI, SOA can be seen as achieving this goal from the architecture layer.

 

Thinking 2: understanding of abstract classes,An abstract class is an abstraction of the specific behavior of an object.

What is an abstract class? The answer is actually very vague. Basically, many people give an overview of the characteristics, keywords, and syntax of abstract classes in their answers or textbooks. The answer is comprehensive but not specific, clear, and concise.

According to the actual development experience:An abstract class is an abstraction of the specific behavior of an object.

This should be elaborated in combination with classes and objects. Classes are the abstraction of objects, objects are concrete instances of classes, and abstract classes are the abstraction of object behaviors (specific methods). So abstract classes are for methods, abstract classes are an abstraction of methods. They contain unimplemented methods (abstract methods ),

The role is: the embodiment of polymorphism and scalability. We often extract the public part of some behaviors (methods) into abstract classes or interfaces to achieve subsequent extension and implementation of this method, for example, PG (excellent spirit Bao can dream) captures this behavior, and we abstract the methods to grasp it.

We don't care about what to grasp. Many of the following will implement it directly when we need this.

Class = object abstraction

Abstract class = abstraction of object behavior

 

Thinking 3: Relationship between control reversal and dependency Injection

For the relationship between Ioc and DI, I think Ioc is an idea and a design principle. DI is one of the specific implementation methods for Ioc.

 

The above is part of my opinion, and we still need to prove it when sharing it with you.

Birds should not blindly agree with others' unauthenticated opinions, and birds should not laugh at the ignorance of birds. In this era of openness and sharing, all developers need to explore and make progress together.

 

Related Article

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.