Chapter 2. Core principles

Table of Contents

Simplicity and the KISS principle
Actions and Views
Extensibility and Plugins
Selectors

Atomik alone does not provide a lot of features. It basically provides a simple directory structure and a dispatch mechanism. The whole point of Atomik is to extend it through plugins. You build the framework you want with the features you need.

Simplicity and the KISS principle

KISS (Keep It Simple Stupid) is a principle which goal is to keep things the simplest possible. Atomik has been build from the beginning with this idea in mind. It simply works and is nearly bug free. Just unzip your downloaded package and start working!

Actions and Views

Atomik is not an MVC framework according to the definition of MVC (it can however become one with plugins...). Still it follows the same idea. The application logic, called action, and the presentation layer, called view, are divided into two different files. The action is executed and then the view is rendered. Both of them is what makes a web page.

How you code actions and views is your business! Atomik only provides the dispatch mechanism. The only other thing it does is pass variables defined in the action to the view.

Extensibility and Plugins

As said before, the whole point of Atomik is being highly extensible. Nearly all actions (execute an action, render a view...) can be overrided. This is made possible through an event system. Before and after each methods, and sometimes during, events are fired. Multiple callbacks can be registered for each events which allow to modify the way Atomik acts.

Atomik respects the convention over configuration principle. However it hasn't forget the configuration aspect and even its core features can be modified. For example, if you want to drop the logic and presentation separation (however highly discourage) and do everything in a single file, you can.

Selectors

Like in modern javascript frameworks, Atomik offer selectors, or at least the same idea. Selectors are a way to quickly access some features or some data of Atomik or plugins. Their simpler to learn than a complicated API and offer a uniform way of doing things.