.NET 中哪里使用了适配器模式?
Microsoft 在 .NET 的哪些领域利用了适配器模式?我正在寻找使用适配器的 .NET 组件的具体示例。
What areas of .NET did Microsoft leverage the Adapter pattern in? I am looking for specific examples of .NET components using Adapter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为
IDbCommand
和相关数据库访问组件遵循适配器模式。这是因为它们为 RDBMS 产品中非常不同的 API 提供了一个通用接口或包装器。I would argue that the
IDbCommand
and related database access components follow the adapter pattern. This is because they provide a common interface, or wrapper, for very disparate APIs into RDBMS products.XmlSerializer 怎么样?使用
XmlSerializer(Type)
构造函数构造它会创建 XmlSerializer,它类似于给定类型的 XML 适配器。然后,您可以使用Serialize()
/Deserialize()
方法来适应 XML 或从 XML 适应。What about XmlSerializer? Constructing it using
XmlSerializer(Type)
constructor creates XmlSerializer which would be like XML adapter for the given type. Then you can useSerialize()
/Deserialize()
methods to adapt to and from XML.