Академический Документы
Профессиональный Документы
Культура Документы
Home
About Me
Contact Me
September 19, 2014
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.
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.
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.
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.
Enjoy!
5 Comments
1. codezone — September 20, 2014 @ 8:56 am 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.
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
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!
Trackbacks/Pingbacks
Leave a comment
Name (required)
Website
Submit Comment
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
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
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