This repository has been archived by the owner on May 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Lesson 7 (Interfaces)
Sally Steuterman edited this page Jul 28, 2020
·
1 revision
- What polymorphism is.
- What interfaces are and the difference between interfaces and abstract classes.
- Different interfaces that are a part of C#, and how they can be used in our code.
- Best practices around unit tests and interfaces.
- Graded Assignment #2 is due soon!
- Check with your course manager for any important announcements.
- 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.
- These examples could be continuations from the reading, such as the
IFeedable
interface and theCat
andHouseCat
classes.
- These examples could be continuations from the reading, such as the
- 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.
- 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.
- 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!
- 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.