c# Extension methods - design patterns -
I would like to know that the C # extension method is based on an existing design pattern.
A design pattern is simply a well-known pattern, i.e. "when you want to achieve x , Then what should we do". There is a famous paradigm in object-oriented languages like C #, "When you want to work on the status of an object, call an example of it".
However, before expansion methods, you can not call your own method on an example of an object that you can not add to the implementation (like interface because they can not implement, or library classes Because they are already compiled). Extension Method This difference allows the creation of methods that make visible are able to call objects on objects, defining them externally for the implementation of the object.
Yes, arguably the extension methods are based on this very simple design pattern, which seem to be able to call the methods working on the condition of an object with an example.
Comments
Post a Comment