Conclusion
About
This section includes steps that are to be performed by the students to complete and achieve the objectives of the book.
Clojure's options for abstraction definition and implementation have a variety of advantages and disadvantages. There is no universal rule for how to use them. You must balance concerns about flexibility, code elasticity, performance, separation of concerns, cross-platform compatibility, and dynamism (to name a few).
By looking at a couple of different problems solved in different ways, we have extracted some principles:
- If you have a reasonable expectation that your code may change, then you should use some kind of runtime dispatch mechanism (even that from Plain Functions + Client Namespace).
- Using runtime dispatch, even if you don't necessarily need it, will increase the elasticity of your code.
- Most likely, you should have a client namespace to separate client (code that uses the abstraction) concerns...