Coding For a Living

rss

A place to share and comment about coding for a living.


DB Schema Design–Rethinking ‘Type’ Tables Pt 1 Mike McIntyre

If you are a typical business application developer you probably work with a database which is cluttered with ‘type’ tables e.g. InvoiceType, CustomerType, PaymentType, CreditCartType, OrderType, ItemType, ProductType – which all have a schemas similar to these:

     image

There are the same number of columns in each type table above. 

The data type of the columns are the same in all the tables. 

Some column names are the same in all the tables. 

Columns names that are not the same in all tables do follow the same naming rule in each table e.g. ItemTypeId, OrderTypeId, ListTypeId which all end with ‘Id’.

Given how similar these tables are, why not use 2-3 tables for all standard ‘type’ data, maybe something like this?

 

     image

More to follow in part 2 of ‘DB Schema Design–Rethinking ‘Type’ Tables’


vRAD Well Known Names– Part 2 Mike McIntyre

This post explains several ways well known names help my company build applications rapidly.

In my previous vRAD post I introduced ‘PostalCode’, a well known name I have used for application development since 1992.

In our development world, the well known word PostalCode is used where ever a zip code, post code, or postal code is represented or stored, for example:

1. as the column name of all database table columns that store a zip code, post code, or postal code

2. in data models where ever a zip code, post code, or postal code is used

3. as the property name in all classes that require a zip code, post code, or postal code

4. in programmer documentation

5. in code and other generators

PostalCode helps build applications rapidly because it reduces development and development project time.

How? Reuse. Reuse as in where the same thing is used again for the same function – again, and again, and again.  Since 1992:

1. No design time has been spent coming up with what to name things that will represent or store zip codes, post codes, or postal codes.

2. Programmer documentation about PostalCode has not been changed since 1992.

3. Anyone who has worked for me for more than a couple of months can teach a new person to use PostalCode because it is – you guessed it – well known.

4. Code generators, which require postal codes, post codes, or zip codes - for schemas, models, code, and tests – used the well known name PostalCode. We never spend time modifying that part of our code generators.

Can you think of at least three more ways the well known word PostalCode helps us build applications rapidly?

Answers will be published in the next xRad blog post..


xRAD Well Known Names– Part 1 Mike McIntyre

 

Well known names are part my rapid application development (xRAD) frame work. In this blog post I introduce a well known name that has helped me, since 1992, to rapidly develop applications for my clients.

In 1992 I decided PostalCode would be the well known name I would use for: postal code, post code,and zip code.

Zip code, post code, and postal code are different names for the same thing - a code that is appended to the end of addresses to make it possible to quickly sort mail.

PostalCode is consistently used in my databases, models, code, generators, snippets, control names – anywhere one of my applications uses a zip code, post code, or postal code.

Stay tuned for my next XRAD blog post in which I will explain how a well known name like PostalCode contributes to rapid application development.