Application Architecture

The approach that a typical Compojure web application takes is probably different from what you’re used to. Most frameworks favor using the model-view-controller (MVC) pattern for partitioning the application logic with strong separation between the view, the controller, and the model. Compojure does not enforce any strict separation between the view and the controller.

Instead, we create handlers for each application route. The handler processes HTTP requests from the client and dispatches actions based on them. The handlers drive the model that’s responsible for handling the domain logic. This approach provides a clean separation between the domain logic and the presentation layer of your application without introducing ...

Get Web Development with Clojure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.