How does MEF determine the order of its imports?

后端 未结 3 461
野趣味
野趣味 2020-12-28 17:44

MEF allows you to import multiple parts via the use of the ImportMany attribute. How does it determine the order in which it retrieves the relevant exports and

3条回答
  •  佛祖请我去吃肉
    2020-12-28 18:33

    You could have the rules import each other in order (using the Decorator pattern), but then each rule will need to know about the specific rule that precedes it, which probably isn't what you want.

    MEF is there to help you discover the parts, what you do with them afterwards is up to you. If you want to sort the parts then go ahead, there's nothing wrong with that!

提交回复
热议问题