mfenniak / rethinkdb-net

A C# / .NET client driver for RethinkDB.
Other
247 stars 37 forks source link

Replaceable expression tree -> term conversion w/ IExpressionConverterFactory #183

Closed mfenniak closed 9 years ago

mfenniak commented 9 years ago

Intended to address issue #159, this PR extracts how rethinkdb-net converts expression trees into ReQL terms into a series of externally-implementable interfaces.

New interfaces:

This very coarse interface allows for whole-sale replacement of how expression tree to ReQL mapping. It's not very likely that anyone would replace our entire engine for this, though. It's more likely that they'll want to make small changes to our behaviour.

A DefaultExpressionConverterFactory is an implementation of IExpressionConverterFactory that mirrors the existing behaviour. It will also have some extensibility of it's own, so that someone desiring to extend the capabilities of the expression tree conversion doesn't necessarily have to define an entire IExpressionConverterFactory (although that dramatic capability will be available to them). The extensibility in this class will be instance-based (rather than static/global), so it's possible and more likely for a consumer of this library to use one or more specially configured DefaultExpressionConverterFactory for different components of their application.

TODO: