Reputation: 24661
I want to write sql builder ( in: conditions(where, limits, table, etc), out: pure sql. ). Which design pattern nearest for this task?
Upvotes: 0
Views: 858
Reputation: 1876
Some kind of expression tree along with a visitor or maybe some kind of interpreter.
http://en.wikipedia.org/wiki/Visitor_pattern
http://en.wikipedia.org/wiki/Interpreter_pattern
Upvotes: 2