Schedule

Schedule

Tuesday, September 2

1409688000 Security Now
1409695200 Before You Buy
1409698800 Tech News 2Night
1409702400 All About Android
1409711400 Padre's Corner

Wednesday, September 3

1409758200 FLOSS Weekly
1409763600 Tech News Today
1409767200 Windows Weekly
1409774400 This Week in Google
1409785200 Tech News 2Night
1409787000 redditUP
1409792400 Ham Nation

Thursday, September 4

1409850000 Tech News Today
1409853600 Know How...
1409857200 The Social Hour
1409862600 Coding 101
1409866200 Home Theater Geeks
1409871600 Tech News 2Night
1409873400 The Giz Wiz
1409882400 OMGcraft

Friday, September 5

1409936400 Tech News Today
1409940000 This Week in Law
1409947200 Android App Arena
1409958000 Tech News 2Night

Saturday, September 6

1410026400 The Tech Guy

Sunday, September 7

1410112800 The Tech Guy
1410127200 This Week in Tech

Monday, September 8

1410195600 Tech News Today
1410199200 Triangulation
1410204600 iPad Today
1410217200 Tech News 2Night
1410219000 Marketing Mavericks

Tuesday, September 9

1410282000 Tech News Today
1410285600 MacBreak Weekly
1410292800 Security Now
1410300000 Before You Buy
1410303600 Tech News 2Night
1410307200 All About Android
1410316200 Padre's Corner

Wednesday, September 10

1410363000 FLOSS Weekly
1410368400 Tech News Today
1410372000 Windows Weekly
1410379200 This Week in Google
1410390000 Tech News 2Night
1410391800 redditUP
1410397200 Ham Nation

Thursday, September 11

1410454800 Tech News Today
1410458400 Know How...
1410462000 The Social Hour
1410467400 Coding 101
1410471000 Home Theater Geeks
1410476400 Tech News 2Night
1410478200 The Giz Wiz
1410487200 OMGcraft

Friday, September 12

1410541200 Tech News Today
1410544800 This Week in Law
1410552000 Android App Arena

Most Recent Episodes

OMGcraft

Enchanting in Minecraft 1.8

Tech News Today

Apple's iCloud is compromised and nude celebrity photos are stolen.

This Week in Tech

Virtual nausea, Uber vs. Lyft, smart phone kill switch, and more.

The Tech Guy
The Tech Guy 1114 August 31st, 2014

How reliable are SSDs?

The Tech Guy
The Tech Guy 1113 August 30th, 2014

Is a Chromebook a suitable replacement for an old computer?

Tech News 2Night

Facebook status updates are now searchable on mobile.

This Week in Law

Google receives 1 million DMCA takedown notices a day.

Android App Arena

A collection of games that are best played while wearing headphones.

Tech News Today

Microsoft's MSN Messenger is shutting down for good.

This Week in Computer Hardware

Haswell-E leak and 8TB hard drives.

Coding 101 32

C# Abstract Classes and Interfaces

August 28 2014

Hosts: Fr. Robert Ballecer, SJ and Shannon Morse

Guest: Lou Maresca

The Code for today's show is available at our: Github

Snubs Compiled
No Viewer Submitted Code, however we did get some useful tips for C# from our community:

Cosmic Ray links us to a C# Fundamentals series that's super useful for newbies!

Nathan says learning the syntax of the languages is great, but you need to know how to problem solve!

Kelvin links us to Mono, for Mac users

Joe gives us info on how to get C# running via notepad!

Ivory Tower
Interfaces, Classes, & Abstract Classes

Remember from last week that "Classes" are blueprints
- They are a collection of Methods, variables, properties and events
- Classes DO NOT EXIST until they are created (i.e. the difference between having a blueprint and the building built from those blueprints)
- When an instance of a class is "created" -- and "object" is born

Declaring a Class
public class C101

{

//Fields, methods, properties, events
// everything in the "blue print" goes in here

}

Creating an OBJECT of a class:
C101 object1 = new C101();

** One of the topics that was covered towards the end of our "Code Warrior" section last week, was the idea of inheritance.
-- You can make new classes that inherit their members from another class, with derrivations from the original class.

Inheriting from a class
public class Module4 : C101

{

//Fields, methods, properties, events
//everything in the ""blue print"" goes in here

}

** However, there's another way to do that... another way that perhaps is MORE suited for inheritance and derrivation than a class... an ABSTRACT CLASS

Now let's talk about "Abstract Classes"
* If classes are blueprints --- things that are ready to create --- to turn into objects, then "ABSTRACT Classes" are architectural designs.
-- They have the right shape of the thing to be created
-- They have much of the information needed to create the thing being created
-- But they are not complete
-- They cannot be instantiated - (They cannot not be "created" into an object)

* The sole purpose of an abstract class is to act as a "base" for inheritance
-- They cannot be instantiated, but a derrivative class, which inherits the abstract members from the abstract class, can be.
-- That derrivative class must provide proper implementation for all the abstract members of the abstract class, then it CAN create an object. (It complete's the blueprints)

Declaring an abstract class
public abstract class C101

{

//Fields, methods, properties, events
//everything in the ""blue print goes in here

public abstract void menu()

{

}

}

Inheriting from an abstract class
public class Module4 : C101

{

public void menu()

{

Console.WriteLine("This is a Menu");

}

}

* The inherited class from C101 MUST provide implementation for any abstract members within that class.

A few things about Abstract Classes:
1. They are created with the keyword "abstract"
2. They are incomplete and therefore CANNOT be instantiated. (an object cannot be created from the class)
3. Abstract classes and incomplete, and therefore can only be used as a base class
4. Non-abstract classes that are derived from abstract classes MUST provide proper implementation for any abstract members that are inherited from the abstract class.

Why have an Abstract Class?
* Abstract classes ENFORCE a particular hierarchy - They FORCE those who are inheriting from the class to code in a particular way to complete implementation.
* Abstract classes give us "parent" classes from which we can derive objects with customized implementation
* Going back to the blueprint:
-- An abstract class can give us the overview of what an object should look like, but then each derrivative class can implement the pieces of the abstract class as then need to be to best suit function

Let's talk about an Interface
* An Interface is like an Abstract class in that it can be used to define hierarchies for any sub-classes
* Unlike an Abstract Class, an Interface has NO body.
-- It's just the definitions of methods, with no body whatsoever.

Get in Touch With Us!

* Subscribe and get Coding 101 automatically at TWiT.tv!
* Follow PadreSJ and Snubs on Twitter.
* Watch the show live and join the chatroom every Thursday at 1:30pm PST.
* Email us at Padre@twit.tv and Shannon@twit.tv.
* Join our Google+ Community!