Вы находитесь на странице: 1из 6

1/17/2021 Object-Oriented Programming (OOP) Terms -Deborah's Developer MindScape

Deborah's Developer MindScape

Tips and Techniques for Web and .NET developers.

Home
About Me
Contact Me
September 19, 2014

Object-Oriented Programming (OOP) Terms


Filed under: C#,OOP — deborahk @ 10:22 am

I recently completed a course for Pluralsight entitled “Object-Oriented Programming Fundamentals in C#.”
In that course, I cover OOP concepts and definitions of common OOP terms. In the discussion board for that
course, someone suggested a “cheat sheet” that summarized the definitions. So here it is:

Basics

Object-Oriented Programming (OOP): An approach to designing and building applications that are
flexible, natural, well-crafted, and testable by focusing on objects that interact cleanly with one another.

Class: The code describing a particular entity in the application, such as Customer, Order, or Address. The
class contains the code defining the properties and methods (see below).

Property: The code defining the data managed by the class, such as CustomerName, OrderNumber, or
EmailAddress.

Method: The code defining the actions or behaviors of the class, such as Validate or CalculateTotal. Methods
are defined in the code with C# functions.

Members: Refers to the properties and methods for a class.

Object: An instance of a class that is created at runtime. In C#, an instance is created with the new keyword.

Object Variable: The variable used when creating an object. For example, var myCustomer = new
Customer(); In this example, myCustomer is the object variable. Use the object variable to set the properties
and call the methods. The object variable retains the state of the object.

Method signature: The code defining the method function including the function name and the set of
parameters. The signature does not include the return type. Every function signature within a class must be
unique. The signature is used to “match up” calls to the function.

Overloading: Methods that have the same name but different parameters. Example: public bool Retrieve()
and public bool Retrieve(int id). The Retrieve method in this example is said to have “two overloads”.

Contract: The set of public properties and methods in a class define the classes contract. The class makes a
promise that it will provide the defined properties and methods to any other code that needs them. This is
also known as the “class interface“.
https://blogs.msmvps.com/deborahk/object-oriented-programming-oop-terms/ 1/6
1/17/2021 Object-Oriented Programming (OOP) Terms -Deborah's Developer MindScape

Constructor: Code that is executed each time an instance of the class is created.

Default Constructor: A constructor with no parameters.

Overriding: When using inheritance (see below), a child class can override a member of the parent class to
provide its own implementation.

Interface: An explicit interface is a separate type (INotifyPropertyChanged for example) that defines a set of
properties and methods with no implementation. Any class can then implement an interface to use the set of
properties and methods provided in the interface. Think of an interface as a role that an object can play. For
example, an ILoggable interface defines a logging role. An IEmail interface defines an emailing role. An
Order class may implement both the ILoggable and IEmail interface to take on both roles. An Address class
may implement only the ILoggable interface.

Four Pillars of Object-Oriented Programming


The pillars of OOP define the key characteristics of object-oriented programming and are:

Abstraction: The process of defining classes by simplifying reality, ignoring extraneous details, and
focusing on what is important for a purpose. For example, a customer may have a name, title, address,
marital status, pets, children, credit card information, vehicles, etc. But if the purpose of the application is to
process orders, the application may only care about the customer’s name, address, and credit card
information.

Encapsulation: A way to hide (or encapsulate) the data and implementation details within a class, thus
hiding complexity. In C#, data elements are defined with private backing fields and exposed through
property getters and setters. So the data is encapsulated.

Inheritance: A relationship between classes whereby child (or derived) classes inherit all of the members of
the parent (or base) class. For example, an application may define a “business object base” class that all
business objects inherit from. This base class can contain members common to all child classes, such as
entity state information.

Polymorphism: Basically “many forms”. The concept that a single method can behave differently depending
on the type of object that calls it. For example, the Validate method in Customer class performs differently
from the Validate method in the Order class.

Inheritance-Based Polymorphism: Polymorphism in the case where the method is defined in a base class
and behaves differently for each child class.

Interface-Based Polymorphism: Polymorphism in the case where the method is defined in an interface and
behaves differently in each class that implements the interface.

Class Relationships
Collaboration: “Uses a” relationship. Objects can collaborate with other objects. For example: Customer
Repository “uses a” Customer object to populate on a retrieve and serialize on a save.

Composition: “Has a” relationship. Objects can be composed of other objects. For example, Order “has a”
Customer and Order “has a” shipping address.

Inheritance: “Is a” relationship. Objects can be subtyped. For example, a Business Type Customer “is a”
Customer and a Residential Type Customer “is a” Customer.

C# OOP Terms

Auto-implemented properties: Properties that create and manage the encapsulated backing field
automatically.
https://blogs.msmvps.com/deborahk/object-oriented-programming-oop-terms/ 2/6
1/17/2021 Object-Oriented Programming (OOP) Terms -Deborah's Developer MindScape

Static method: Adding the static modifier on a member of the class (property or method) defines that the
member belongs to the class itself, not an instance of the class.

Sealed class: Class that cannot be used as a base class for an inheritance relationship.

Abstract class: Class that cannot be instantiated, so no objects can be created from the class. Nor can it be
accessed by its class name. The class can only be used as a base class for other classes.

Concrete class: Class that can be instantiated. Basically, the opposite of an abstract class.

Static class: Class that cannot be instantiated, so no objects can be created from the class. The class
members are instead accessed using the class name. A static class provides a shortcut to the members of the
class when instancing is unwarranted. For example, the .NET Framework Console class is a static class. To
call the WriteLine method you use Console.WriteLine. You don’t have to create a new instance of Console.

Abstract method: Method with no implementation (basically no code). The method must be overridden by a
child class.

Virtual method: Method with an implementation that can be overridden by a child class.

For More Information


For more information and detailed coding examples for these concepts/terms, check out the course.

Enjoy!

5 Comments
1. codezone — September 20, 2014 @ 8:56 am Reply

great reference guide to start with

2. cheap sunglasses ray ban — September 10, 2015 @ 7:33 pm Reply

Hi, Neat post. There’s an issue with your website in web explorer, could check this? IE still is the
marketplace leader and a good component of other people will leave out your excellent writing
because of this problem.

3. Brazilian hair — September 10, 2015 @ 11:39 pm Reply

Oughout should get these . they may be almost all pleasant Brazilian hair
http://www.aliexpress.com/store/group/Brazilian-Virgin-hair-3PCS/1036282_260411398.html at any
time they’re just vogue and stylish

4. Ash — November 25, 2016 @ 2:43 am Reply

Thanks for noting these down in such simple terms. A friend referenced you on Pluralsight and I’m
quite excited to sign up and learn a bit more!

deborahk — December 6, 2016 @ 11:34 am Reply

Thanks! Hope you enjoy Pluralsight!

Trackbacks/Pingbacks

1. Link Friday #1 - Jan. 9th, 2015 - Craig Wall

RSS feed for comments on this post. TrackBack URI


https://blogs.msmvps.com/deborahk/object-oriented-programming-oop-terms/ 3/6
1/17/2021 Object-Oriented Programming (OOP) Terms -Deborah's Developer MindScape

Leave a comment
Name (required)

Mail (will not be published) (required)

Website

Submit Comment

Search for: Search

Recent Posts
What Is a Higher-Order Observable?
Object-Oriented Programming Fundamentals in C#: 2019 Update
Angular Routing Course Update (for v7)
Angular: Getting Started Course Update (for v7)
Angular Reactive Forms Course Update (for v7)

Categories
Angular (30)
Angular CLI (3)
Angular Course Problem Solver (5)
Angular Course Updates (4)
AngularJS (21)
ASP.NET (22)
ASP.NET RIA Services (23)
ASP.NET Web API (9)
C# (321)
Data (15)
Data Binding (11)
Debugging (7)
General (25)
JavaScript (6)
Lambda Expressions (31)
LINQ (21)
Microsoft Excel (2)
Microsoft Word (2)
OOP (22)
Reporting (5)
RxJS (1)
Silverlight (52)
SQL Server Data Tools (SSDT) (30)
Testing (15)
https://blogs.msmvps.com/deborahk/object-oriented-programming-oop-terms/ 4/6
1/17/2021 Object-Oriented Programming (OOP) Terms -Deborah's Developer MindScape

Text Files (7)


Travel (1)
TypeScript (6)
Uncategorized (1)
User Group (4)
VB.NET (323)
Visual Studio (117)
VS Code (2)
WinForms (21)
XAML (7)
XML (21)

Monthly Posts
August 2019 (1)
March 2019 (1)
December 2018 (1)
November 2018 (2)
July 2018 (1)
April 2018 (1)
December 2017 (1)
August 2017 (2)
June 2017 (3)
May 2017 (1)
March 2017 (2)
January 2017 (1)
October 2016 (2)
May 2016 (6)
April 2016 (4)
February 2016 (1)
January 2016 (4)
September 2015 (1)
August 2015 (4)
May 2015 (1)
April 2015 (1)
January 2015 (3)
December 2014 (1)
November 2014 (3)
October 2014 (2)
September 2014 (2)
August 2014 (1)
July 2014 (5)
June 2014 (4)
May 2014 (3)
April 2014 (1)
March 2014 (2)
February 2014 (13)
January 2014 (3)
November 2013 (3)
October 2013 (13)
August 2013 (8)
July 2013 (11)
January 2013 (1)
October 2012 (4)
September 2012 (19)
August 2012 (11)
October 2011 (4)
https://blogs.msmvps.com/deborahk/object-oriented-programming-oop-terms/ 5/6
1/17/2021 Object-Oriented Programming (OOP) Terms -Deborah's Developer MindScape

May 2011 (6)


April 2011 (2)
March 2011 (3)
February 2011 (11)
January 2011 (11)
December 2010 (8)
November 2010 (3)
October 2010 (7)
September 2010 (10)
August 2010 (7)
July 2010 (8)
June 2010 (8)
May 2010 (12)
April 2010 (13)
March 2010 (7)
February 2010 (12)
January 2010 (12)
December 2009 (7)
November 2009 (14)
October 2009 (18)
September 2009 (18)
August 2009 (25)
July 2009 (47)

Options
Log in
Entries feed
Comments feed
WordPress.org

© 2021 Deborah's Developer MindScape Provided by WPMU DEV -The WordPress Experts Hosted by
Microsoft MVPs

https://blogs.msmvps.com/deborahk/object-oriented-programming-oop-terms/ 6/6

Вам также может понравиться