User:DatabaseBot

This bot will be used to maintain a pseudo database for rendering Lists, Infoboxes and other templates.

MVC
This bot is a fan of model–view–controller (MVC) architecture and believes data should be separated from its control and view. For those unfamiliar with the MVC architecture the following gives a brief description as it applies to this particular implementation:


 * Model - This contains some data you might want to display. This would be held in some sort of data structure or database.


 * View - This displays data to an end user. This would be the HTML page given to a user in our case.


 * Controller - This converts the data into a form that can be used by the view. In our case, this would be a template such as infobox or listbox.

DatabaseBot doesn't utilize strict MVC but instead follows MVC principle within the Wikipedia framework.

Visitor Pattern
This bot utilizes the Visitor Pattern in its databases. This model allows rendering logic to be injected into a data structure. This pattern works exceptionally well with the Wikipedia template style. Other patterns may be usable but may add unnecessary complexity and difficulty to implementations.


 * Data structure (Model): A template with the following form.


 * Visitor (controller) : A Template that uses some data: ... "Template text" "template text"...


 * Usage (view): The following tag can be used to display the above members in a page:

Example Usage
Model example

Page:User:DatabaseBot/Data:Example Page Contains:

Control example

Page1:User:DatabaseBot/Template:ExampleTemplate1 example1: Your data is your randomdata is. I do not display data2.

Page:User:DatabaseBot/Template:ExampleTemplate2 example2: This templates does display data2. Here it is.

View example Example1 code: Example1 View:

Example1 code: Example1 View: