Presentation is loading. Please wait.

Presentation is loading. Please wait.

C# Object Oriented Programming Concepts

Similar presentations


Presentation on theme: "C# Object Oriented Programming Concepts"— Presentation transcript:

1 C# Object Oriented Programming Concepts
MIS Professor Sandvig 11/19/2018 C# Object Oriented Programming Concepts MIS 324 Professor Sandvig

2 MIS 324 -- Professor Sandvig
11/19/2018 Overview OOP Benefits Terminology Creating classes Instantiating objects Constructors Dice Roll example Dog Example Summary

3 MIS 324 -- Professor Sandvig
11/19/2018 OOP Benefits Hide program complexity simple public interface hides complexity inside Support reusability Create modularity Reusability

4 OOP Benefits Legos analogy: Modular Reusable Simple interface
Each piece has single purpose Reusable Pieces can be used in multiple products Simple interface Maintainable

5 Terminology Encapsulation Fundamental principle of OOP
Code wrapped inside classes Hide implementation details Reduce complexity Provide simple interface

6 Abstraction Interface exposing essential features
Implementation details hidden Example: Math.Pow(number, power)

7 MIS 324 -- Professor Sandvig
11/19/2018 Class Typically represents real-world object Person Product Shopping Cart Etc. Properties Attributes Methods actions

8 Object Object Instance of a class Has functionality of class

9 MIS 324 -- Professor Sandvig
11/19/2018 Instantiation Source: asp.netPRO

10 MIS 324 -- Professor Sandvig
11/19/2018 Objects Objects have properties & methods of class

11 MIS 324 -- Professor Sandvig
11/19/2018 Constructors Constructors set object properties during initialization Examples: Dog myDog = new Dog(“Apollo”, “male”, 28);

12 Defining a Class in C# See “Classes in C#” handout
Random die rolls: /dice/diceRoller

13 MIS 324 -- Professor Sandvig
11/19/2018 Static Classes Don’t need to instantiate Typically utility-type classes Examples: Convert.ToString(33.3); DateTime.Now.ToLongDateString();

14 MIS 324 -- Professor Sandvig
11/19/2018 Inheritance Objects can inherit from other objects Goal: never program anything twice Beyond scope of this course

15 .NET Class Library Contains thousands of class Example Data access
Data collections Drawing (graphics) Web services Etc. Example SqlCommand Class

16 MIS 324 -- Professor Sandvig
11/19/2018 Summary Covered major OOP concepts/terminology Goals: Hide program complexity Support reusability Create modularity Concepts & terminology is universal


Download ppt "C# Object Oriented Programming Concepts"

Similar presentations


Ads by Google