Archives for the Month of September, 2008

4GL Patterns - #11 Custom Data Types

Rapid application development usually require data types beyond the simple INT, FLOAT and VARCHAR found in databases.
Here are some examples gleaned from existing frameworks:

Compiere/ADempiere - Account, Amount, Assignment, Binary, Button, Color, Costs+Prices, Date, Date+Time, FileName, FilePath, ID, Image, List, Location (Address), Memo, Product Attribute, Quantity, Row ID, Table, TableDirect, Text, Text Long, Time, URL, Yes-No, [...]

What does Web 2.0 software testing look like?

The screenshots of $20/month Software-As-a-Service Manual Test tool shows how disruptive the web can be for existing business. In this case, these guys are competing with featureful competitors like Mercury Test Director.
Other possibilities can be achieved by stitching together solutions involving
1) Mechanical Turk
2) Puppet
3) Virtualization
Bugs might be solved a similar way, using a [...]

4GL Patterns #10 - Auditability

I have seen this pattern occur several times in my career. Ken Downs has a comprehensive treatment on history tables.
There are several high level ways of describing how versioning/auditability is implemented:

Versioned rows - history is mixed with current data in a single table. Results in complicated joins, archiving problems, performance trouble
Naive history tables - a [...]

4GL Patterns #9 - Search

Specific fields are marked as being searchable. User interface and code is automatically generated.
Examples of Search in RAD

Adding Full Text Indexes to char columns - MySQL, SQLite, SQL Server
Query By Example (QBE) in MS Access - is a special case where all fields are made searchable
Autogenerated modal forms with search/filter capabilities. Used when look-up [...]

4GL Patterns #8 - Table Patterns

Ken Downs classified database tables into several patterns. These are grouped along the lines of number of columns, number of rows, transient vs. permanent:

Reference Table - small number of columns, small number of rows, permanent. e.g. U.S. States. Also see Reference Table Deployability
Small Master Table - small number of columns (but more than a simple [...]

What’s gone is gone

I had a look at my blog yesterday and to my horror, about 4 months of posts had disappeared. I agonized over whether I should go back over Google cache and repost lost articles, but in the end, I didn’t think it was worth the bother. After all, a blog is a notepad for ideas [...]

Learning Scheme macros

Thanks to Will Donnely’s Primer on Syntax-Rules, I finally got a headstart with Scheme macros.
What I find interesting about Scheme macros is that it uses the ellipsis (…) very intuitively when expanding macros.
For instance
[code lang="Scheme"]
;Next line for Guile only
(use-syntax (ice-9 syncase))
(define-syntax repeat
(syntax-rules ()
((repeat a1 …)
[...]

4GL Patterns #7 - Data Dictionaries

RAD thrives on autogenerated forms, autogenerated bindings, and autogenerated validation rules.
To support RAD, database dictionaries should contain hints that form libraries can use.
Here is a compilation of useful rules, gleaned from several forms libraries (XForms, MS Access):

field caption
tooltip
default value
full text search (KeywordIndex)
isMetadata (Archetypes Field Reference)
postback (Archetypes Field Reference) - False for password fields. If validation [...]

4GL Patterns #5 - Field Filters

I have encountered this pattern twice. Once in CodeIgniter, and another time in Django. 
The basic idea is to pipe values through a series of filters before it is displayed in the presentation layer, or before it is saved in the database. These filters, if stored in a schema definition, can be applied globally to an [...]

Has the JVM design been holding back Java?

[Note: I've reposted this (with minor edits) as my original post got accidentally deleted. Thanks to Google cache]
Why is it? Why is it that Java applets -despite having the first mover advantage - achieved little traction. While Flash - a tool which targets graphic designers originally - continue to gain mindshare, and is now a [...]

4GL Patterns #5 - In-Schema Validation

There are several ways a database application can enforce that valid data is entered. These can be categorized into: database level, application server level, and client-side.

(database level) field type: DateTime, Characters, Characters up to a Maximum Length, Nullable, Zero Length string
(database level) foreign key constraints
(database level) Databases like MSAccess and SQL Server supply additional field [...]

4GL Patterns #4 - Type Converter Pattern

Database types which have a text representation include Currency, Date/Time, Boolean fields. If these fields are presented in text boxes, then appropriate formatters and parsers are used to translate text into actual model values and vice versa.
There are two types of parsers:

strict where field masks are provided to ensure the user typed in data in [...]

4GL Patterns #3 - Database Update Patterns

There are three ways data on a form can be posted back to the server.

Auto-Commit, where changes are applied to the database once user navigates away from a record.
Batch, where changes to records are saved as a batch when the user explicitly actions the Save command
Autosave to pending, where changes are saved to a temporary [...]

4GL Patterns #2 - Save and Action Pattern

The “Save and Action Pattern” allows a user to perform Save, followed by another action in a single click.
This is used to facilitate rapid data entry, or when users need to save intermediate results to prevent data loss.
The example below is from Django’s administration screens. The user is presented with three possible choices:

“Save and Add [...]

4GL Patterns #1 - Select or Add

A common pattern found in database applications is the “Select or Add” pattern.
The pattern allows a user to either

select an existing item (usually a foreign key), or
to add a new item to the foreign key table, then refresh the combo box, and setting the item to the newly added one

Example
The following is a screenshot [...]

Scheme Syntax-Rules

I have read the R5RS Spec a couple of times, but the section on syntax-rules makes dry reading, and I could never be bothered about figuring it out.
Now, if only computer science professors could learn to write like this teenager. Don’t you think Will’s tutorial on syntax-rules make the intention and usage clear?
Kudos, Will. [...]

Mitigating the Bus-Factor

How much of your software code base is at risk if one of your developers leaves the project, gets sick, or joins another company?
In large team projects, although the entire project may not be at risk, how do we identify which modules / components are at risk? Usually, a team can exercise some gut-feel [...]

Cygwin Python and sqlite3

Apparently, cygwin’s distribution of Python 2.5.1 doesn’t come with sqlite3. This is a pity for those who would like to work with Django using cygwin Python.
Building _sqlite3.dll on cygwin is not too difficult. If you are in a hurry, heres the download _sqlite3.dll.
Prerequisites

/bin/cygsqlite3-0.dll
/bin/libpython2.5.dll
/usr/include/sqlite3.h
/usr/include/python2.5/Python.h [et.c]

tar jxf Python-2.5.2.tar.bz2 Python-2.5.2/Modules/_sqlite/
cd Python-2.5.2/Modules/_sqlite/
gcc -shared -o _sqlite3.dll -I /usr/include/python2.5 -L /bin [...]

Has the JVM design been holding back Java?

Update:Looks like the post has been linked from DZone. Tell me what you think? What kind of projects would you choose Java applets over Flash or AJAX?

After all these years, Java’s applet has not seen much adoption, while Flash continue to gain mindshare. Applets suffer from slow start up times, crashing browsers, heavy resource usage. [...]

Was it a “Tie”, “Sash” or a “Dress”?

Sometimes I wish the reporters would take more accurate court records. Here’s a selection of headlines reported in Google News regarding the homicide of a young mother in New Zealand.