http://talks.samirtalwar.com/design-patterns-in-the-21st-century.html
http://www.kastordriver.one/2016/12/java-8-vs-gof-strategy.html
http://www.kastordriver.one/2016/12/java-8-vs-gof-command.html
https://github.com/xpinjection/design-patterns
https://www.youtube.com/watch?v=Wat4LiTzLU0&feature=youtu.be
https://github.com/iluwatar/java-design-patterns
https://github.com/kamranahmedse/design-patterns-for-humans
http://java-design-patterns.com/
https://dzone.com/articles/code-generation-and-templating-made-really-easy
https://github.com/MCGallaspy/dr_strangetemplate C++ metaprogramming templates
http://tidyjava.com/dependency-inversion-in-java/
http://java-design-patterns.com/patterns/
http://mishadoff.com/blog/clojure-design-patterns/
http://conceptf1.blogspot.com/2016/02/facade-design-pattern.html
http://www.dataorienteddesign.com/dodmain/
http://spin.atomicobject.com/2014/09/03/visualizing-garbage-collection-algorithms/
IoC inversion of control
https://habrahabr.ru/post/321344/
Понятие IoC тесно связано с понятием фреймворка. Это главная характеристика, отличающая его от другого способа оформления переиспользуемого кода — библиотеки, функции которой вы просто вызываете из своей программы. Фреймворк же — это внешний каркас, предоставляющий заранее определенные точки расширения. В эти точки расширения вы и вставляете свой код, но когда он будет вызван определяет именно фреймворк.
MVC pattern
http://habrahabr.ru/post/251361/
https://stefanoborini.gitbooks.io/modelviewcontroller/content/
http://www.beyondjava.net/blog/model-view-why-bother/
http://forthescience.org/books/modelviewcontroller/
http://eli.thegreenplace.net/2011/04/22/c-template-syntax-patterns/
http://kc.my-junk.info/di-ioc-dip/ Dependency Injection, Inversion of controls
http://habrahabr.ru/post/244497/ Factory
https://habrahabr.ru/post/277295/
Templates are something the C++ compiler needs to see at compile time, not link time. Kind of like C-style “macros” with #define. Therefore you must always place template implementations in header files.
One commonly used idiom is to only place the interfaces in header files and the implementation themselves in different files (sometimes ending with .inc or .tmpl, or .impl) and include the implementation file from the header file.
http://mishadoff.com/blog/clojure-design-patterns/
http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms
http://sourcemaking.com/design_patterns
http://hfdp-cpp.sourceforge.net/
http://www.vincehuston.org/dp/
http://www.infoq.com/presentations/gof-patterns-c-plus-plus-boost
http://pavelfatin.com/design-patterns-in-scala/#!
Effective string concatenation
http://www.drdobbs.com/fast-nonintrusive-string-concatenation/184401816
http://gameprogrammingpatterns.com/prototype.html
Curiously Recurring Template Pattern (CRTP)
http://www.codeotaku.com/journal/2009-05/compile-time-polymorphism/index
http://codeyarns.com/2015/07/09/how-to-understand-crtp/
http://eli.thegreenplace.net/2011/05/17/the-curiously-recurring-template-pattern-in-c/
http://accu.org/index.php/journals/296
http://www.codeproject.com/Tips/537606/Cplusplus-Prefer-Curiously-Recurring-Template-Patt
using templates, C++ provides an alternative way to implement polymorphism without the extra costs. There’s a catch, of course – the types of objects have to be resolvable by the compiler at compile-time. This is called static polymorphism (or "simulated dynamic binding").
#include <iostream>using namespace std; template <typename Child> struct Base { void interface() { static_cast<Child*>(this)->implementation(); } }; struct Derived : Base<Derived> { void implementation() { cerr << "Derived implementation\n"; } }; int main() { Derived d; d.interface(); // Prints "Derived implementation" }
SINGLETON
http://habrahabr.ru/post/150276/
Command Pattern
http://gameprogrammingpatterns.com/command.html
class A {
private Command command; public A(Command command) {this.command = command} void m() { System.out.println("my code"); if (command != null) command.hook(); System.out.println("my code"); } } interface Command { void hook(); } class StubCommand implements Command { public void hook() {} } // Empty hook class CommandImpl implements Command { public void hook() { System.out.println("hook code"); } }
http://www.codeproject.com/Tips/595716/Adapter-Design-Pattern-in-Cplusplus
http://www.slideshare.net/ppd1961/design-patterns-3159605
http://www.slideshare.net/ppd1961/generalized-functors-realizing-command-design-pattern-in-c
http://www.cantrip.org/traits.html
http://www-old.lrde.epita.fr/dload//papers/coots01.html#myers.95.cppr
http://home.comcast.net/~codewrangler/tech_info/patterns_code.html
Visitor pattern
http://habrahabr.ru/post/208718/
https://habrahabr.ru/post/313134/
http://stackoverflow.com/questions/9132178/what-is-the-point-of-accept-method-in-visitor-pattern
http://arne-mertz.de/2016/04/visitor-pattern-oop/
http://java-x.blogspot.com/2007/01/implementing-visitor-pattern-in-java.html
http://snehaprashant.blogspot.com/2009/01/visitor-pattern-in-java.html
http://blog.functorial.com/posts/2013-10-02-Visitor-Pattern.html
Use the Visitor pattern in any of the following situations:
1) When many distinct and unrelated operations need to be performed on objects in an object structure, and you want to avoid "polluting" their classes with these operations
2) When the classes defining the object structure rarely change, but you often want to define new operations over the structure. (If the object structureclasses change often, then it's probably better to define the operations in those classes.)
3) When an object structure contains many classes of objects with differing interfaces, and you want to perform operations on these objects that depend on their concrete classes
public interface IVisitor<T> {
void visit(T item);
}
public class CollectionUtils {
public static<T> void applyVisitor(Collection<T> collection, IVisitor<T> visitor) {
for (T item : collection)
visitor.visit(item);
}
}
Usage of IVisitor:
public static void main(String[] args) {
CollectionUtils.applyVisitor(Arrays.asList(1, 2, 3, 4, 5), new IVisitor<Integer>() {
public void visit(Integer x) {
System.out.println(x);
}
});
}
http://www.math.utah.edu/~tsinghai/papers/parameterPatterns.pdf
Matrix Multiplication
http://www.drdobbs.com/cpp/accelerating-matrix-multiplication-in-c/240163085
template <class T> struct TMatrix
{
T **data;
int rows,cols;
};
TMatrix A;
A.rows = m, A.cols = n;
A.data = new T* [m];
for(int i=0;i<m;i++)
A.data[i] = new T [n];