Tutorialsteacher

Follow Us

Articles
  • C#
  • C# OOP
  • ASP.NET Core
  • ASP.NET MVC
  • LINQ
  • Inversion of Control (IoC)
  • Web API
  • JavaScript
  • TypeScript
  • jQuery
  • Angular 11
  • Node.js
  • D3.js
  • Sass
  • Python
  • Go lang
  • HTTPS (SSL)
  • Regex
  • SQL
  • SQL Server
  • PostgreSQL
  • MongoDB
  • C# - Get Started
  • C# - Version History
  • C# - First Program
  • C# - Keywords
  • C# - Class and Objects
  • C# - Namespace
  • C# - Variables
  • C# - Implicitly-Typed Variables
  • C# - Data Types
  • Numbers
  • Strings
  • DateTime
  • Structure
  • Enum
  • StringBuilder
  • Anonymous Types
  • Dynamic Types
  • Nullable Types
  • C# - Value & Reference Types
  • C# - Interface
  • C# - Operators
  • C# - if else Statements
  • C# - Ternary Operator ?:
  • C# - Switch
  • C# - For Loop
  • C# - While Loop
  • C# - Do-while Loop
  • C# - Partial Class
  • C# - Static
  • C# - Array
  • Multidimensional Array
  • Jagged Array
  • C# - Indexer
  • C# - Generics
  • Generic Constraints
  • C# - Collections
  • ArrayList
  • List
  • SortedList
  • Dictionary
  • Hashtable
  • Stack
  • Queue
  • C# - Tuple
  • C# - ValueTuple
  • C# - Built-in Exceptions
  • Exception Handling
  • throw
  • Custom Exception
  • C# - Delegates
  • Func Delegate
  • Action Delegate
  • Predicate Delegate
  • Anonymous Methods
  • C# - Events
  • C# - Covariance
  • C# - Extension Method
  • C# - Stream I/O
  • C# - File
  • C# - FileInfo
  • C# - Object Initializer
  • OOP - Overview
  • Object-Oriented Programming
  • Abstraction
  • Encapsulation
  • Association & Composition
  • Inheritance
  • Polymorphism
  • Method Overriding
  • Method Hiding
  • C# - Solid Principles
  • Single Responsibility Principle
  • Open/Closed Principle
  • Liskov Substitution Principle
  • Interface Segregation Principle
  • Dependency Inversion Principle
  • Design Patterns
  • Singleton
  • Abstract Factory
  • Factory Method
Entity Framework Extensions - Boost EF Core 9
  Bulk Insert
  Bulk Delete
  Bulk Update
  Bulk Merge

Object Oriented Programming in C#

Object-oriented programming is a way of developing software applications using real-world terminologies to create entities that interact with one another using objects.

Object-oriented programming makes applications flexible (easy to change or add new features), reusable, well-structured, and easy to debug and test.

Most programming languages provide the following basic building blocks to build object-oriented applications:

  • Classes: A Class define the structure using methods and properties/fields that resemble real-world entity.
  • Methods: A method represents a particular behavior. It performs some action and might return information about an object, or update an object’s data.
  • Properties: Properties hold the data temporarily during the execution of an application.
  • Objects: Objects are instances of the class that holds different data in properties/fields and can interact with other objects.
  • Interfaces: An interface is a contract that defines the set of rules for a particular functionality. They are used effectively with classes using OOP principles like inheritance and polymorphism to make applications more flexible.

Object-oriented Design Principles

There are various object-oriented principles and techniques using which you can develop applications that are maintainable and extendable.

The followings are four main principles of object-oriented programming:

  1. Abstraction
  2. Encapsulation
  3. Inheritance
  4. Polymorphism

You will learn the above principles in detail in the next few pages.

Steps for Developing Object-oriented Applications

Developing an object-oriented application starts with the business requirement document. Typically, a business analyst provides you with a business requirement document after understanding and analyzing the requirement from the customer. So, the business requirement is the starting point.

The followings are overall steps to develop an object-oriented application:

  1. Abstraction: First, identify essential entities and their characteristic from the business requirement for a high-level view.
    • Find nouns from the business requirement (the noun is the person, place, thing, or process).
    • Identify potential classes and their members from the nouns.
  2. Encapsulation: An implementation of abstraction in code. Create classes and their members with appropriate access modifiers to show functionalities and hide details and complexity.
  3. Define relationship: Establish relationships between classes using inheritance and polymorphism.
    • Inheritance
    • Polymorphism
  4. Use Principles & Patterns: Use the SOLID principles and Design Patterns as and when necessary to make applications flexible.
    • Single Responsibility Principle
    • Open/Closed Principle
    • Liskov Substitution Principle
    • Interface Segregation Principle
    • Dependency Inversion Principle

Here you will learn about important object-oriented principles and patterns and when and how to use them in your application.

TUTORIALSTEACHER.COM

TutorialsTeacher.com is your authoritative source for comprehensive technologies tutorials, tailored to guide you through mastering various web and other technologies through a step-by-step approach.

Our content helps you to learn technologies easily and quickly for learners of all levels. By accessing this platform, you acknowledge that you have reviewed and consented to abide by our Terms of Use and Privacy Policy, designed to safeguard your experience and privacy rights.

[email protected]

ABOUT USTERMS OF USEPRIVACY POLICY
copywrite-symbol

2024 TutorialsTeacher.com. (v 1.2) All Rights Reserved.