Closed GoogleCodeExporter closed 8 years ago
Initially I thought we should allow splitOn to accept a comma separated list
...
eg: splitOn: "id,ID,LocationId" have it infer any missing splits last specified
Original comment by sam.saff...@gmail.com
on 4 May 2011 at 12:05
If you want an array of strings i rather use an array of strings or an
enumerable/collection, parsing strings can always open for a can of worms of
runtime errors that are hard to test for.
Personally an optional Func while keeping the optional splitOn seems more
flexible, more complex yes, but with great power comes great responsibility…
Having an Id splitOn is great when you have the whole stack because then it’s
easy to write you’re select to accommodate that.
The problem is when you’re a consultant working against DBA reluctant let
anyone near his baby, the same problem can occur with legacy systems. Having a
Func lets you do all kinds of crazy with just a small lambda.
Original comment by mattias%...@gtempaccount.com
on 4 May 2011 at 6:15
splitOn is currently using a string and supports multi mapping, I follow that
stuff gets complex, but can not see a use case where the splitOn string can not
be used.
the Func is fancy and can possibly be reused, but it also feel a bit dangerous
Original comment by sam.saff...@gmail.com
on 1 Jun 2011 at 9:22
Well, "With great power, comes great responsibility", File.Delete() can also
possibly be dangerous:)
I had a couple of cases that’s why I suggested it and have it in the branch
I'm using. If something like it would to be implemented in the official source,
I wouldn’t have to merge with new releases, a bit selfish I know.
The implementation I made supported both splitOn with the standard behavior and
an optional Func for overriding the default behavior, so both old and new code
would work.
Basically the sweet deal with a Func is that it gives extensibility without
having to change the API, you can reuse code easier between types (just have a
func of t that returns the splitOn func)
You can also solve versioning if production and dev databases give slightly
different results.
But just that I have a need for it doesn’t mean that anyone else does and
I’ll respect that.
Original comment by mattias%...@gtempaccount.com
on 1 Jun 2011 at 12:01
I wish there was a way to give you an internal hook without changing the api it
would make it easier for you
Original comment by sam.saff...@gmail.com
on 2 Jun 2011 at 1:44
Original issue reported on code.google.com by
mattias%...@gtempaccount.com
on 30 Apr 2011 at 11:37