What is an empty interface used for

后端 未结 12 2704
醉话见心
醉话见心 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:08

    Been working with NServiceBus for the past year. While I wouldn't speak for Udi Dahan my understanding is that this interface is indeed used as a marker primarily.

    Though I'd suggest you ask the man himself if he'd had thoughts of leaving this for future extension. My bet is no, as the mantra seems to be to keep messages very simple or at least practically platform agnostic.

    Others answer well on the more general reasons for empty interfaces.

提交回复
热议问题