Structural patterns
This section contains several design patterns that can help you design and structure your models.
Patterns – normalized models
Problem: By design, model instances have duplicated data that cause data inconsistencies.
Solution: Break down your models into smaller models through normalization. Connect these models with logical relationships between them.
Problem details
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 naming in the last row (and captain's consistent lack of patience).
If we were to look at the first column, we are not sure which spelling is correct—Captain Temper or Capt...