1. Home
  2. Training Library
  3. Big Data
  4. Courses
  5. Introduction to Object Orientation and C# Classes

Overview

Contents

keyboard_tab
Introduction & Overview
1
Introduction
PREVIEW1m 5s
2
Overview
PREVIEW2m 11s
Object Orientation & C# Classes
Course Summary
9
Summary
4m 25s

The course is part of this learning path

Overview
Overview
Difficulty
Intermediate
Duration
52m
Students
132
Ratings
5/5
starstarstarstarstar
Description

This course takes code from the Data Types and Variables course and refines it using object-oriented (OO) principles. We explore some of the main concepts of OO programming during this process, such as encapsulation, code reuse, and inheritance.

Along the way, we learn more about essential code structures such as conditional evaluation with if-then-else statements, functions for grouping code that performs a specific task, and for-loops for dynamically repeating an action. We will also look at how .NET and C# have object-oriented baked-in as a fundamental design principle underpinning the framework and language.

Learning Objectives

  • Understand the benefits of object orientation and what came before it
  • Learn about essential code structures and turn code into a class
  • Refine the class code and learn more object-oriented concepts
  • Learn about inheritance, a fundamental object-oriented concept
  • Understand how object-orientation is a foundation principle of C# and .NET

Intended Audience

This course is intended for those who already have an understanding of data types and variables in C# and now want to learn about object-oriented principles.

Prerequisites

To get the most out of this course, you should have an understanding of C# as well as basic data types: strings, numbers, and Booleans. In order to follow along with the demos, you should also have a working development environment, whether in Windows, Linux, or macOS.

Resources

The GitHub repository for this course can be found here.

 

Transcript

Object-oriented programming is a vast topic to which whole books are devoted to explaining and expounding its virtues. This course will discuss the elementary concepts of object-oriented programming and key features that mark it as different from other programming paradigms or styles. Then we'll move onto rewriting or refactoring, as it is correctly termed, some code from the previous course using OO principles. Finally, we'll look at how object orientation is baked into C# and .NET.  Along the way, I'll introduce new concepts and features that will help us as we learn about OO programming. 

As we saw in the first course, the compiled code that the computer executes is incomprehensible to most humans, so object orientation is all about writing code that easier for us to understand. Well written code is often referred to as clean or elegant, and to this end, there are several principles associated with object-orientation we need to follow to achieve this. 

Two of these principles are: 

  • A block or segment of code should be responsible for performing a single task. 

  • The code to perform a task should be primarily self-reliant, so not dependent on the state of some unrelated variables elsewhere. This type of functional independence is called encapsulation.

 

To fully appreciate what object-oriented programming offers, we need to look at what writing code was like before the advent of OO or in a non-OO style. Looking at the Arrays program from the last course, we have lines of code that are all lumped together and execute sequentially, starting at the top. This example program is not difficult to read or understand as there are only a few dozen lines. What if there were thousands of lines, and some lines needed to be executed more than once, possibly out of sequence? Then things start to get complicated.

About the Author
Avatar
Hallam Webber
Software Architect
Students
15508
Courses
28
Learning Paths
3

Hallam is a software architect with over 20 years experience across a wide range of industries. He began his software career as a  Delphi/Interbase disciple but changed his allegiance to Microsoft with its deep and broad ecosystem. While Hallam has designed and crafted custom software utilizing web, mobile and desktop technologies, good quality reliable data is the key to a successful solution. The challenge of quickly turning data into useful information for digestion by humans and machines has led Hallam to specialize in database design and process automation. Showing customers how leverage new technology to change and improve their business processes is one of the key drivers keeping Hallam coming back to the keyboard. 

Covered Topics