Object Oriented Programming with C# (2018)
4h 8mIntermediate2018-11-09
Authors

Anton Delsink
Programmer, Teacher
Course details
Learn how to use object-oriented programming (OOP) principles in C# to help simplify some of your more complex work. In this course, Anton Delsink explores the many features of C# that support object-oriented programming, including abstract classes, interfaces, and generic types. To help lend a real-world context to these concepts, Anton demonstrates how to use these features by example as he examines existing code and writes some new code. Throughout the course, he covers a wide range of scenarios—including examples from .NET, Windows UI, the web, and even board games—and discusses whether or not he adhered to OOP principles in different instances.
Learning objectives
Abstract classes
Processing text with StreamReader
IEnumerable and yield return
Windows Forms controls
Windows Forms with and without the designer
Adding, organizing, and testing forms
Creating classes
Inheritance
Learning objectives
Abstract classes
Processing text with StreamReader
IEnumerable and yield return
Windows Forms controls
Windows Forms with and without the designer
Adding, organizing, and testing forms
Creating classes
Inheritance
Skills covered
Object-Oriented ProgrammingC#PersonaProgramming LanguagesMicrosoftSoftware Development
Concepts
Introduction
- The wide world of object-oriented programming (OOP) with C#
- What you should know
Theory vs. Practice
- Theory vs. practice
- When a square is not a rectangle
- When a carpet is art
- Conclusion
Examples from .NET
- Introduction
- IEnumerable
- IEnumerable and foreach
- File.Open and .Close
- File.Close in the finally block
- Keyword using
- Opening FileStream with StreamReader
- Processing text with StreamReader
- IEnumerable and yield return
- TextReader as base of StreamReader and StringReader
- Conclusion
Examples from Windows UI
- Introduction
- Windows Forms controls
- Windows Forms without the designer
- Application.Run and .Exit
- Inheriting from class Form
- Windows Forms with the designer
- Event handler for control
- Windows Forms MVC
- Adding and organizing forms
- Create and test a second form
- Windows Presentation Foundation (WPF) XAML
- WPF button and event handler
- Conclusion
Examples from Board Games
- Introduction
- Chess game model and controller
- Chess game events
- Chess game view
- Apply chess moves
- Update chess model
- Add chess pieces
- Summary of Chess MVC
- Board game - ChessMoves
- Create class ChessMove
- Add members of class ChessMove
- Implement method ChessMove.Try
- Invoke ChessMove.Try
- Summary of ChessMoves
Examples from the Web
- Introduction
- Create classes User, Post, and Content
- Write test for use case 1
- Implement Content.Publish (use case 1)
- Implement SocialGraph.Follow (use case 2)
- Write test for use case 3
- Implement SocialGraph.GetFollows
- Implement Content.GetFeed
- Implement Content.Like and .Share
- Update .GetFeed for likes and shares
- Summary
Conclusion
- Next steps