A Wagn Module, or "Pack", is the central mechanism for extending Wagn's functionality. Currently under development, its API will have three primary components:
- Model -- extend cards.
- View -- configure view behaviors by set (may be format-specific)
- Action -- specify behaviors by set, as triggered by various CRUD (create/read/update/delete) events on cards.
The three components roughly map to the model-view-controller (MVC) framework, but there are many significant differences:
- In a sense there is just one model: the card. Packs are not organized into different models, but into different sets of cards. Structure is fractal, comprised of cards within cards. And, unlike most any MVC platform, structure can be created dynamically by users.
- Views are organized both by set and by format. Views are fractal, too; there are views within views within views. Unlike in MVC, views do not depend on actions, and therefore can be used flexibly in many contexts.
- Like cards and views, actions are fractal; actions trigger actions. The RESTful web API features just the four HTTP methods: PUT, GET, POST, and DELETE, corresponding to the four "CRUD" actions: create, read, update, and delete. Extending Wagn involves hooking into the sequence of events triggered by these actions.