Back to the Data

Using the information that Rory has gathered, his next step is to separate the data from Mary's contact list into the data object groupings of people, companies, and addresses. To do this, he carries out the following:

  • The contact list is in Microsoft Outlook and Rory uses the Export feature of this program to create a single tab delimited text file. He then imports that into a spreadsheet which gives him a single table with all the field names across the top.
  • On a large sheet of paper, he creates three tables, each with two columns. He labels the three tables: People, Companies, and Addresses, respectively.
  • He then works through each of the field names, decides which data object the field belongs to, and enters that on his sheet of paper in the appropriate table in the left column. He starts with the first field Title that relates to the title a person uses, and is therefore a property of the person. So Rory enters Title in the left column of the People table. The next four fields follow Title into the People table. However, Company holds the contact's company name that is a Property of the company and therefore is the first entry in the Company table. In this way, Rory works through all the fields.
  • Once all the Outlook field names are separated into three tables, Rory goes through each one and in the right column of the table, he enters a new name for the field that will match Ruby on Rails' naming conventions. As he does this, he is able to identify some fields that will not be required in the new applications, and for these fields he skips the step of adding a Ruby on Rails name.

The address table requires a little extra thought. When Rory gets to this table, he sees that there are three sets of Address fields listed (business, home, and other). Each set of addresses has the same types of components (Street, Street 2, Street 3, City, State, and Postal Code). Therefore, the three addresses can be entered into a database as three separate entries in the same table.

Back to the Data

The end result is shown below.

Back to the Data

Note

When exporting data into comma delimited text files, commas within the source data can cause a lot of problems when processing data later. Using a tab delimited text file output format usually leads to fewer problems and I recommend using tab delimited files rather, than comma delimited files, whenever possible.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.187.210