This section contains several design patterns that can help you design and structure your models. Structural patterns mentioned here would help you realize the relationships between models more effectively.
Problem: By design, model instances have duplicated data that causes data inconsistencies.
Solution: Break down your models into smaller models through normalization. Connect these models with logical relationships between them.
Imagine if someone designed our post table (omitting certain columns) in the following way:
Superhero Name | Message | Posted on |
Captain Temper | Has this posted yet? | 2012/07/07 07:15 |
Professor English | It should be Is not Has. | 2012/07/07 07:17 |
Captain Temper | Has this posted yet? | 2012/07/07 07:18 |
Capt. Temper | Has this posted yet? | 2012/07/07 07:19 |
I hope you noticed the inconsistent superhero names in the first column (and captain's consistent lack of patience).
If we were to look at the first column, we are not sure which spelling...