Taking Things Apart

Our first task is figuring out how to go from our problem to a rough architecture for solving that problem. We analyze the problem to identify distinct components, which we discussed in Chapter 6, Creating Components. We separate our code into components for several reasons: reuse of generic components within an application (or across many applications), dividing development within a team, or even a structure that allows us to think about only part of the problem at a time.

Although there are no rules on how to separate components, you can follow some common guidelines. Some reasons to group code together include: the functions work on the same kind of data, the data has a common scope or lifetime, the likelihood of change ...

Get Clojure Applied 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.