Open close principle in C#
Loading
Open close principle in C#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
NitinPosted Nov 29, 2022, 6:42 AM
https://www.c-sharpcorner.com/UploadFile/pranayamr/open-close-principle/
Brahma Prakash ShuklaPosted Nov 29, 2022, 5:49 AM
Example of open close principle-
Pankajkumar PatelPosted Nov 21, 2022, 11:57 AM
Hi Naresh Beniwal,
Open Closed Principle (OCP) states that a class must be open to be extended but closed to changes. Example in C# is as following:
BankAccount
BankAccountBase
SavingsAccount
LongTermSavingsAccount
How to use
Hope, this will help you!
Vishal YelvePosted Nov 21, 2022, 9:52 AM
The open-closed principle states that a software component like method, class or module should be open for extension, but closed for modification.
Please check below links for your reference
https://code-maze.com/open-closed-principle/
https://dotnettutorials.net/lesson/open-closed-principle/
https://levelup.gitconnected.com/4-ways-to-achieve-open-closed-principle-in-c-d2d0ebea4b86
Aravind GovindarajPosted Nov 20, 2022, 2:32 PM
The Open Close principle is one that is used to open extend and close for any changes.
For eg.,
RBI has a set of norms and would like to extend the logic in SBI business cases. So we are extending the RBI library and changing in our SBI Library, In this approach we are not modifying anything on Main placeholder however we are molding it in on required place on demand basis.
Rajanikant HawaldarPosted Nov 20, 2022, 9:02 AM
https://www.c-sharpcorner.com/article/solid-principles-in-c-sharp-open-closed-principle/
https://www.c-sharpcorner.com/blogs/open-close-principle-with-example1