<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>适配器模式 on Tony Bai</title><link>https://tonybai.com/tags/%E9%80%82%E9%85%8D%E5%99%A8%E6%A8%A1%E5%BC%8F/</link><description>Recent content in 适配器模式 on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Tue, 02 Jun 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/%E9%80%82%E9%85%8D%E5%99%A8%E6%A8%A1%E5%BC%8F/index.xml" rel="self" type="application/rss+xml"/><item><title>再见样板代码！Go 官方新提案：函数一键转接口</title><link>https://tonybai.com/2026/06/02/no-more-boilerplate-go-proposal-function-to-interface-conversion/</link><pubDate>Tue, 02 Jun 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/06/02/no-more-boilerplate-go-proposal-function-to-interface-conversion/</guid><description>本文永久链接 – https://tonybai.com/2026/06/02/no-more-boilerplate-go-proposal-function-to-interface-conversion 大家好，我是Tony Bai。 在 Go 语言日常开发中，有一个设计几乎人人写过，但写多了又让人觉得极其繁琐、甚至有些“脱裤子放屁”的样板代码。 假设你需要一个只读数据的 io.Reader...</description></item><item><title>Adapter模式的C实现</title><link>https://tonybai.com/2012/03/05/implement-adapter-pattern-in-c/</link><pubDate>Mon, 05 Mar 2012 00:00:00 +0800</pubDate><guid>https://tonybai.com/2012/03/05/implement-adapter-pattern-in-c/</guid><description>Adapter(适配器)模式是《Design Pattern》一书中结构类模式集中的第一个模式，也是一个真正被我的同事在产品代码中应用的模式。 Adapter模式也是一个相对容易理解的模式，多数书籍和网络资料在描述这个模式时都使用了一个与电源适配器有关的例子，说不定Adapter模式还真的是源于对电源适配器的再思考和挖掘呢。 我们在重构遗留代码时引入了Adapter模式。遗留系统中存在的问题大致是...</description></item></channel></rss>