Refactoring Patterns Lab

Disordered Orders

Today, you are joining the Disordered Orders development team. You have been tasked with refactoring their order-creating application.

Setup

  • Fork and Clone this starter repo
  • Run update-database in the DisorderedOrdersMVC project
  • Run all test in the DisorderedOrdersTests project
  • If you run into any errors, reach out to your instructor!

The Refactors

Implement the following refactoring patterns. Check out a new branch (from main) for each of the refactoring patterns. That way you can always start fresh if you need to!

In your submission, we will ask for some reflection on each, so it would be helpful to keep notes as you go!

  • Extract Interfaces
  • Extract Methods
  • 🌶️ Move Methods
  • 🌶️🌶️ Extract Classes (We didn’t cover this one in class!)
  • 🌶️🌶️🌶️ Any other refactoring pattern that you think would make this code better

As you refactor, keep in mind that refactors should not cause any existing tests to break. You may need to add tests, but you should not remove or change any existing tests.

Submission

Create a slack message to all of your instructors. For each refactor that you completed, reflect on the following:

  1. What problem were you trying to solve?
  2. What refactoring pattern did you use, and why did you choose that pattern?
  3. How did the refactor go? What was easy/difficult about it, and would you do anything different if you had more time?

Lesson Search Results

Showing top 10 results