The Codist - Programmerthink

The Fiche Framework, Part 1

Posted: 12/03/2006, Perm Link Readers: 565


Fiche is my latest framework, the initial (working) version taking about 3 weeks of development to get to the stage you see. At my previous employer I wrote a Wicket-like framework in about 2 months which was abandoned when I left the company to pursue my own start-up.

I learned a lot in having done this before (actually I have written a couple other partial web frameworks in the past), in addition to working with a whole slew of web frameworks over the years. What I want most in a web framework is:

  1. ease of design/development
  2. minimal configuration
  3. good performance

Of course many web frameworks claim to have these as well, and many do; however none actually excited me other than WebObjects, which is about the oldest web framework in existence. In the past it has always cost too much money for deployment (though I believe it will become free in Leopard). Even WO has the same difficulty with connecting program information to HTML as most frameworks do, and I decided to do something different.

Simple to me might confuse the heck out of someone else but I am writing this for myself first before I even think of getting anyone else involved.

Fiche is built on a fairly normal basis in Java (5) and has the following technology stack:

I used the H2 database to store all the site artifacts except static stuff (like images) and currently the AFL data files (for now). The database has many CMS features in place, some not quite fully developed in this early version. In the schema are the usual person/role/permission management, sites, pages, content and misc tables. The database supports versioning and staging, two basic CMS features, currently only minimally supported in the code but fully designed. I have also implemented basic support for Jackrabbit Repository, but decided to stick with the database for now. Assets such as images and the like will be stored on disk with references in the database.

I spent a year or so as a Documentum Architect so the whole CMS idea is nothing new to me.

iBatis is my favorite choice for an ORM solution, mainly due to its low level approach which allows me to easily use SQL without compromise. I automatically generate the iBatis Mappings and Java data objects from the master sql file. Hibernate is everyone's darling these days, but for my taste it has way too much configuration and features, and gets in your way far too much. I feel the same about Spring, which took a simple idea and created a monster.

If you can't tell my now, I do not like xml configuration files. I will tolerate a few (like web.xml, jetty's and iBatis') but I won't add any more if I can help it. You can't debug xml files.

Jetty (6) is the only application server I will use or support. It's fast, faster and fastest at serving content, supporting Ajax (via continuations) and staying out of your way. Compared to Jetty, Tomcat is a old cat on its 9th life. Since I have no need for EJBs (version 1, 2, or 3) there is zero point in Weblogic (used it for years since version 4.X) or Websphere (briefly hated it as well).

The Fiche framework sits atop the usual servlet, and is fairly normal in how it handles requests. GET requests are passed to Handlers, POST requests (and also ajax calls) are passed to Actions. The URL scheme is very REST like in design:

/servletname/sitename/pagename[/pagedetails]

Pages may be a single page like home or be a type with the rest of the url as the specification, like article/somenicetitle. Pages may collect content (like the home page) or simply show a single content item (like the article pages). Comments are handled as children of content items. Versioning support means each modification of content can be rolled back. In the near future I will be able to stage changes to pages and content so I can preview the site before making it live.

In the second installment I will talk about AFL and the features I plan to support.

Tags: java, fiche
x 02/20/2007 12:58

x

y 02/23/2007 10:03

y