Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Lesson 7 (Interfaces)

Sally Steuterman edited this page Jul 28, 2020 · 1 revision

Lesson 7: Interfaces and Polymorphism

In the prep work this week, the students learned

  1. What polymorphism is.
  2. What interfaces are and the difference between interfaces and abstract classes.
  3. Different interfaces that are a part of C#, and how they can be used in our code.
  4. Best practices around unit tests and interfaces.

Announcements

  1. Graded Assignment #2 is due soon!
  2. Check with your course manager for any important announcements.

Large Group Time (Instructor)

Lesson 7 Topics That Require Careful Attention

  1. Polymorphism has a deceptively simple definition, but can be difficult to grasp. Have students share what polymorphism is to them and share examples to drive home this particular pillar of OOP.
    1. These examples could be continuations from the reading, such as the IFeedable interface and the Cat and HouseCat classes.
  2. Interfaces may not seem to serve much of a purpose to some. Go over some sample code or class diagram and explain why those behaviors were assigned to an interface. To drive it home, share what behaviors might go in an abstract class.
    1. For the sample, it would be good to share an example that is similar to something you may have worked on. Part of the reason some people may not be seeing the purpose in interfaces is because of the size of the application that we are building. In larger applications, the usefulness of interfaces becomes evidently clear. Also, sharing something like this can drive home that coding interfaces are an essential skill for C# programmers.

Small Group Time: Lesson 7 Studio (TA Notes)

  1. For this studio, go over with your group their thoughts on which behaviors are going to belong to the interface and which ones are going to belong to the abstract class. After everyone feels comfortable with the theory, they can code away!
  2. Remember to check in with every student in your group about how things are going and why they are making the design decisions they are making.