
Master object oriented c sharp concepts in part two, covering solid principles (single responsibility, open/closed, liskov substitution, interface segregation, dependency inversion), generics, iterators and comparators, reflections, and publisher–subscriber communication.
Download the donette core sdk and Visual Studio 2019 to begin object oriented programming with C Sharp.
Create a new solution and establish a folder structure with modules for solid principles, generics, iterators and comparators, reflection, and object communication to prep for module zero one.
Explore the single responsibility principle by refactoring a bank account example into separate responsibilities, creating an account interface and an interest rate calculator interface implemented by a dedicated calculator.
Apply the single responsibility principle by separating account data from interest rate calculation, using an interest rate calculator that accepts an account interface for flexible bank account testing.
Learn to apply the open closed principle by designing abstract savings accounts and specialized subclasses, then implement an improved calculator that uses polymorphism to avoid code changes.
Explore the open-closed principle in practice with an abstract savings account, concrete money market and regular accounts, and an improved calculator to compute total savings.
Explore the interface segregation principle by separating interfaces into IAccount and ITransferable, preventing unrelated methods from forcing implementations like mortgage accounts to implement transfers.
Demonstrates interface segregation by using specialized interfaces for accounts; allows checking accounts to transfer funds while mortgage accounts expose only balance access, enforcing appropriate client behavior.
Apply the dependency inversion principle to decouple the atm machine from concrete calculators by injecting an interest calculator interface and enabling type one or type two calculators.
Explore dependency inversion in practice by contrasting a fragile ATM design with a dependency injected calculator, enabling flexible interest calculations via type one and type two calculators.
Explore generics and generic collections in C# by building an account class with a decimal balance and overridden toString method, and a customer class with first and last name properties.
Explore generic collections in C# by building and manipulating generic lists, stacks, queues, and dictionaries with accounts and customers, including pushing, popping, peeking, enqueuing, and dequeuing balances.
Learn how to implement generic methods in C# using account types. Create savings and checking accounts to demonstrate a generic method that works with any account and displays the balance.
Learn to implement a generic method to swap or transfer account objects using type parameter T and ref parameters, applied to checking and savings accounts with before and after displays.
Explore generic classes and interfaces in C# by building a generic account processor for checking, savings, and health savings accounts using a generic type T and a generic interest calculator.
Explore using generic classes to build a generic account processor for checking and savings accounts. The lecture shows creating typed processors, processing accounts, and calculating interest.
Explore generics constraints in C# by enforcing empty constructors, base types, and interfaces to create flexible account, transaction, and transfer processors.
Demonstrates three generic constraints: empty constructor, base class, and interface, through account processor, transaction processor, and transfer processor, showing account creation, balance display, and money transfer.
Implement the IEnumerable interface to enable iterating over a bank's accounts, define an account class with name and balance, and implement GetEnumerator to return the accounts collection.
Explore implementing the enumerable interface on a bank class and iterating its accounts using getEnumerator, moveNext, and current to display each account name and balance.
Create a console project with an account class, a balance property, and a to string method override to display the balance; implement the ICloneable interface to clone the account.
Instantiate an account with 100 dollars, clone it via the ICloneable interface, and verify the cloned account shares the same initial balance as the original.
Implement the IComparable interface to compare two account objects by balance, casting the incoming object to Account and returning -1, 0, or 1 based on the balance.
Implement the IComparable interface to sort a list of account objects by balance, and show pre and post sort outputs with balances in descending order.
Learn how to use reflection in C# to obtain information about a class, including its properties, fields, and methods, by inspecting a simple account class.
Learn to use type reflection in C# to inspect an account class at runtime, retrieving its type, members, constructors, and a balance property, and print the balance value.
Explore method reflection by inspecting an account class's deposit and withdraw methods through MethodInfo, and practice accessing other methods via reflection.
Use reflection in C# to inspect an account type. Retrieve methods with GetMethods and display method names and return types, such as get balance, deposit, and withdraw.
Explore field and property reflection by inspecting an account type in a console app, including the balance and created properties, and the deposit and withdraw methods.
Explore reflection in C# by inspecting an account class's fields and properties, printing each name and type, with examples like balance (decimal) and created date (DateTime).
Explore interface reflection in C# by building a console project that implements a transferable account with the I transferable interface and transfer methods.
Master activator with reflection to create new account instances by type name, and build a count class with a balance, deposit, and withdrawal methods.
Use reflection with Activator to dynamically create an account instance via CreateInstance, deposit twenty dollars, withdraw five, and display the balance starting from a zero-balance default constructor.
Explore method invocation in a C# account class by implementing deposit and display balance methods, including parameterized and parameterless calls, to demonstrate basic object-oriented concepts.
Use reflection to instantiate an account, invoke the deposit method with three hundred dollars, and then invoke the no-parameter display balance method to show the balance.
Publish and listen to account events using the pub-sub pattern with delegates and events; deposit and withdrawal trigger notifications that subscribers can consume.
Learn how a subscriber class listens to account events by subscribing to deposited and withdrawn events from a publisher, enabling real-time notifications when funds change.
Set up a subscription between publisher and subscriber by converting them to class libraries, then connect a customer to an account so notifications fire for deposits and withdrawals.
Create custom event arguments in a publisher-subscriber pattern by extending event args, adding an amount property, and passing it to account deposit and withdrawal events.
Professor Manish Narayan, founder of Innovative Institution presents
Get Started with Object Oriented C# MasterClass Part 2!
Are you a student or professional in the field of software engineering or maybe contemplating an educational or career move to the software engineering world? Have you been looking for a quick and easy way to get up and running with Object Oriented C# using .NET Core and don't want to go through an overwhelming amount of material just to get your environment setup and ready for building your own apps? Don't worry as THIS IS THE COURSE FOR YOU!
In my course, I will teach you how to get your environment setup for .NET Core and help you to gain a strong foundation in C# Object Oriented Programming quickly and through a step-by-step guided approach. I will be showing you all the necessary installation and setup needed for .NET Core and Visual Studio IDE. Together we will master the following modules coupled with concrete examples and methodologies gathered from real world experiences:
-SOLID Principles
(Single-responsibility principle, Open–closed principle, Liskov substitution principle, Interface segregation principle, Dependency inversion principle)
-Generics
(Generic Collections, Generic Methods, Generic Classes, Constraints)
-Iterators & Comparators
(IEnumerable, ICloneable, IComparable)
-Reflection
(Type Reflection, Method Reflection, Field Property Reflection, Interface Reflection, Activator, Invocation)
-Object Communication
(Publisher, Subscriber, Subscription, Custom Event Arguments)
Learning Object-Oriented Programming (OOP) is an essential skill for any software developer. It provides a structured and efficient way of designing and organizing code, making it easier to maintain and scale applications. With C# as your language of choice, you'll have access to a powerful and versatile toolset within the .NET ecosystem.
In this comprehensive MasterClass, we will delve deep into the core principles of OOP, such as encapsulation, inheritance, and polymorphism. You'll discover how to create classes, define properties, and implement methods that unleash the full potential of C#. Through hands-on exercises and real-world examples, you will gain the confidence to tackle complex projects and design elegant solutions.
Moreover, we will explore the benefits of using .NET Core, a cross-platform framework that enables you to build applications that run on Windows, macOS, and Linux. You'll learn how to set up your development environment to take advantage of .NET Core's performance and flexibility.
By the end of this MasterClass, you will be equipped with the knowledge and skills to craft sophisticated C# applications, opening doors to exciting job opportunities and advancements in your software engineering career. So don't wait any longer; let's embark on this journey together and become a C# OOP expert in no time!
Take this course and feel proud of the fact that you will be one step closer towards the rewarding field of Software Engineering using .NET technologies!