-
Notifications
You must be signed in to change notification settings - Fork 0
Building Applications
Using Roxy to building applications means splitting your code along MVC lines.
Controllers take user inputs, converts them into parameters to model functions. The controller also sends data to the view and can modify the default view or layout to use. Roxy provides controller helpers and request helpers.
In an XML-based, document-oriented database like MarkLogic, the in-memory data structures and the way the data are stored are basically the same, so the impedance mismatch isn't a problem. Here, your models encapsulate related functionality. These library modules will be very much like the ones you use in other applications; in fact, you may be able to reuse code from other projects by putting it here.
An application will often need to respond to the same requests using different formats. By using views (and layouts), database interaction and business rules are separated from the presentation layer, so results can be returned as HTML, XML, JSON, or whatever format is needed. Roxy provides view helpers.
Applications frequently have parts of their user interface that stay the same across most of the application. For instance, the header and footer may stay basically constant, while the content between them is different on every page. The constant parts are the layout; the changing parts are the view.
This directory provides a home for reusable presentation-layer code. When you have a feature that appears on multiple pages, abstract it out and put it in a helper library.