什么是包装类? [英] What is a wrapper class?

查看:144
本文介绍了什么是包装类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是包装类?

这些类如何有用?

What is a wrapper class?
How are such classes useful?

推荐答案

包装类是包装或封装另一个类或组件的功能的任何类。通过从底层或组件的实现中提供一定程度的抽象,这些是有用的;例如,包装COM组件的包装器类可以管理调用COM组件的过程,而不用打扰调用代码。它们还可以通过减少涉及的数量接口点来简化底层对象的使用;经常地,这使得更安全地使用底层组件。

In general, a wrapper class is any class which "wraps" or "encapsulates" the functionality of another class or component. These are useful by providing a level of abstraction from the implementation of the underlying class or component; for example, wrapper classes that wrap COM components can manage the process of invoking the COM component without bothering the calling code with it. They can also simplify the use of the underlying object by reducing the number interface points involved; frequently, this makes for more secure use of underlying components.

这篇关于什么是包装类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆