Ruby, the programming language underlying Ruby on Rails, is an Object Orientated Programming (OOP) language. OOP's use of objects to store and manipulate data can point to a useful approach to use when deciding how to group data. That is, to consider the real world entities you are modeling with your application and then mapping the data objects to those entities. Groups of data are then defined as objects.
Let us use this approach to address Rory's problem on how far to separate his data down into object groups, by considering how the data relates to the real business entities he is trying to model.
So, how do we use this breakdown of data objects to decide how the data should be split? The best approach is to create a simple set of rules and then use those rules to test each data object to see if it passes or fails. The rules need to describe the features of a data object that makes it worthwhile separating them from the rest of the data and treating them separately.
Rory looks at his data, considers what he is trying to achieve by separating the data into objects, and comes up with the following rules:
Using these rules, Rory is able to remove email addresses, telephone numbers, and dates as candidates for separating into objects. Each of these items is a self-contained single entity within Rory's data, and therefore, fails both rule 1 and 3. With each of these, it is easiest to store them as single fields within the data and no obvious benefit is apparent from separating them out. They will need individual methods to handle them and carry out processes such as validation, but that is easy to handle at the field level.
This leaves people, companies, and addresses.
18.118.137.7