Has anyone explored using spec for “soft” failures? For example, if I’m writing 
an ETL system to migrate legacy customer account data, all I might require of a 
record’s :created field is that the value is a syntactically valid date-time 
string. If any record claimed that it was created on 
"1970-01-01T00:00:00.000Z", of course that would almost certainly be bad data; 
but instead of crashing the program or refusing to process the record, let’s 
say I want to log (at the WARN level) some of that record’s data, or perhaps 
even store the output of s/explain-data with the record in the target database. 
To describe it another way: I’m interested in taking spec beyond “application 
correctness” to also encode business/domain logic about data “smells”.

I’ve come up with two possible approaches to implementation:
1. Use different specs, potentially passing over the data multiple times.
2. Use a single spec, but have rules for what ::s/problems are acceptable.

So, what do you think? Has anyone tried anything along these lines? Does this 
sound fundamentally wrongheaded, trying to make spec do something it’s 
ill-suited for?

Cheers,


Josh Tilles

79 Madison Ave, 4th Floor
New York, New York 10016

Tel: (646) 685-8379 <tel:+16466858379>
signafire.com <http://www.signafire.com/>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to