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
}
: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
}})
...
(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.
On Friday, 11 April 2014 00:13:19 UTC+10, Kashyap CK wrote:
>
> Hi,
> I have the opportunity to build a set of services from scratch. I plan to
> use clojure for this.
> I'd like to experiment with options available out there - options such as
> - what webserver, what database etc. I'd like it very much if you could
> share some of your experiences in this and possibly some pitfalls to avoid.
> Regards,
> Kashyap
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.