Controller and View DSL
In this chapter, we will use the metaprogramming skills learned in the previous chapter to make our controller and view modules easier to read and extend. We will first define the requirements for our interface, understand why we need metaprogramming, and build an idiomatic interface to properly define future controllers and views.
We will cover the following topics in this chapter:
- Understanding why it makes sense to use metaprogramming here
- Designing the DSL for controllers based on requirements
- Using concepts covered in the previous chapter to build a DSL for controllers
- Adding reflections to make it easier to debug and test the controller DSL
- Making
plug
calls more introspective and reflective - Designing and building the DSL for views
- Adding reflections to make it easier to debug and test the view DSL
- Building an app to test out the new DSLs
- Creating test helper modules to make it easier to test the DSLs
At...