I (am just a developer) am tasked with training my team on a technique or technology. I zeroed upon System Interfaces, IComparable and IEquatable to be specific. How does one go about teaching (even if it is 1 hour), what an IComparable is and where we can use it by giving them an example.
However, I am not entirely sure whether that would make my team to understand and start using IComparable.
In my project, however, I do have a Discount class and there are instances where I have to merge two lists of Discounts. Now, that would be a really good instance of where IEquatable would be helpful when I do the merge wouldn't it?
I had the following template for training.
- Introduction: Why does one need IComparable? (And, I could not get an answer that I can use for teaching).
- Structure of IComparable (Again, what else can I talk about other than CompareTo method).
- Sample Code
- Where we can use that in our project
- Questions.