| This is how we do the API - - Database models should contain all the possible mechanisms/methods for data I/O - Data Transformation utilities/ helper functions that do one job well, that is - sort, filter, validation, whatever
-- -- If an API is using (more on API below), utils become immutable code - Finally the API level
-- -- treat the API code as immutable, once shipped
-- -- The code should look like a pipeline of functions
-- -- -- eg: serialize(...) validate(...) filter(...) db(...)
-- -- -- need not be chained
-- -- new API version, new router, new routing logic - Review API with an intent to extract out any possible util methods. final API methods should look like a series of data transformation functions - Overtime the utils would become extremely messy, but the APIs would be very clean ------------------------------------------------ The layer running business logic would be the most interacted with layer, if you can keep it clean, then you can keep frustration low in your fellow devs. A lot of people can work on the API level, irrespective of their experience. Utils and Models should be managed by more experienced devs. Rate of change in Utils and Models is quite low as compared to the rate of change in the API levels. ------------------------------------------------ Not sure, I guess I am writing something very trivial and obvious. |