WinRT reason for disallowing custom generic types or interfaces

前端 未结 2 2078
北海茫月
北海茫月 2021-01-03 08:06

After reading about WinRT a bit here and from Build decks, can someone shed light on the specific rationale that lead them to disallow us from passing our own IFoo, ye

2条回答
  •  天命终不由人
    2021-01-03 08:38

    Also for building component there are 2 advantages

    • extension by composition is a better model for components ( remember you can still use interfaces for testing ( eg a C# lib) they just cant be exposes as WinRT exportable components

    • No polymorphic calls across the COM call boundary since cant be inlined performance will be poor

    I'm not sure JS would have limited this since JS cant create objects anyway only consume they could have added another JS limitation - not framework interfaces are supported..

提交回复
热议问题