Add zero configuration support
Closed this issue · 2 comments
ICombProvider myCombProvider = new SqlCombProvider(new SqlDateTimeStrategy());
This is too much work and totally leaks all kinds of implementation details.
You really should have a class that behaves something like
public class Comb
public static ICombProvider Sql { get; } = new SqlCombProvider(new SqlDateTimeStrategy());
public static ICombProvider Unix { get; } = new whatever;
etc.
There's probably almost never a reason a person needs to actually touch your construction. Just give people the defaults in a statically available manner.
A fair point! I started out with some static classes, but then got wrapped up in making everything configurable. I built the library originally for a ASP.NET Core project and have been using DI to create a single instance for my entire application, so there wasn't much pain in having a more verbose constructor.
I'll add a static class with some sensible default providers in the next revision. Leaving this open until then...
Version 2.3.0, just released, includes a static RT.Comb.Provider
class with three options for zero-configuration use:
Legacy
, the original concept,Sql
, a modern version for SQL Server using a Unix timestamp, andPostgreSql
, a modern version for PostgreSQL.
Thanks for the feedback! Closing.