We are now ready to plan the application we want to build. This is where we distill abstract ideas, visions and goals into a concrete plan we can use to build our API. This process is more of an art than a science, and what works for one programmer may not work for another.
We are now ready to plan the application we want to build. 0:00 This is where we distill abstract ideas and 0:04 goals into a concrete plan we can use to build our API. 0:06 Next, we'll describe what we want to be 0:09 able to do with our up use in simple English phrases. 0:12 Then we'll break those phrases into nouns and verbs, doing this will help us 0:16 think about our application structure In a way that is easy to understand. 0:20 Let's think about the phrases that describe actions in our application. 0:25 We'll break them into simple verbs like ask, rate and 0:29 vote followed by nouns such as question and answer. 0:32 We want to be able to ask a question. 0:36 Once a question has been asked, we want to be able to read the question. 0:39 Once we have a question, we want to be able to answer a question. 0:44 We'll also want to read the answers. 0:48 Let's offer a way to edit an answer and delete an answer. 0:52 Lastly, we want to be able to vote on answers. 0:56 Notice the nouns in each of the phrases are question [SOUND] or answer [SOUND]. 1:01 That's because questions and answers are the objects our API will provide. 1:06 The verbs in each of the phrases tend to 1:12 indicate the action we want to perform on our objects. 1:15 When we ask a question, we actually mean we want to create a question object. 1:18 And when we say edit an answer, or 1:25 editing the vote count on an answer, we're updating an answer. 1:27 And that's the end of the process. 1:32 We now know we'll need two objects, a question and an answer. 1:34 Our question objects will need to be created and read. 1:39 Our answer objects will need to be created, read, updated, deleted, 1:42 and voted on. 1:47 If you've worked with databases before, you may have recognized the verbs, 1:48 create, read, update, and delete, also known as quote. 1:52 These quit operations map nicely to the operations 1:56 you'd want to perform with a rest API. 1:59
You need to sign up for Treehouse in order to download course files.Sign up