Four Inventions-the victory of Object-oriented Thinking

Source: Internet
Author: User
Saying that during the Three Kingdoms period, Cao led millions of troops to attack Dongwu, and the army was stationed in Chibi, Yangtze River. The army and ships were connected together, and the East Wu was destroyed. The whole world was unified, and Cao was happy, during the banquet, Cao had a great deal of poetry and said, "drinking, singing, and life are amazing. ............". The crowd shouted: "a good poem !" As a result, the sub-Fast Life printing craftsman engraved printing, in order to spread the world.



As shown in the sample, Cao felt inappropriate and said, "It is better to say" drink and sing, This is a vulgar word, and it should be changed to "treat wine as a song !", So the Minister ordered the craftsman to come again. The craftsman saw the work of the overnight version in vain and complained about it. You have to follow suit.

 

Once again, I asked Cao to take a look. Cao made a variety of products and thought it was still not good. He said, "Life is really great, it is too straightforward. You should change your questions to make your artistic conception. Therefore, you should change it to" be a song of wine and Life? ............ '!" When the Minister told the craftsman, the craftsman fainted ............!

Unfortunately, the Three Kingdoms live printing has not been invented, so similar things should happen from time to time, if there is live printing. Only four words can be changed, and the rest of the work is not done in white. It's amazing.

First, you only need to change the word.MaintenanceSecond, these words are not useless this time and can be reused in later printing.ReusableThird, if you want to add a word to this poem, you only need to add another lettering. This isScalableFourth, the arrangement of words may be vertical or horizontal. In this case, you only need to move the movable words to meet the arrangement requirements. This isGood Flexibility.

Before the live printing, the four features above could not be met. to modify them, they must be re-engraved. To add words, they must be re-engraved. to re-arrange them, they must be re-engraved, after printing this book, this version has no value for reuse.

When I was a child, I had been wondering why gunpowder, compass, and papermaking were all great inventions from nothing, from unknown to discovery, the movable printing is only a technological progress from the engraving printing to the movable printing. Why is it not the evaluation of printing as one of the four great inventions?

After a few years of software development, many customers (Cao) have changed their needs and changed their original ideas. In fact, objectively speaking, the customer's requirements are not too much (just a few words), but in the face of completed program code, it is the embarrassment that needs to be almost repeated, which is really painful. To put it bluntly, the reason is that wePreviously written programs are not easy to maintain, have poor flexibility, and are not easy to expand, let alone reuse. Therefore, in the face of demand changes, we need to work overtime, it's normal to be impatient with a procedural procedure..

After that, when I learned the object-oriented analysis design programming idea, I began to considerReduces Program coupling through encapsulation, inheritance, and Polymorphism(The problem with traditional printing is that all words are engraved on the same layout, resulting in a high Coupling Degree .)The design pattern makes the program more flexible, easy to modify, and easy to reuse. I realized the benefits of object orientation. It should be like the first time a Chinese drunkard drank Moutai and the first time a western drunkard drank XO.

Review the Four Great Inventions in ancient China, the other three should be the progress of science and technology, great creations or discoveries. The only thing that can be done is the success of thinking and the victory of object-oriented. I wonder if you feel something too?

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.