Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

6. The Data Model > Connecting Questions to Other Classes

Connecting Questions to Other Classes

The reason I originally left the Topic alone to start work on Question was that I needed to see what a Question looked like before I could say what a list of questions in chronological order looked like. I didn’t need to go quite as far as I did with Question before turning back to the interaction with Topic: It’s just easier for you, my beloved readers, if I don’t keep changing the subject all over the place. But speaking of changing the subject, let’s add a new feature to Topic.

So, how would I like to use code that returns an ordered list of questions, and how should I test that the questions are in the correct order? Unfortunately, although we’re told that the list must be “in chronological order,” the requirements don’t specify in which direction—that is, whether earlier questions should appear before later questions, or vice versa. I’ll follow convention offered by the iOS Mail app, and a number of third-party apps, in putting newer questions near the top of the list: I should make a note to talk to the customer about that requirement.5


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial