Archives for posts tagged ‘4GL’

Database Patterns with ASP.net MVC

Brad Wilson has a nice long post about the use of model metadata in ASP.NET MVC.
While most of these do not deal with database operations, they have a certain place in database modelling. The following are must haves:

Short Display Names – a sane toString() for tabular listings
Simple Display Text – a sane toString() for summarizing [...]

Using patterns to accelerate software development

An Australian company is working on a AusIndustry grant on rapid application modelling.
I’d love to interview these guys on the blog just for some insights they gained from the process.

4GL Patterns #13 – Read Only Fields

Some data dictionary mark certain fields as being read-only. Why should fields ever be read-only? How do they get edited in the first place?
Possible justifications:

The field represents a permanent record, i.e. it behaves more like a document than a database field. A field can be set at record creation time and no-other.
The field represents an [...]

Database Patterns realized with AribaWeb

Take a look at aribaweb.org (viaTheServerSide).
AribaWeb is a 4GL RAD for web applications running on a Java stack.
It uses an approach described in data dictionaries as a database pattern to generate metadata-driven UI.
The Ariba toolset seems reasonably mature from the screencasts, although one has to be wary because a lot of the AJAX work [...]

4GL Patterns #12 – Deploying Reference Tables

Coda Server uses a concept called Reference Tables. I first heard the term used by Ken Downs.
The interesting twist brought by Coda Server is in deployability.
In the countries table, … use the REF TABLE .. Ref tables are identical to regular tables, except that they are replicated automatically across the development, testing, and production environments. [...]

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, [...]

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 [...]

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 [...]

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 [...]