Components

Last updated 18 days ago

'Components' is the folder where we store all of our components.

We can imagine the components folder as "drawer" which holds all of the components in our workspace.

The RealWorld components "drawer" contains eight components
Components have a standard project structure

Each component has a standard Clojure project structure; with a project.clj file, a readme.md file, a resources folder, a src folder, and a test folder. Each component is a project to allow us to compile them as individual artefacts, which guarantees that they are de-coupled from all other building blocks.

The 'interface' namespace exposes all the component's public functions

As you hopefully remember from the block metaphor, a component's interface is where it exposes its functionality to other building blocks. A component's interface is simply a namespace, in this case called interface.clj.

'user' has three implementation namespaces 'core', 'spec', and 'store'

The implementation namespaces are where a component implements the functionality that's exposed by its interface.