What is an empty interface used for

后端 未结 12 2722
醉话见心
醉话见心 2020-12-13 17:18

I am looking at nServiceBus and came over this interface

namespace NServiceBus
{
    public interface IMessage
    {
    }
}

What is the us

12条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-13 18:02

    I'd say its used for "future" reference or if you want to share some objects, meaning you could have 10 classes each implementing this interface.

    And have them sent to a function for work on them, but if the interface is empty, I'd say its just "pre"-work.

提交回复
热议问题