Atitit. Summary of the powerful concepts and methods used to improve the efficiency and quality of software development

Source: Internet
Author: User
Tags metabase

Atitit. Summary of the powerful concepts and methods used to improve the efficiency and quality of software development

 

1. Three worst problems in mainstream programming 1

1.1. A long time from understanding the problem to implementation 1

1.2. Understand and maintain code 2

1.3. High learning curve 2

1.4. poor scalability 2

1. CoC 2

2. dsl 2

3. DSM 3

4. 4gl 3

5. Generative programming (GP) 3

5.1. Development for reuse and reuse 3

6. Introduction of MDA 4 in model-driven development (MDD)

7. · metaprogramming 4

8. Intent programming 4

9. · AOP 5

10. · generic programming 5

11. fp 5

12. Language-Oriented Programming LOP (Language Oriented Programming) 5

13. Code Generation vs model Interpretation 6

14. Refer to 6

 

 

 

1. Three worst problems in mainstream programming 1.1. A long time from understanding the problem to implementation

It will take a long time to encode the solution into a computer after understanding the problem and solution. This is because we can use a wide range of natural language expressions, but we can only communicate with computers through common programming languages. Currently, there are only dozens of programming languages, and there are tens of thousands of natural language expressions. Therefore, the cost of such conversion is relatively large.

In mainstream programming, most of the time is on "programming". In reality, the concept of natural language is expressed using abstract terms at the programming level, which is very difficult, being less creative is more or less a waste of time. For example, today, a lot of development time is spent on the design (OOD) of object-oriented objects, it is indeed a creative process for programmers to express classes, inherit, and associate, but it is not necessary to use language oriented programming.

(My point of view: I am not very familiar with this. I think the underlying layer still needs to be further understood)

 

Author: old wow's paw attilax iron, email: [email protected]

Reprinted please indicate Source: http://blog.csdn.net/attilax

 

1.2. Understand and maintain the code

In general language programs, many highly summarized perspectives and blueprints are lost, which is not conducive to our understanding of the product. The traditional method to solve this problem is to write comments or use other forms of documents to record design information and model information, but this proves that this is a fragile solution, because it requires the cost of writing these auxiliary documents and the non-synchronization troubles caused by documents and code, the code should be self-described in an ideal situation, I should only read the Code itself to understand the code, rather than comments and external documents.

1.3. High Learning Curve

Oop is rarely able to directly express domain concepts. They must introduce extra branches (such as runtime behaviors of A Class) to map domain concepts. Understanding these fields and learning these class libraries are not a simple task. We need a lot of guidance and documents to solve this problem, but it will take a lot of time to learn this; when a class library becomes more complex, it becomes more difficult to learn, so programmers will lose the motivation to learn it. Even after you have mastered the complex ing of Domain issues and technologies, you can easily misuse class libraries because the development environment (such as compilers and editors) cannot help you correctly use class libraries.

1.4. poor scalability

When some language extensions are required, we can only wait for the language designer to update it. If my ide has some additional powerful features, we can only wait for the vendor to add new features; these dependencies limit our full freedom. Of course, programmers can write their own compilers and ides, but this will take a lot of time and effort and may not necessarily succeed.

1. coc2. dsl3. dsm4. 4gl5. Generative programming, GP)

Because we usually write programs with a great annoyance that domain knowledge has been deeply hidden in the code, and changes in any domain knowledge are endless changes and debugging for programs. However, Generative programming can clearly express the domain model in the form of code.

Is a type of software engineering generic (paradigm), based on modeling of the system family. That is to say, to a specific requirement specification (specification), you can create a highly customized and optimized intermediate product or final product as required. This requires the use of basic, reusable implementation components through the preparation of knowledge.

In software, there are two steps to change towards automated production software:

1. Shift focus from developing a system to developing a system family: develop correct common components

2. Automate component assembly: Use the generator to automate

I feel that it can be used as a software engineering method for product line engineering. Generative programming is to design and implement components to adapt them to the general product line structure, while modeling configuration knowledge, emphasize how to transform abstract requirements into specific component groups, and use the generator to implement configuration knowledge. Through these work, we can solve the high complexity, high efficiency and high quality problems mentioned above.

GP's goal is to focus on the system family, rather than a system (one-of-a-kind system). It is not a single system family member constructed from scratch, it is based on a general generative domain model. The model consists of three parts:

1. Specify system family members (problem space)

2. Assemble the implementation components of each member (solution space)

3. Configure the knowledge ing between the problem space and the solution space (configuration knowledge)

5.1. Development and reuse for Reuse

Generative programming is generated, such as: AOP (aspectj), DSL (drools)

Generative programming is a combination,

1. The formula is bottom-up, while the declarative method is custom-down. The idea of Generative programming is the combination concept (a combination of small-granularity concepts to generate a large-granularity concept ),
Declarative Programming is an analytical concept. It is understood with a unified concept and different differences are resolved by specific programs.
2. the Declarative Programming editor generates an XML file which will be parsed by the Framework Program. The generated program code will not be parsed and run.
3. As a result of 1, the metadata model is different. The production formula is relatively fine-grained, while the declarative formula is coarse-grained (you cannot directly compare the size and define the concept of no difference ). Such as Ant and jbpm are all very big concepts.

6. Introduction to mda7. · metaprogramming in model-driven development (MDD)

The language used to compile the metabase is called the metabase. The language of the manipulated program is called the target language. A programming language is also called reflection or self-inversion.

Reflection is a valuable language feature that promotes metaprogramming. It is also useful to regard the programming language itself as a level-1 data type (such as LISP, forth, or REBOL. Languages that support generic programming also use metaprogramming.

Metaprogramming is usually implemented in two ways. One is to expose the internal information of the runtime engine to the programming code through the Application Programming Interface (APIS. Another is to dynamically execute a string expression that contains programming commands. Therefore, "programs can be programmed ". Although both methods can be used in the same language, most languages tend to favor one of them.

The most common metaprogramming tool is the compiler, which can convert a relatively short program written by a programmer in advanced language into an equivalent assembly or machine language program. This is the most basic programming tool. In most cases, writing machine language programs directly is not realistic.

You can achieve this by embedding an interpreter that directly processes program data in the program. There are already some implementations for common advanced languages, such as the Pascal script written by remobject for Object Pascal.

Another common example of metaprogramming is Lex and YACC, which are used to generate lexical analyzer and syntax analyzer. YACC is usually used as a compiler to generate tools that can convert advanced languages into machine languages.

8. Intent Programming

When the finance staff saw the spreadsheet software, their eyes were shining. I thought it would also shine when programmers saw the available intent programming tools.


The author of intent programming is also the inventor of "WYSIWYG" document editing.

He said, "Currently, programming is just the opposite of diamond mining, where you dig out a lot of dirt and find a little expensive diamond. When it comes to programming, you start with a real intention that has a value, but then you bury it in the soil ".

 

Example of a jet engine. He said they must be very precise in the case of turbine blades. Even if the blade is processed by skilled workers, it is still impossible to achieve the precision you require. Instead, you must create another machine to process the blade. Will someone intervene in this process? Of course, manufacturing, servicing, and adjusting machines must be done by humans. An error occurs on the machine. Once an error occurs on the machine, it is obvious that you can immediately discover and correct it. The same is true for program encoding. You do not need to contact the encoding. Otherwise, the program is prone to errors. People can make this kind of machine...

 

9. · AOP

Aspect Oriented

10. · generic programming

Generic programming was originally born in C ++ and was created by Alexander Stepanov [2] and David musser [3. The objective is to implement C ++ STL (standard template library ). The language support mechanism is templates ). The template spirit is actually very simple: parameterized type. In other words, extract the type information from an algorithm or class that is originally specific to a specific type and extract it into template parameter T. For example, qsort becomes generalized:

11. fp12. language-Oriented Programming LOP (Language Oriented Programming)

 

Lop gives up the traditional text-based language and replaces the class library with new languages. It can be integrated with the editor, and every programmer can create his own language.

According to Mr. Dmitriev, the problem with general languages is that they have poor ability to describe Domain Models. After completing Conceptual Domain Modeling, developers must go through a long coding process to describe the model as a machine-understandable program, in turn, it is equally difficult to understand the domain model described by these codes. Although DSL can well describe Domain Models and solve domain problems, there are too few such languages, and most developers have to wait for a few large manufacturers to provide them with applicable DSL. To a large extent, this "language loss" causes low efficiency in software development.

The solution proposed by Mr. Dmitriev is lop: with the help of tools, developers are allowed to create their own DSL. Of course, such DSL can describe domain problems most appropriately, thus greatly improving development efficiency. Moreover, such a "Custom DSL" does not need to be in text format. It can be directly stored as a tree structure (or another structure) and displayed as an image.

The starting point of Lop is to allow us to create, reuse, and modify languages and environments. To understand what lop is, we can compare it with the mainstream programming and lop method processes. It makes the programming stage no longer a bottleneck, but it is transferred to the "Create" step, the author developed a general platform (the meta Programming System) to design DSL, which allows programmers to define their own languages as easily as writing programs; this platform will fully support lop, giving programmers the freedom to choose the most appropriate language for each part of the program, rather than binding them to a fixed generic programming language.

Lop will not only write programs, but also include the languages used to write programs.

13. Code Generation vs MODEL INTERPRETATION

We can explain that the model runs directly on the domain framework, or convert the model into code through the Code Generation Technology and compile and run on the framework. Both methods have advantages and disadvantages and can be used together. In openexpessapp, these two methods are used. The class library is generated by code and the meta-model such as UI is interpreted and executed by the framework. Since code generation is an important technique in MDD, I will introduce the knowledge of code generation in this article.

 

14. Reference

Mdsf: Generative programming-Zhou jingen-blog

Mdsf: Language-Oriented Programming LOP (Language Oriented Programming)

Mdsf: Lop-Example of a calculator using MPs-Zhou jingen-blog

Mdsf: code generation vs model explanation-Zhou jingen-blog Park

Atitit. Summary of the powerful concepts and methods used to improve the efficiency and quality of software development

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.