zoukankan      html  css  js  c++  java
  • 理解什么是适配器(adapter)和接口(interface)

    ● 适配器(adapter)

    In computing, adapter is a hardware device or software component that converts transmitted data from one presentation form to another. The data presentation can be, for example, a message sent between objects in an application or a packet sent through a network.

    适配器就是一个接口转换器,它可以是一个独立的硬件接口设备(如独立显卡即显示适配器),允许硬件或电子接口(如主板的显示接口)与其它硬件或电子接口(如显示器接口)相连,也可以是信息接口。比如:电源适配器、三角架基座转接部件、USB与串口的转接设备等。

    适配器通俗一点说就是一种起中间连接作用的配件,使用这种配件的作用在于简化主机的硬件设计,增加主机的通用性和灵活性。

    例如:显示卡是使用的最多的适配器了,由于我们能见到的显示器种类太多,他们的分辨率和刷新频率都会有差别,如果让主板上的显示输出口为各种类型的显示器准备好不同的输出信号,那恐怕这块电路板就要比主板还要大了,而且这块主板一生最多也就能配几个类型的显示器使用,多余的就浪费了,于是人们达成共识:主板只提供显示接口搜索,具体的显示类型单独做一块显示卡,形成主板的显示接口-显示卡(即显示适配器)-显示器这样一个硬件连接形式,这样既节省主板的电路,又可以根据需要通过更换显示卡来适应显示器的需要。

    常用的适配器还有电源适配器、网卡适配器、网络适配器、打印适配器...等等。

    One that adapts, such as a device used to effect operative compatibility between different parts of one or more pieces of apparatus.

    适应物,如用于在一件或多件仪器的不同部件之间实现有效兼容性的装置

    Android中的Adapter:

    Adapter是连接后端数据和前端显示的适配器接口,是数据和UIView)之间一个重要的纽带。在常见的View(ListView,GridView)等地方都需要用到Adapter。如下图直观的表达了DataAdapterView三者的关系:

           

    ● 接口(interface)

    In computing, an interface is a shared boundary across which two separate components of a computer system exchange information. The exchange can be between software, computer hardware, peripheral devices, humans and combinations of these. Some computer hardware devices such as a touchscreen can both send and receive data through the interface, while others such as a mouse, microphone or joystick are one way only.

    三种接口:

    人类与电脑等信息机器或人类与程序之间的接口称为用户界面。

    电脑等信息机器硬件组件间的接口叫硬件接口。

    电脑等信息机器软件组件间的接口叫软件接口。

    VGA接口,又叫D-SUB接口。它传输红、绿、蓝模拟信号以及同步信号(水平和垂直信号)。当受到干扰时,显示器可能会出现水波纹状显示。

    VGA已经比较老了,虽然现在的台式电脑上仍然保留,但一些显卡、超薄笔记本已经不具备。

    为什么Java要把一个只包含抽象方法的类称为接口?

    可以这样想象?

    接口的设置是为了提供便利例如插座的插孔也是一种接口它就为人们使用电器提供了便利比起自己把插头和几根电线接起来直接把插头插进插孔要更便利并且更安全.

    拿怎么实现这个接口呢用一个电器实现呗.

    笔记本电脑只需接一个插孔(一个类可实现一个接口)

    台式电脑需要多个插孔(一个类也可实现多个接口)

         

  • 相关阅读:
    初识python 2.x与3.x 区别
    装饰器
    函数的进阶
    Spring Boot启动问题:Cannot determine embedded database driver class for database type NONE
    22.Spring Cloud Config安全保护
    23.Spring Cloud Bus 无法更新问题(踩坑) Spring cloud config server Could not fetch remote for master remote
    24.Spring Cloud之Spring Cloud Config及Spring Cloud Bus
    Spring Boot整合Spring Data Elasticsearch 踩坑
    项目中Spring Security 整合Spring Session实现记住我功能
    32.再谈SpringBoot文件上传
  • 原文地址:https://www.cnblogs.com/ArrozZhu/p/8400240.html
Copyright © 2011-2022 走看看