Programmatic programming, Declarative Programming and Generative programming
Development programming, Declarative Programming, and Generative programming
Author: Anders James
Synchronized from: http://www.blogjava.net/AndersLin/archive/2006/08/31/66968.html
Development Programming is encoded, such as Java and C #
Declarative Programming is parsed, for example, ant (XML such as spring is different. They are static descriptive and less verb)
Generative programming is generated, such as: AOP (aspectj), DSL (drools)
Development Programming is aggregated,
Declarative Programming is declarative,
Generative programming is a combination,
Declarative Programming and Generative programming look like the following:
1. Declarative Programming requires a parser and Generative programming requires a generator;
2. Generative programming (Orthodox) requires an editor. Declarative Programming (such as jbpm) can also be used ).
3. Generative programming has a metamodel, which can also be defined in Declarative Programming.
The essential difference lies in:
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 handed over to specificProgramResolution.
2. the Declarative Programming editor generates an XML file which will be parsed by the Framework Program, while the generative ProgramCode.
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.
Some time ago, on javaeye, Huang liuqing of panyuan talked about Chinese software development: "Currently, there are two traditional large enterprise application software methods in China: disruptive development and one-time development. It is worth noting that both methods have a fatal defect-the disruptive development method makes it difficult to achieve the rapid development and implementation of enterprise-level application software; the one-time development and continuous operation method, this leads to serious software rigidity and application inadaptability. Although sometimes the operators of the two methods attack each other, there is no significant difference between them in the user's opinion"
What it said and what panyuan did are the three development methods.
The boss of buaawhl said: "interpreter is over code generator. The highest level of meta programming is the direct solution at the language level, such as Smalltalk, Ruby, Python, and other languages that support reflection. Even template technologies such as STL can be regarded as language-level. Code generation is the lowest level of meta programming solution. The technical level is also the lowest. This level must be exceeded in order to truly achieve qualitative changes and completely jump out of the level of Conceptual Speculation. "
I always thought: in fact, code generation is not so bad, the key is to generate something. If it is to generate Structured code, it is easy to get people BS, because most of such code can be completed using templates, and because this code is often not the final product, there is a synchronization maintenance problem.
However, if functional code is generated and such code is the final Execution code, the code used for design is generally considered as the final product. The most obvious example is DSL.
Some miscellaneous ideas. Welcome to shoot bricks!