Natural language-based software engineering and programming (II)

Source: Internet
Author: User

So farProgramming LanguageOr software engineering, or even the development of the Internet, are both rapid development. As a result, we are lost in the sense of language and concept. In fact, we may wish to return to the original, back to the original, let us start from the semantics to discuss these various types of, do you suddenly realize?

Previous index:

Natural language-based software engineering and programming (I)

Natural language-based software engineering and programming (medium)

10. object-oriented and Semantic Analysis

We all know that object-oriented is a top-down analysis process and a bottom-up design process. Here, we will not talk about the analysis process, but the design process.

The number of classes in the system is not produced by a single brain, rather than accumulated experience, but extracted from the demand analysis.

Classes are the process of refining nouns. We know that each object corresponds to an entity in reality, and each class is an abstraction of objects with the same features. The more appropriate the abstraction, the more precise the class we can extract.

At this moment, we have to lament the subtlety of Ancient Poetry:

The old tree of the withered vine is dark, and the old wind is thin. Xiyang Xixia, heartbroken in Tianya.

Poetry is rightArticleA highly abstract process; an object-oriented design process is also an abstract process of the real world. When can we precisely extract the demand analysis document into Ancient Poetry, this is the way to realize the object orientation.

11. design is a process that violates Semantics

Object orientation is more close to our actual design than object-oriented reusable and easy to maintain,This makes every class available. This is a wonderful object-oriented solution..

In the previous part, we mapped the real society into ourProgramBut someone will jump out and say, is this object-oriented? Inheritance, polymorphism, encapsulation, you have nothing!

This is what I will mention in this section. In my opinion:Design is a process of violating Semantics.

For example, "the instructor lectures and students attend lectures. "This semantic environment will naturally produce two classes for teachers and students, but everyone will think that" people "should be extracted as the base class (parent class) for teachers and students ). However, we know that a person does not exist in this semantics. He just assumes it based on experience. As we have said before, classes are the abstraction of objects (real things), while parent classes are the re-Abstraction process of classes. Therefore, I think:Inheritance is a re-Abstraction of abstraction..

When talking about design, we should mention design patterns. Let's think about common design patterns, factories, adapters, strategies, and so on, which cannot be analyzed in our semantics. Therefore, in my opinion,The design pattern sacrifices the natural nature of semantics in exchange for software reusability and maintainability..

12. Conflict between database design and natural Semantics

Here, the database I refer to is a relational database. Therefore, the conflict between database design and natural semantics is actually an irreconcilable contradiction between relational databases and object-oriented languages.

In other words, in Object-Oriented Systems, attributes are not necessarily atomic, and data is not necessarily redundant. Therefore, the three paradigms of databases are not applicable to object-oriented design, this indirectly leads to conflicts between relational databases and object-oriented design.

(Note: As I know a lot about Orm, please trust it in the following remarks, and I hope you will not be enlightened.In this example, Orm is a technology generated to solve the mismatch between object-oriented and relational databases. Many people have a misunderstanding when using Orm, that is, they first establish a database and then generate an object from the database. HoweverIn my opinion, the database should only be a tool for data storage, and should never be the core of the entire project design. The correct way to Use ORM should be to automatically persist the program into the relational database, we know nothing about the database in the program, and we only operate on a collection of objects.. I don't know the development of ORM today, but in my opinion, a perfect ORM system should have the ability to parse objects and then convert objects into database structures that conform to the paradigm.

In addition, views and cache tables are also one of the solutions.

Finally, we can only look forward to the further maturity of Object-type databases.

13. Future language in my eyes

In my eyes, the direction of language development should be gradually closer to semantics. Just imagine that since the first generation of language development, the language trend is more and more suitable for programmers to use and improve the efficiency of programmers, what is hard to hear is gradually lowering the threshold for system development programmers. The first is the gradual improvement of method encapsulation. The second is that it is getting closer to natural language and closer to "large scale ".Composition.

So when software develops to a certain extent, I think the future language is equivalent to the natural language programming language. This allows everyone to program and highly encapsulate methods. compilers can recognize natural language semantics and convert them into machine-identifiable languages. Callback,. aspx.

Maybe on that day, the programmer's profession no longer exists. Instead, the writer, on this day, we say that software has really reached the highest stage.

 

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.