Answer the question
In order to leave comments, you need to log in
The principle of openness-closedness on an example?
More details, please explain.
There is the principle of OCP - the Open Closed Principle (Openness-Closeness).
Please explain with an example.
Change has an abstract class BaseData
public abstract class BaseData
{
public virtual void Get()
{
}
}
class AdministratorData : BaseData
{
public override void Get()
{
base.Get();
}
}
Answer the question
In order to leave comments, you need to log in
Notation with example https://metanit.com/sharp/patterns/5.2.php
Pattern example
https://metanit.com/sharp/patterns/4.3.php
Open for extension, closed for modification.
I think after these links questions should disappear
And it is not always possible to perfectly fulfill all the principles
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question