Bdfy
Bdfy

Reputation: 24661

design pattern for sql builder

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

Answers (1)

Marcus
Marcus

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

Related Questions