With Lispy languages, you can do whatever you want without worrying too 
much about underlying web server, db, etc.

I use my own constructors like:


(define-crud-handler :employee [:path ["customers" cust-id "sites" site-id 
"employees"] :auth-required? true]
  {:collection {:create (employees-create cust-id site-id)
 :read (employees-collection-read cust-id site-id
                                                           :req-params 
[number draw] [number start] [number length]
                                                                        
order search)
 :partial-update (update-employees-collection-pref [number cust-id] [number 
site-id]
                                                                  
 :req-params [keyword payment-schedule] next-pay-date)
 :delete (employees-collection-delete cust-id site-id)
 }
   :element {:read (employees-element-read cust-id site-id employee-id)
 :update (employees-element-modify cust-id site-id employee-id)
 :delete (employees-element-delete cust-id site-id employee-id)
 }})

...

(define-crud-fn employees-element-modify [cust-id site-id employee-id]
  (dl/update-item :employee
                  {:site-id site-id :id employee-id}
                  (into {} (map (fn [[k v]] [k [:put v]]) 
(get-json-parameters)))
                  :return :updated-new))


In this way, I can maintain proper abstraction layers and free to change 
underlying web server or db.


-- 
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