Is this a design template?

In our entire code base, we have this repeating pattern where there is an interface with one method. Is this a real design? If so, what is it and what are the benefits?

Here are some examples:

    public interface IRunnable
    {       
        void Run();     
    }

    public interface IAction
    {
        void Perform();
    }

    public interface ICommand
    {
        void Execute(ActionArgs _actionargs);
    }
+5
source share
8 answers

I saw this as a Team Template .

I first found out about this by reading Uncle Bob's Agile Principles, Patterns and Practices in C # .

, - . , . / . , . Process . ( , .)

, , , , , Process.

, . , , , .

+5

Command Pattern, , . , .

. , , , , , , , , ...

, , .

+2

, . ( ) Java- . # ++.

, . ++ #. Java , , , .

+2
+1

( ) -. - .

+1

, . () s () s, .

+1

. , .NET - INotifyPropertyChanged, ( PropertyChanged). , ( , ), ( , ).

Dim runnableObjects As List(Of Object)
runnableObjects.Add(New MyRunnableObject1)
runnableObjects.Add(New MyRunnableObject2)

For Each o As IRunnable In runnableObjects
  o.Run()
Next
+1

, - , , . , IAction, / (.. ).

0

All Articles