<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chui's counterpoint &#187; 4GL</title>
	<atom:link href="http://www.redmountainsw.com/wordpress/archives/tag/4gl/feed" rel="self" type="application/rss+xml" />
	<link>http://www.redmountainsw.com/wordpress</link>
	<description>pulling the rug</description>
	<lastBuildDate>Thu, 02 Sep 2010 08:20:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>4GL Patterns #14 &#8211; Data Validation Patterns</title>
		<link>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-data-validation</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-data-validation#comments</comments>
		<pubDate>Wed, 07 Apr 2010 13:06:51 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[MS Access]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/?p=908</guid>
		<description><![CDATA[Note, this is Part 14 in a series of posts documenting patterns used in RAD development of Line of Business applications. You can find more here  &#8211; 4GL Patterns
Lately, I&#8217;ve seen software frameworks starting to mark up properties with validation attributes. These are all simple single-field affairs 1, for example, rules such as 

Regular [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note, this is Part 14 in a series of posts documenting patterns used in RAD development of Line of Business applications. You can find more here </em> &#8211; <a href="http://www.redmountainsw.com/wordpress/4gl-patterns">4GL Patterns</a></p>
<p>Lately, I&#8217;ve seen software frameworks starting to mark up properties with validation attributes. These are all simple single-field affairs <sup>1</sup>, for example, rules such as </p>
<ul>
<li>Regular expressions (WCF RIA Service example)</p>
<pre><code>[RegularExpression("[A-Z][A-Za-z0-9]*")]</code></pre>
</li>
<li>String length (minimum, maximum)</li>
<li>Required field</li>
<li>Not nullable text fields</li>
</ul>
<p>These are not much different to the <a href="http://www.redmountainsw.com/wordpress/archives/4gl-patterns-5-in-schema-validation">In-Schema validation</a> mentioned earlier.</p>
<h2>Complex validation</h2>
<p>We have so far dealt with simple validation on a single field. There are some practical situations which require validation of two fields together.</p>
<ul>
<li>Password confirmation boxes (both passwords must be the same)</li>
<li>Date range (the &#8220;from&#8221; date must be less than the &#8220;to&#8221; date)</li>
</ul>
<h2>Highly complex validation</h2>
<p>Sometimes an entire data structure may need to be validated. These are rare. For instance, when splitting payments on an accounting system, we need to validate that the totals balance. This type of validation span multiple records.</p>
<p>Another example is validation of addresses. One might wish to validate the zipcodes are consistent with the States provided. In addition, there may be third party services that provide address validation. These validations span multiple fields (Street Number, Street Name, City, Zip, State).</p>
<h2>When not to validate</h2>
<p>Some times, it is necessary to <em>not</em> validate data.</p>
<ul>
<li>The user is postponing data entry, but wishes to save a draft.</li>
<li>The data has already been validated when the record was created. Two examples come to mind:
<ul>
<li>A task has to be scheduled for a <em>future date</em> (this is validated). However, when the task is completed, and marked as complete, the scheduled date should not be validated.</li>
<li>When a signed document is recorded in the database, we perform a validation that the signature is current, and has not expired nor revoked. However, if we record other metadata against the document (such as archival schedules), then we should not revalidate the signature, because the signature may no longer be valid.</li>
</ul>
<p>    In other words, the fields should only be validated if they are updated, or when a record is created, and left alone otherwise.
  </li>
<li>Increasingly, languages (such as XAML and JavaFX) which permit Two-Way databinding find that validation can get in the way of data entry. For instance, an email property field may require the entry of a properly formatted email address. If the user tabs away from a control with a mistyped email address, the email field needs to store the incorrect value so that the user can fix it later. One design pattern is to generate a ViewModel, which is a &#8220;Plain Old Object&#8221; or a struct that permits bad data, but will return a list of error messages if the data does not validate.</li>
<li>It is also worthwhile mentioning Jon Udell, who suggested that users should be allowed to override certain types of rigid validation rules, subject to these events being logged and audited. It will certainly help with better customer service, especially in exceptional situations.</li>
</ul>
<h1>Footnotes</h1>
<p><sup>1</sup>XForms, through XML Schemas, can also validate number of items in a list, using the minOccurs and the maxOccurs attribute.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-data-validation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Patterns with ASP.net MVC</title>
		<link>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-asp-net-mvc</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-asp-net-mvc#comments</comments>
		<pubDate>Wed, 28 Oct 2009 14:12:22 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/?p=862</guid>
		<description><![CDATA[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 &#8211; a sane toString() for tabular listings
Simple Display Text &#8211; a sane toString() for summarizing [...]]]></description>
			<content:encoded><![CDATA[<p>Brad Wilson has a nice long post about the <a href="http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html">use of model metadata in ASP.NET MVC</a>.</p>
<p>While most of these do not deal with database operations, they have a certain place in database modelling. The following are must haves:</p>
<ul>
<li>Short Display Names &#8211; a sane toString() for tabular listings</li>
<li>Simple Display Text &#8211; a sane toString() for summarizing complex displays</li>
</ul>
<p>I&#8217;m sure there are more gems to be mined from ASP.Net MVC. If anyone who knows more, please e-mail me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-asp-net-mvc/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using patterns to accelerate software development</title>
		<link>http://www.redmountainsw.com/wordpress/archives/using-patterns-to-accelerate-software-development</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/using-patterns-to-accelerate-software-development#comments</comments>
		<pubDate>Fri, 24 Jul 2009 05:48:45 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/archives/using-patterns-to-accelerate-software-development</guid>
		<description><![CDATA[An Australian company is working on a AusIndustry grant on rapid application modelling. 
I&#8217;d love to interview these guys on the blog just for some insights they gained from the process.
]]></description>
			<content:encoded><![CDATA[<p>An Australian company is working on a AusIndustry grant on <a href="http://www.ptg-global.com/software/xpdesigner-full-application-simulation-no-programming/xpdesigner-full-application-simulation-no-programming_home.cfm">rapid application modelling</a>. </p>
<p>I&#8217;d love to interview these guys on the blog just for some insights they gained from the process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/using-patterns-to-accelerate-software-development/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4GL Patterns #13 &#8211; Read Only Fields</title>
		<link>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-read-only</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-read-only#comments</comments>
		<pubDate>Thu, 26 Feb 2009 11:45:06 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/?p=708</guid>
		<description><![CDATA[Note, this is Part 14 in a series of posts documenting patterns used in RAD development of Line of Business applications. You can find more here  &#8211; 4GL Patterns
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 [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note, this is Part 14 in a series of posts documenting patterns used in RAD development of Line of Business applications. You can find more here </em> &#8211; <a href="http://www.redmountainsw.com/wordpress/4gl-patterns">4GL Patterns</a></p>
<p>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?</p>
<p>Possible justifications:</p>
<ul>
<li>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.</li>
<li>The field represents an integration field. For instance, an account_details table may have it&#8217;s e-mail and telephone fields populated from an LDAP source. By marking up the metadata consistently, the user interface automatically renders a field as label, or as a locked text box.
</li>
</ul>
<p>Validation checks should not apply to read-only fields. A clever code generator should warn the developer that validation rules have been applied on read-only fields, and these rules should be turned off.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-read-only/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Patterns realized with AribaWeb</title>
		<link>http://www.redmountainsw.com/wordpress/archives/database-patterns-realized-with-aribaweb</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/database-patterns-realized-with-aribaweb#comments</comments>
		<pubDate>Sat, 21 Feb 2009 01:56:39 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/archives/database-patterns-realized-with-aribaweb</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>Take a look at <a href="http://www.aribaweb.org">aribaweb.org</a> (via<a href="http://www.theserverside.com/">TheServerSide</a>). </p>
<p>AribaWeb is a 4GL RAD for web applications running on a Java stack.</p>
<p>It uses an approach described in <a href="http://www.redmountainsw.com/wordpress/archives/4gl-patterns-6-data-dictionaries">data dictionaries as a database pattern</a> to generate metadata-driven UI.</p>
<p>The Ariba toolset seems reasonably mature from the screencasts, although one has to be wary because a lot of the AJAX work appears to be relatively new.</p>
<p>I&#8217;m watching the <a href="http://www.vimeo.com/1840925">MetaUI screencast</a> now, and the bubble style error messages on fields is quite cool. However, cooler still is the use of CSS-like language to mark up how fields are presented. This reduces impedance mismatch between binding data to controls, instead turns data into its representation.</p>
<p>Custom validation rules is specfied using a groovy string. I&#8217;m not sure if this is translated into Javascript on the client-side. The Meta UI specification decoupled from HTML (layout is in named zones), and there is no reason why this couldn&#8217;t be rendered in a RIA.</p>
<p>Actions in UI on a POJO is declared via an annotation (similar to Naked Objects). However, the actions seem to be more restrictive in the sense that the methods must not take any arguments.</p>
<p>e.g.</p>
<pre class="brush: java">
@Action(message=&quot;Account Suspended&quot;)
@Visible(&quot;! $object.isSuspended&quot;)
void suspendAccount() {
...
}
</pre>
<p>Overall, AribaWeb looks very polished. I haven&#8217;t had a look at the underlying libraries used<sup>1</sup>, but I look forward to delve into it further.</p>
<h2>Footnotes</h2>
<p><sup>1</sup>There was a mention of JPA and Hibernate. (Is the display layer JSF?)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/database-patterns-realized-with-aribaweb/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>4GL Patterns #12 &#8211; Deploying Reference Tables</title>
		<link>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-reference-tables</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-reference-tables#comments</comments>
		<pubDate>Sun, 07 Dec 2008 01:05:23 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/?p=594</guid>
		<description><![CDATA[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, &#8230; use the REF TABLE .. Ref tables are identical to regular tables, except that they are replicated automatically across the development, testing, and production environments. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codaserver.com/">Coda Server</a> uses a concept called <a href="http://codaserver.com/?q=node/36"><em>Reference Tables</em></a>. I first <a href="http://www.redmountainsw.com/wordpress/archives/4gl-patterns-8-table-patterns">heard the term</a> used by <a href="http://database-programmer.blogspot.com/2008/01/database-skills-sane-approach-to.html#rule1">Ken Downs</a>.</p>
<p>The interesting twist brought by Coda Server is in deployability.</p>
<blockquote><p>In the countries table, &#8230; use the REF TABLE .. Ref tables are identical to regular tables, except that they are replicated automatically across the development, testing, and production environments. Any rows added, updated or deleted in those environments immediately percolate to all of the others. This is perfect for data such as countries which generally don&#8217;t change based on your application&#8217;s whims.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-reference-tables/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>4GL Patterns &#8211; #11 Custom Data Types</title>
		<link>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-custom-dat-types</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-custom-dat-types#comments</comments>
		<pubDate>Tue, 30 Sep 2008 05:40:58 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/?p=558</guid>
		<description><![CDATA[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 &#8211; 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, [...]]]></description>
			<content:encoded><![CDATA[<p>Rapid application development usually require data types beyond the simple INT, FLOAT and VARCHAR found in databases.</p>
<p>Here are some examples gleaned from existing frameworks:</p>
<ul>
<li><a href="http://en.wikiversity.org/wiki/ADempiere_Application_Dictionary">Compiere/ADempiere</a> &#8211; 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, Number, Printer Name, Product Attribute, Quantity, Search</li>
<li><a href="http://plone.org/documentation/manual/archetypes-developer-manual/fields/fields-reference">Plone Archetypes</a> &#8211; CMFObjectField, ComputedField, ImageField, FilesField, LinesField</li>
<li><a href="http://www.codeigniter.com/">CodeIgniter</a>/Django &#8211; URL, Email</li>
<li><a href="http://xml.coverpages.org/udef.html">UDEF</a> &#8211; Amount, Code, Graphic, Measure (Unit of&#8230;), Percent, Picture, Rate, Document</li>
<li>Miscellaneous &#8211; tag</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-custom-dat-types/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4GL Patterns #10 &#8211; Auditability</title>
		<link>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-10-auditability</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-10-auditability#comments</comments>
		<pubDate>Mon, 22 Sep 2008 13:28:51 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/?p=548</guid>
		<description><![CDATA[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 &#8211; history is mixed with current data in a single table. Results in complicated joins, archiving problems, performance trouble
Naive history tables &#8211; a [...]]]></description>
			<content:encoded><![CDATA[<p>I have seen this pattern occur several times in my career. Ken Downs has <a href="http://database-programmer.blogspot.com/2008/07/history-tables.html">a comprehensive treatment on history tables</a>.</p>
<p>There are several high level ways of describing how versioning/auditability is implemented:</p>
<ul>
<li><strong>Versioned rows</strong> &#8211; history is mixed with current data in a single table. Results in complicated joins, archiving problems, performance trouble</li>
<li><strong>Naive history tables</strong> &#8211; a mirror table that adds three additional columns &#8211; action (Create, Update or Delete), timestamp, and user</li>
<li><strong>Delta tables &#8211; </strong>records table, primary key, old value, new value, action (Create, Update, or Delete), timestamp, and user</li>
</ul>
<h2>Implementation</h2>
<p>Web applications tend to share database connections. This restriction means that we cannot implement auditing via database triggers, since the trigger does not have access to the current user. Instead, auditing is implemented at the database abstraction layer.</p>
<p>Oracle has a construct called SYS_CONTEXT (see: <a href="http://articles.techrepublic.com.com/5100-10878_11-6170613.html">TechRepublic</a> <a href="http://technology.amis.nl/blog/?p=777">AMIS</a>)</p>
<h2>Users, Groups and Elevated Privilege</h2>
<p>Any non-trivial business applications tend to have functionality beyond simple read/write permissions. Examples of this kind of use-cases can be seen in <a href="http://www.opengroup.org/onlinepubs/000095399/functions/setuid.html">setuid</a> in unix applications. Any audit-aware applications should take this into account, and log the real user id.</p>
<h2>Examples</h2>
<ul>
<li><strong>Document-type artifacts</strong> &#8211; for instance, if an organisation was tracking licenses, the address of the licensee should be recorded permanently. If the address changes, then a new row has to be created, so that it maintains a faithful record as to what the original issued license represented.</li>
<li><strong>Auditing</strong></li>
</ul>
<h2>See Also</h2>
<p>Data Dictionaries</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-10-auditability/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4GL Patterns #9 &#8211; Search</title>
		<link>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-9-search</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-9-search#comments</comments>
		<pubDate>Mon, 22 Sep 2008 13:15:55 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/?p=543</guid>
		<description><![CDATA[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 &#8211; MySQL, SQLite, SQL Server
Query By Example (QBE) in MS Access &#8211; is a special case where all fields are made searchable
Autogenerated modal forms with search/filter capabilities. Used when look-up [...]]]></description>
			<content:encoded><![CDATA[<p>Specific fields are marked as being searchable. User interface and code is automatically generated. </p>
<h2>Examples of Search in RAD</h2>
<ul>
<li>Adding Full Text Indexes to char columns &#8211; MySQL, SQLite, SQL Server</li>
<li>Query By Example (QBE) in MS Access &#8211; is a special case where all fields are made searchable</li>
<li>Autogenerated modal forms with search/filter capabilities. Used when look-up tables get large</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-9-search/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4GL Patterns #8 &#8211; Table Patterns</title>
		<link>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-8-table-patterns</link>
		<comments>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-8-table-patterns#comments</comments>
		<pubDate>Mon, 22 Sep 2008 13:03:41 +0000</pubDate>
		<dc:creator>Chui</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[4GL]]></category>
		<category><![CDATA[rad]]></category>

		<guid isPermaLink="false">http://www.redmountainsw.com/wordpress/?p=540</guid>
		<description><![CDATA[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 &#8211; small number of columns, small number of rows, permanent. e.g. U.S. States. Also see Reference Table Deployability
Small Master Table &#8211; small number of columns (but more than a simple [...]]]></description>
			<content:encoded><![CDATA[<p>Ken Downs <a href="http://database-programmer.blogspot.com/2008/01/table-design-patterns.html">classified database tables into several patterns</a>. These are grouped along the lines of number of columns, number of rows, transient vs. permanent:</p>
<ul>
<li><a href="http://database-programmer.blogspot.com/2008/01/database-skills-sane-approach-to.html#rule1">Reference Table</a> &#8211; small number of columns, small number of rows, permanent. e.g. U.S. States. Also see <a href="http://www.redmountainsw.com/wordpress/archives/4gl-patterns-reference-tables">Reference Table Deployability</a></li>
<li><a href="http://database-programmer.blogspot.com/2008/01/database-skills-sane-approach-to.html#rule2">Small Master Table</a> &#8211; small number of columns (but more than a simple reference table), small number of rows, permanent. Master tables hold data, rather than look up information. e.g.</li>
<li><a href="about:blank">Large Master Table</a> &#8211; transactional</li>
<li><a href="about:blank">Cross Reference</a> &#8211; describes <strong>has-a</strong>, <strong>many-to-many</strong> and other relationships</li>
</ul>
<p>Ken goes on to suggest the types of primary keys for each type of table, e.g. Single-column CHAR primary keys for Reference and Small Master tables; Auto-assigned integers for Large Master tables; and Compound keys for Cross Reference.</p>
<p>I would like to add that tables should be explicitly annotated for their patterns and expected usage.</p>
<h2>Applicability and Consequences</h2>
<ul>
<li>Code generation tools can then intelligently cache slow changing patterns in-memory, during application start-up, or upon first-use.</li>
<li>Character primary keys can be used as shortcuts for rapid data entry</li>
<li>Look up controls can be auto-generated when reference tables are used in foreign keys</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.redmountainsw.com/wordpress/archives/4gl-patterns-8-table-patterns/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
