OOP: Review Session

Learning Goals

By the end of this session, you will be able to:

  • Synthesize your understanding of objects and OOP principles
  • Compare and contrast several different implementations of a game based on your knowledge of OOP thus far
  • Assess the pros and cons of approaching the same problem in a variety of ways
  • Identify code smells

Structure (5 mins)

  • 10 mins of reflection
  • 30 mins of research and journaling
  • 15 mins of group discussion
  • 30 - 40 mins of code review

Reflection (10 minutes)

In your FitLit Pairs, get with another pair and discuss what it was like to structure your code around objects. Focus specifically on:

  • What didn’t we teach you, that would have been helpful to know?
  • How did you stray from the class structure that the spec outlined, if at all? Why did you do that?
  • Are there any changes you would have made to the code in your classes based on feedback you received or if you had additional time?

Research (20 minutes)

Take a few minutes to go through the readings listed below. Take note of your thoughts and questions as you read. Make a habit of condensing and paraphrasing what you read. As you finish each section or page, how well can you explain key terms and ideas without reproducing the author’s words? You will have an opportunity to discuss your findings within your small group.

  • STUPID to SOLID
  • SOLID Principles

    Note: Although the code examples are in PHP, these design principles still apply to JavaScript. As of yet, JavaScript does not support interfaces without using outside libraries like Implement.js. TLDR: both implements and extends create subtypes. The former sets up a “contract” to implement the methods declared in the supertype, the latter inherits code from the supertype

  • Bad OOP Design Discussion
  • Code Smells

Journal (10 minutes)

After you have finished reading the four articles, answer the following questions:

  • What constitutes code that follows good OOP principles?
  • Define “code smell.” Name at least 3 specific examples of a code smell from a current or previous project.
  • What new information have you learned from one (or all) of these readings?
  • What questions do you have after reading through these?

Discussion (15 minutes)

Using the journal questions to guide you, start a discussion within your small groups.

Code Review & Group Discussion

Jeopardy
Wheel of Fortune

Get in your GameTime groups. You will be reviewing two codebases that have implemented games in OOP

While reviewing the code, ask yourself the following questions:

  • Is all the code easily understood?
  • Is there any redundant or duplicate code?
  • Does the code follow the principle of single responsibility?
  • Do the names used in the application convey intent?
  • Looking back at the reading covering code smells - find two examples of a code smell in either of the codebases. What changes would you make to this particular piece of code to not make it smell?
  • Find two examples of good OOP design, based on the readings

Closing

Within your original group, discuss the following questions -

  • What new information have you learned from the readings? From the code review?
  • How will this effect the way you continue to write your GameTime projects? Is there any code you now would like to change?

Lesson Search Results

Showing top 10 results