This is hard. – (referring to object-oriented design in general) attributed to G. Booch by T. Quatrani

The more dogmatic you are about applying a design method, the fewer real-life problems you are going to solve. – P.J. Plauger, Programming on Purpose, 1993

In this lab, you’ll continue work on programming and meet with your team.

Managing State in Expo Apps

Expo/ReactNative/React provides a number of ways to manage app data, including local and global state, Context, and reducers. This exercise focuses on Context.

Exercise 5.1

We’ll explore the use of React Context in this exercise by refactoring an app that uses Expo route parameters into an app that uses Context. The app displays a list of items for sale and gives details on them (see the example on the right).

When you have the updated app running on your device, save a screen shot of the main list with one or more of the items deleted (e.g. the example on the right has only two remaining items listed), and add a new lab05/README.md that answers to the following questions:

  1. Why couldn’t the original app, as implemented before you made the changes in this exercise, delete any items from the list?
  2. What would you do to update this app to allow users to add a new item and to update an existing item? Just explain what you’d do, without giving any code.
  3. Did the old implementation follow the best practices for URL parameters? Does the new version?
  4. Can what you’ve done in this exercise be seen as refactoring the original app?

Submit this application by pushing it to your cs262 repo, including: lab05/item-app/; lab05/screenshot.png; and lab05/README.md.

Building a Domain Model

Today, we focus on your domain model, but will update all your management, analysis and design materials.

Exercise 5.2

Meet with your teammates to build a domain model for your project.

This domain model will serve as the blueprint for the database schedule you build later in the project.

Checking In