How it works ?¶
Swole tries to be as transparent as possible. Applications are made with HTML, CSS, and Javascript.
Note
You can always use the “inspect” tool of your browser on a Swole application to view the code.
Core architecture¶
An application is represented by the Application
object. It contains references to one or several Page
object.
Each Page
has a unique route. The Page
is made of several Widget
object. These Widget
are the basic building blocs, used to create the content of each page.
Each type of Widget
is independently built into HTML. The HTML generated for each Page
is just the addition of HTML from each of its Widget
.
Styling¶
Styling is done using CSS, through the Skin
object.
Skin
is just a bunch of CSS rules. Each Page
is assigned a Skin
, and the styling of the elements of the Page
is done using the rules from the Skin
.
By decoupling style and content, changing the style of the page is as simple as using another Skin
.
Server-client interaction¶
For server-client interaction, Swole uses AJAX requests.
AJAX requests allow the web application to send and receive data from the server in the background. This allow the web page to change dynamically without the need to reload the entire page.
By using AJAX requests, we also have better control of what is send and when, as developer.
AJAX requests are represented by the class Ajax
, and can be easily declared using the decorator ajax
.