an eddy in the bitstream

Category: projects (Page 14 of 25)

Form philosophy

A form management package has one goal: to help preserve the integrity of data as it moves from server to client and back again.

Most form packages do two things: validate data and serialize data as (X)HTML. Some offer additional client-side validation checks via Javascript, etc. Others offer tight integration with particular data models.

Rose::HTML::Objects does both things well. RHTMLO allows you to define form classes that represent reasonably complicated data models, providing validation and serialization.

Some developers are of the opinion that serialization is not properly the function of a form manager because it blurs the line between view and model. I disagree. Proper and correct serialization is important to the validation process, and hence vital to the model. It is but one step in a series of validation layers.

Validation happens when a human being completes a (X)HTML form, as she self-monitors her attempt to enter good and correct data (“did I spell that correctly?”). Validation may happen again before the form is submitted, using client-side Javascript. Validation happens again when the server receives the request. Again, when the form object is initialized with the submitted data. Again, when the data is committed to storage. At every step checks are made to preserve what the client submitted and verify that the data conforms with what is expected and required.

Since serialization to and from (X)HTML is part of the roundtrip all data takes, a good form management tool should be able to handle (X)HTML creation as well as server-side validation. That’s not blurring the model/view line; it’s reflecting the reality that data must be handled by human beings and the web browser is one of the best tools we currently have.

Years pass, code grows, expectations … ?

It’s the OSCON time of year again. A couple of years ago I was in a hotel in Portland OR, coding up a KinoSearch implementation of Swish3. That was then. Two years later, Swish3 is really no further on, except that it has been largely refactored and is a much more stable, yet alpha, project.

Just remembering that tonight as I update the Perl bindings of Swish3 to use the new tokenization routines. It’s the kind of project that moves in fits and starts. I would have liked to have finished it years ago, but it would not be as good, since many of the refactorings I have made over the last couple of years have been the direct result of coding strategies I have learned in my $job(s) and other FOSS projects.

And I find I like my life this way, chipping away at building a better mousetrap while I sip New Belgium beer and listen to Robert Plant and Alison Krauss. Sure, it’s a sultry July evening, and my entire life occasionally floats through my mind like a grainy day at the beach, but hey: you only get this chance once, and building a better mousetrap is not a bad way to pass some idle moments.

Swish3 Status 19 April 2008

There’s been quite a bit of activity in the last month.

  • The C++ Xapian example now can search as well as index, and there are Perl equivalents using Search::Xapian checked into svn as well. The C++ code will read/write the swish.xml header; the Perl does not (yet).
  • The meta/prop id unique check now uses a hash for quick look up.
  • The test suite for libswish3 is totally restructured. Now using Perl’s Test::Harness and added a slew of new meta/prop tests. Alongside that were additions to the NamedBuffer debugging output to print each substring in the buffer.
  • Several new string-related utility functions for converting ints to strings and back. Also a new config hash for configration options that use a StringList instead of a simple string.
  • Fixed some mem leaks in the example .c programs and added more info to the swish_lint usage() output (including reminders about the various SWISH_DEBUG* env var values).

There are still several parser features yet to be implemented to support the Swish-e 2.4 config options, but those will likely take a backseat to getting a working swish3 Perl script running with SWISH::Prog and SWISH::Prog::Xapian.

« Older posts Newer posts »

© 2024 peknet

Theme by Anders NorenUp ↑