Skip to content
/ Spindle Public

Simple and powerful MVC web framework for Tcl using XOTcl OO framework

Notifications You must be signed in to change notification settings

Setok/Spindle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a powerful yet simple MVC web framework for Tcl and XOTcl. It 
reflects many of the aspects of Tcl itself in that it gives the groundwork for
a wide range of things you might like to do. It gives you the power to
develop.

It combines (negative) experiences with some other systems and several ideas
the author has had, over the past couple of years.

Some of the features:

* Proper separation between controllers and views. A controller knows nothing
  about the view attached to it. This offers great possibilities for unit
  testing or various different views and rendering systems. Views only
  expect their controllers to provide an interface they can use.

* A very effective pattern where URLs are first connected to a
  controller. Then sub-URLs and POST submissions are linked to methods
  which handle them, possibly altering stored data, or data internal
  to the controller (ready for the view to render). These methods, and
  the controller, do not do any rendering. They just provide
  functionality and set up values for a separate View. Thus a tab controller
  could have different sub-URLs for each tab, each setting the internal
  state of the controller. A matching view then renders the relevant tab.

* Based on a widget model. Each controller can contain several widgets and
  their sub-widgets. Have one widget for lists of data, another for
  help information. Other widgets and their views can then use those 
  sub-widgets to build up the information displayed to the user. 
  This offers great opportunities for code reuse and a
  very clean pattern for building web applications.

* A simple, yet extremely effective template language. While templates 
  should be kept straightforward, with the actual functionality and logic in 
  controllers, they often require control structures and flexibility.
  Instead of creating Yet Another Language the Spindle template system
  uses embedded Tcl via a very simple yet powerful mechanism. That
  environment has some added and replaced Tcl commands for easy use within
  a HTML environment (e.g. [foreach] uses a HTML/template lang body, instead of
  code). Templates can directly query for the data provided
  by their controllers.

* Widgets will often have a default view, configured by the script that
  initialised them. However, this can be changed to get completely new
  rendering, with the same backend functionality.

* Simple and powerful form mechanism. Specify the object you want to 
  have represent the form. It can verify its own values, if deemed
  necessary. It then gets passed to the matching
  form method handler in the controller.

* Does not have a built in ORM. You are free to use the storage model you
  prefer. One option is to use the 'Storm' transparent and queryable
  object storage:
  http://github.com/Setok/Storm

* Built on top of the XOTcl Httpd. No separate web server required and can
  be easily embedded into any application.

Note that this is not even beta software yet. It is early alpha at 0.1. While
it has been tested to work, and has been used, do not be surprised if interfaces
change, even dramatically. It is released for fellow developers to experiment
with and to submit changes.

You are free to use the source in any way you please, without announcing to
the authors or anyone else. Of course credit where due is appreciated (but
not required).

Check 'spindleserver.tcl' for how to run a web server.

Check 'example' for some examples of widgets and how they are tied to
the Spindle environment.


Dependencies:

* Fishpool's Tcl codebase "Fisk-Tcl" should appear in one of the directories
listed in TCLLIBPATH, or as a directory in the directory where Spindle is. I
tend to just symlink the directory in. Available from:
https://chiselapp.com/user/Setok/repository/Fisk-Tcl/home

* XOTcl 1.6 - http://www.xotcl.org/

* Tcl 8.5 - http://www.tcl.tk/

* Tcllib


Authors:

Kristoffer Lawson, setok@scred.com
Twitter: @Setok
http://people.fishpool.fi/~setok/

About

Simple and powerful MVC web framework for Tcl using XOTcl OO framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages