Home » C# Basics » 05 - Object Oriented Programming in C#
5

Do we need to create our own classes?

Understand the benefits of creating our own classes in OOP

Although the classes provided by the .NET Framework helps us to create applications and use various features like data access, sometimes, we may need our own classes. One such example is when we write the business logic of our program. The .NET framework classes help us in data access. But how we process that data and present it to the user of our application is entirely up to us. This is commonly known as the business logic. We can create a custom class for this and store it inside a namespace we created. We can then use this class in our application by including the namespace in our code. Our class can also be used with little or no modification by another developer who is developing a similar application. Our class can also be extended to add more features in it. This will save a lot of coding and testing time.