Chapter 2. Core principles

Table of Contents

Simplicity and the KISS principle
Actions and Templates
Extensivity and Plugins
Selectors

Atomik alone does not provide a lot of features. It basically provide 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 Templates

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 template, are divided into two different files. The action is executed and then the template is rendered. Both of them is what make a web page.

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

Extensivity and Plugins

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

Atomik also have a plugin loader. It can automatically bind events to the plugin class methods.

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.