We found that design patterns are very popular in the Java community, but not so much in the C + + community, or even a bit of exclusion, what causes this difference.
(1) C + + memory needs to be managed by itself, so some patterns are not easy to use in C + +, but Java does not care about memory, so the use of design patterns in Java has a natural advantage. With shared_ptr, weak_ptr, unique_ptr, etc. joined C++11, I believe that this aspect will be improved.
(2) In the Java Class Library system, many of the design itself is based on design patterns, so when invoking the Java class Library, you unknowingly use the design pattern, which causes you to design your own interface will also use the design pattern.
(3) C + + is commonly used to solve some of the underlying problems, so in C + +, we are more concerned about how to implement a certain feature, but Java with its rich class library, implementation of feature is often not a problem, so they have more focus on design.
(4) design pattern is usually indirect layer, can cause the loss of performance, and the application of C + + occasions often more emphasis on performance. For this issue, if your program is more about performance (such as the kernel), you really shouldn't introduce too many indirect layers, but if your program is more focused on scalability and maintainability, you should consider design patterns.
(5) Many programmers in the C + + community are transferred from C or even assembler, so these people are more accustomed to the process-oriented design approach, that is, using C + + is simply to encapsulate some simple classes and not use design patterns.
(6) C + + supports a variety of programming models, including process-oriented, object-oriented, object-based, generic programming, and so on, design patterns are mainly based on object-oriented, while Java only supports object-oriented development.
(7) The design pattern in the relatively large-scale C + + open source project to use or more, such as Network library ACE, interface Library qt, game engine Orge, Irrlicht and so on.