<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>设计模式 on haifeiWu</title><link>https://haifeiWu.github.io/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/</link><description>Recent content in 设计模式 on haifeiWu</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><managingEditor>whfstudio@163.com (haifeiWu)</managingEditor><webMaster>whfstudio@163.com (haifeiWu)</webMaster><copyright>© 2016～2026 haifeiWu</copyright><lastBuildDate>Thu, 16 Jan 2020 00:00:00 +0800</lastBuildDate><atom:link href="https://haifeiWu.github.io/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/index.xml" rel="self" type="application/rss+xml"/><item><title>使用 Map 实现策略模式</title><link>https://haifeiWu.github.io/posts/shi-yong--map--shi-xian-ce-lve-mo-shi/</link><pubDate>Thu, 16 Jan 2020 00:00:00 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/shi-yong--map--shi-xian-ce-lve-mo-shi/</guid><description>上篇文章在谈到优化代码的时候，有一部分涉及到了使用策略模式优化我们的代码，本篇文章将围绕策略模式谈谈自己的思考~ What? 总的来说，设计模式是对软件设计中普遍存在并且反复出现的各种问题，所提出的通用解决方案，是一系列编码经验的集合。那</description></item><item><title>双重检查锁定与单例</title><link>https://haifeiWu.github.io/posts/shuangchongjianchasuodingyudanli/</link><pubDate>Wed, 13 Nov 2019 14:47:53 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/shuangchongjianchasuodingyudanli/</guid><description>对于单例模式，相信大多数人都可以写出好几种实现方法，懒汉，饿汉等等，然而小小单例真要写好，写的完全正确也并非易事。下面是我们经常使用的一种单例的实现，也就是双重检查所的实现方案。让我们来看一下这个代码是如何工作的：首先当一个线程发出请求后，会先检查 instance 是否为 nu…</description></item><item><title>LRU 算法</title><link>https://haifeiWu.github.io/posts/lru--suan-fa/</link><pubDate>Sat, 29 Jun 2019 00:00:00 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/lru--suan-fa/</guid><description>What？LRU 是 Least Recently Used 的缩写，即最近最少使用，是一种常用的页面置换算法，选择最近最久未使用的页面予以淘汰。该算法赋予每个页面一个访问字段，用来记录一个页面自上次被访问以来所经历的时间 t，当须淘汰</description></item><item><title>Filter 设计模式编码实践</title><link>https://haifeiWu.github.io/posts/filter-shejimoshibianmashijian/</link><pubDate>Fri, 21 Sep 2018 10:55:49 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/filter-shejimoshibianmashijian/</guid><description>最近项目中遇到各种输出数据监控，数据校验等逻辑，一个个实现很是麻烦。项目是中途接手的，不是很熟悉，偶然一天发现项目中对 Filter 的使用扩展起来很是方便，所以，今天楼主来分享下，也为自己学习做个记录。下面我们从三方面来阐述。Filter 在设计模式里面被称为责任链设计模式…</description></item></channel></rss>