[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"site-config":3,"primary-menu":20,"tags-cloud":109,"tagposts-interview-4":293},{"config":4,"socialLinks":19},{"title":5,"subtitle":6,"logoUrl":7,"faviconUrl":8,"footerText":9,"beianIcp":10,"beianPublicSecurity":9,"seoDescription":11,"seoKeywords":12,"homepageTitle":13,"homepageSubtitle":14,"analyticsHeadCode":15,"planetQrcodeUrl":16,"planetIntroHtml":9,"planetCtaText":17,"updatedAt":18},"编码世界","用编码改变世界","https:\u002F\u002Fcdn.mashangan.com\u002Fupload\u002F2026\u002F09\u002F2f277021172f43f6bb34e1c115760b7f.png","https:\u002F\u002Fcdn.mashangan.com\u002Fupload\u002F2026\u002F09\u002Fdcbad022e68c4a729a5dc4997a9bba8a.png","","苏ICP备2026073884号","编码世界（mashangan.com）是面向 Java 后端与 Go 语言的系统化编程教程站：提供\nMyBatis Plus、Lombok、Java 8、IDEA、Docker 等原创图文教程，以及 JVM、并发、\nSpring、MySQL、Redis、消息队列、计算机网络等大厂面试八股题库，另有可落地的\n项目实战系列，帮你从入门到精通。","编码世界,Java教程,Go语言教程,Docker教程,MyBatis Plus教程,Lombok教程, Java 8新特性,IDEA教程,Java面试题,八股文,JVM面试题,Java并发面试题, MySQL面试题,Redis面试题,Spring面试题,消息队列面试题,高并发,分库分表, Netty面试题,计算机网络面试题,AI Agent,RAG,程序员学习路线","Java全栈系统化编程教程","覆盖 MyBatis Plus、Lombok、Java 8、IDEA、Go、Docker 等原创图文教程，配套大厂面试八股题库，从入门到精通，持续更新","\u003Cscript>\nvar _hmt = _hmt || [];\n(function() {\n  var hm = document.createElement(\"script\");\n  hm.src = \"https:\u002F\u002Fhm.baidu.com\u002Fhm.js?f00af7e56d956c02e11efed4131379b0\";\n  var s = document.getElementsByTagName(\"script\")[0]; \n  s.parentNode.insertBefore(hm, s);\n})();\n\u003C\u002Fscript>\n","https:\u002F\u002Fcdn.mashangan.com\u002Fupload\u002F2026\u002F09\u002Fc1a8f5de46584d3eb0bc762c180a5db9.png","扫码加入知识星球","2026-10-05T13:09:51.904487Z",[],{"metadata":21,"spec":24,"menuItems":35},{"name":22,"creationTimestamp":23},"primary","2026-09-12T06:13:55.024154Z",{"displayName":25,"menuItems":26},"主菜单",[27,28,29,30,31,32,33,34],"88c3f10b-321c-4092-86a8-70db00251b74","menu-item-izrtmxer","c4c814d1-0c2c-456b-8c96-4864965fee94","menu-item-tags","menu-item-column","menu-item-tools","menu-item-zsxq","menu-item-ocrxlczu",[36,45,55,64,73,82,91,100],{"displayName":37,"metadata":38,"spec":40,"status":43,"children":44},"首页",{"name":27,"creationTimestamp":39},"2026-09-12T06:13:54.422830Z",{"displayName":37,"href":41,"priority":42,"menuName":22},"\u002F",0,{"displayName":37,"href":41},[],{"displayName":46,"metadata":47,"spec":49,"status":53,"children":54},"Java面试八股",{"name":28,"creationTimestamp":48},"2026-09-13T09:42:02.854891Z",{"displayName":46,"href":50,"target":51,"priority":52,"menuName":22},"\u002Fjava-interview","_self",1,{"displayName":46,"href":50},[],{"displayName":56,"metadata":57,"spec":59,"status":62,"children":63},"文章",{"name":29,"creationTimestamp":58},"2026-09-12T06:13:54.457307Z",{"displayName":56,"href":60,"priority":61,"menuName":22},"\u002Farchives",2,{"displayName":56,"href":60},[],{"displayName":65,"metadata":66,"spec":68,"status":71,"children":72},"标签",{"name":30,"creationTimestamp":67},"2026-10-07T00:42:42.754151Z",{"displayName":65,"href":69,"priority":70,"menuName":22},"\u002Ftags",3,{"displayName":65,"href":69},[],{"displayName":74,"metadata":75,"spec":77,"status":80,"children":81},"项目实战",{"name":31,"creationTimestamp":76},"2026-09-14T00:35:08.138170Z",{"displayName":74,"href":78,"target":51,"priority":79,"menuName":22},"\u002Fcolumn",4,{"displayName":74,"href":78},[],{"displayName":83,"metadata":84,"spec":86,"status":89,"children":90},"在线工具",{"name":32,"creationTimestamp":85},"2026-09-14T00:35:08.171474Z",{"displayName":83,"href":87,"target":51,"priority":88,"menuName":22},"\u002Ftools",5,{"displayName":83,"href":87},[],{"displayName":92,"metadata":93,"spec":95,"status":98,"children":99},"知识星球",{"name":33,"creationTimestamp":94},"2026-09-14T00:35:08.199145Z",{"displayName":92,"href":96,"target":51,"priority":97,"menuName":22},"\u002Fzsxq",6,{"displayName":92,"href":96},[],{"displayName":101,"metadata":102,"spec":104,"status":107,"children":108},"特价云服务",{"name":34,"creationTimestamp":103},"2026-09-25T15:30:59.201614Z",{"displayName":101,"href":105,"target":51,"priority":106,"menuName":22},"\u002Fserver",7,{"displayName":101,"href":105},[],[110,117,124,131,138,145,152,159,166,172,178,184,191,197,203,209,215,221,227,233,239,245,251,257,263,269,275,281,287],{"metadata":111,"spec":113,"postCount":116},{"name":112},"tag-04980744",{"displayName":114,"slug":115},"面试题","interview",118,{"metadata":118,"spec":120,"postCount":123},{"name":119},"tag-93f725a0",{"displayName":121,"slug":122},"Java","java",68,{"metadata":125,"spec":127,"postCount":130},{"name":126},"tag-05b6053c",{"displayName":128,"slug":129},"Docker","docker",43,{"metadata":132,"spec":134,"postCount":137},{"name":133},"tag-1cba77c3",{"displayName":135,"slug":136},"IDEA","idea",32,{"metadata":139,"spec":141,"postCount":144},{"name":140},"tag-116a0109",{"displayName":142,"slug":143},"数字孪生","digital-twin",19,{"metadata":146,"spec":148,"postCount":151},{"name":147},"tag-a2fb95ac",{"displayName":149,"slug":150},"MyBatis Plus","mybatis-plus",18,{"metadata":153,"spec":155,"postCount":158},{"name":154},"tag-cc6220f9",{"displayName":156,"slug":157},"Lombok","lombok",15,{"metadata":160,"spec":162,"postCount":165},{"name":161},"tag-2a2d595e",{"displayName":163,"slug":164},"Spring","spring",10,{"metadata":167,"spec":169,"postCount":165},{"name":168},"tag-1d8a4975",{"displayName":170,"slug":171},"消息队列","mq",{"metadata":173,"spec":175,"postCount":165},{"name":174},"tag-17245299",{"displayName":176,"slug":177},"并发","concurrency",{"metadata":179,"spec":181,"postCount":165},{"name":180},"tag-4921c0e2",{"displayName":182,"slug":183},"AI","ai",{"metadata":185,"spec":187,"postCount":190},{"name":186},"tag-53bb7900",{"displayName":188,"slug":189},"卫星仿真","satellite",9,{"metadata":192,"spec":194,"postCount":88},{"name":193},"tag-62377bcf",{"displayName":195,"slug":196},"Spring Cloud","spring-cloud",{"metadata":198,"spec":200,"postCount":88},{"name":199},"tag-81c3b080",{"displayName":201,"slug":202},"MySQL","mysql",{"metadata":204,"spec":206,"postCount":88},{"name":205},"tag-86a1b907",{"displayName":207,"slug":208},"Redis","redis",{"metadata":210,"spec":212,"postCount":88},{"name":211},"tag-18897dcf",{"displayName":213,"slug":214},"Elasticsearch","elasticsearch",{"metadata":216,"spec":218,"postCount":88},{"name":217},"tag-6ce80d8e",{"displayName":219,"slug":220},"JVM","jvm",{"metadata":222,"spec":224,"postCount":88},{"name":223},"tag-aa4e1b8c",{"displayName":225,"slug":226},"Dubbo","dubbo",{"metadata":228,"spec":230,"postCount":88},{"name":229},"tag-9e30c249",{"displayName":231,"slug":232},"Netty","netty",{"metadata":234,"spec":236,"postCount":88},{"name":235},"tag-2199ace5",{"displayName":237,"slug":238},"ZooKeeper","zookeeper",{"metadata":240,"spec":242,"postCount":88},{"name":241},"tag-7c298a76",{"displayName":243,"slug":244},"设计模式","design-pattern",{"metadata":246,"spec":248,"postCount":88},{"name":247},"tag-6cf6cea9",{"displayName":249,"slug":250},"高可用","high-availability",{"metadata":252,"spec":254,"postCount":88},{"name":253},"tag-918786ab",{"displayName":255,"slug":256},"分库分表","sharding",{"metadata":258,"spec":260,"postCount":88},{"name":259},"tag-91e02cd2",{"displayName":261,"slug":262},"计算机网络","network",{"metadata":264,"spec":266,"postCount":88},{"name":265},"tag-dd302f94",{"displayName":267,"slug":268},"操作系统","os",{"metadata":270,"spec":272,"postCount":88},{"name":271},"tag-1b359d87",{"displayName":273,"slug":274},"Tomcat","tomcat",{"metadata":276,"spec":278,"postCount":79},{"name":277},"tag-f0d71b77",{"displayName":279,"slug":280},"MyBatis","mybatis",{"metadata":282,"spec":284,"postCount":52},{"name":283},"tag-a118a308",{"displayName":285,"slug":286},"时序数据库","tsdb",{"metadata":288,"spec":290,"postCount":42},{"name":289},"tag-34d1f91f",{"displayName":291,"slug":292},"Go","go",{"page":79,"size":294,"total":116,"items":295,"first":308,"last":308,"hasNext":304,"hasPrevious":304,"totalPages":97},20,[296,335,364,393,422,451,485,514,543,572,601,641,676,711,746,781,818,850,882,914],{"metadata":297,"spec":300,"status":310,"categories":315,"tags":328},{"name":298,"creationTimestamp":299},"post-net-http-status-0d879b34","2026-09-13T10:01:06.196220Z",{"title":301,"slug":302,"cover":9,"excerpt":303,"publishTime":305,"categories":306,"tags":307,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"常见 HTTP 状态码？","net-http-status",{"raw":9,"autoGenerate":304},true,"2026-09-13T10:01:06.253755Z",[262],[112,259],false,"PUBLIC",{"permalink":311,"excerpt":312,"lastModifyTime":313,"phase":314},"\u002Farchives\u002Fnet-http-status","一、1xx 信息 100 Continue：继续发送。 二、2xx 成功 200 OK：请求成功。 201 Created：资源创建成功。 204 No Content：成功但无响应体。 206 Partial Content：范围请求。 三、3xx 重定向 301 Moved Permanentl","2026-09-16T09:14:44.134667Z","PUBLISHED",[316],{"metadata":317,"spec":322,"status":326,"postCount":88},{"name":262,"creationTimestamp":318,"labels":319,"annotations":320},"2026-09-13T09:13:25.868986Z",{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},"updating",{"displayName":323,"slug":262,"cover":9,"description":324,"priority":325,"hideFromList":308,"preventParentPostCascadeQuery":308},"计算机网络面试题","计算机网络面试题：TCP\u002FIP、HTTP\u002FHTTPS、握手挥手、DNS 与常见网络问题排查。",23,{"permalink":327,"postCount":88,"visiblePostCount":88},"\u002Fcategories\u002Fnetwork",[329,332],{"metadata":330,"spec":331},{"name":112},{"displayName":114,"slug":115},{"metadata":333,"spec":334},{"name":259},{"displayName":261,"slug":262},{"metadata":336,"spec":339,"status":346,"categories":350,"tags":357},{"name":337,"creationTimestamp":338},"post-net-http-https-ab8b6109","2026-09-13T10:01:05.852794Z",{"title":340,"slug":341,"cover":9,"excerpt":342,"publishTime":343,"categories":344,"tags":345,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"HTTP 和 HTTPS 的区别？","net-http-https",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:06.045966Z",[262],[259,112],{"permalink":347,"excerpt":348,"lastModifyTime":349,"phase":314},"\u002Farchives\u002Fnet-http-https","一、核心区别 HTTPS = HTTP + TLS\u002FSSL，在 HTTP 和 TCP 之间加了加密层。 二、对比 维度 HTTP HTTPS 端口 80 443 传输 明文 加密 证书 不需要 需要 CA 证书 安全 易被窃听\u002F篡改 机密性+完整性+身份认证 性能 较快 略慢（TLS 握手） 三、T","2026-09-16T09:14:46.033294Z",[351],{"metadata":352,"spec":355,"status":356,"postCount":88},{"name":262,"creationTimestamp":318,"labels":353,"annotations":354},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":323,"slug":262,"cover":9,"description":324,"priority":325,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":327,"postCount":88,"visiblePostCount":88},[358,361],{"metadata":359,"spec":360},{"name":259},{"displayName":261,"slug":262},{"metadata":362,"spec":363},{"name":112},{"displayName":114,"slug":115},{"metadata":365,"spec":368,"status":375,"categories":379,"tags":386},{"name":366,"creationTimestamp":367},"post-net-tcp-vs-udp-39b5d32e","2026-09-13T10:01:05.685781Z",{"title":369,"slug":370,"cover":9,"excerpt":371,"publishTime":372,"categories":373,"tags":374,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"TCP 和 UDP 的区别？","net-tcp-vs-udp",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:05.743404Z",[262],[259,112],{"permalink":376,"excerpt":377,"lastModifyTime":378,"phase":314},"\u002Farchives\u002Fnet-tcp-vs-udp","一、对比 维度 TCP UDP 连接 面向连接 无连接 可靠性 可靠 不可靠 顺序 保证 不保证 流量控制 有 无 拥塞控制 有 无 首部大小 20~60 字节 8 字节 性能 较低 较高 二、TCP 保证可靠的机制 序列号 + 确认应","2026-09-16T09:14:43.649091Z",[380],{"metadata":381,"spec":384,"status":385,"postCount":88},{"name":262,"creationTimestamp":318,"labels":382,"annotations":383},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":323,"slug":262,"cover":9,"description":324,"priority":325,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":327,"postCount":88,"visiblePostCount":88},[387,390],{"metadata":388,"spec":389},{"name":259},{"displayName":261,"slug":262},{"metadata":391,"spec":392},{"name":112},{"displayName":114,"slug":115},{"metadata":394,"spec":397,"status":404,"categories":408,"tags":415},{"name":395,"creationTimestamp":396},"post-net-tcp-four-way-bc1b2a69","2026-09-13T10:01:05.371016Z",{"title":398,"slug":399,"cover":9,"excerpt":400,"publishTime":401,"categories":402,"tags":403,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"TCP 四次挥手过程？","net-tcp-four-way",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:05.571824Z",[262],[259,112],{"permalink":405,"excerpt":406,"lastModifyTime":407,"phase":314},"\u002Farchives\u002Fnet-tcp-four-way","一、过程 客户端发 FIN=1, seq=u，进入 FIN_WAIT_1。 服务端回 ACK=1, ack=u+1，进入 CLOSE_WAIT；客户端进入 FIN_WAIT_2。 服务端发完数据后发 FIN=1, seq=w，进入 LAST_ACK。 客户端回 ACK=1, ack=w+1，进入 T","2026-09-16T09:14:45.072516Z",[409],{"metadata":410,"spec":413,"status":414,"postCount":88},{"name":262,"creationTimestamp":318,"labels":411,"annotations":412},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":323,"slug":262,"cover":9,"description":324,"priority":325,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":327,"postCount":88,"visiblePostCount":88},[416,419],{"metadata":417,"spec":418},{"name":259},{"displayName":261,"slug":262},{"metadata":420,"spec":421},{"name":112},{"displayName":114,"slug":115},{"metadata":423,"spec":426,"status":433,"categories":437,"tags":444},{"name":424,"creationTimestamp":425},"post-net-tcp-three-way-88b96e5c","2026-09-13T10:01:05.179293Z",{"title":427,"slug":428,"cover":9,"excerpt":429,"publishTime":430,"categories":431,"tags":432,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"TCP 三次握手过程？","net-tcp-three-way",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:05.250642Z",[262],[112,259],{"permalink":434,"excerpt":435,"lastModifyTime":436,"phase":314},"\u002Farchives\u002Fnet-tcp-three-way","一、过程 第一次：客户端发送 SYN=1, seq=x，进入 SYN_SENT 状态。 第二次：服务端回复 SYN=1, ACK=1, seq=y, ack=x+1，进入 SYN_RCVD 状态。 第三次：客户端回复 ACK=1, seq=x+1, ack=y+1，双方进入 ESTABLISHED ","2026-09-16T09:14:44.609162Z",[438],{"metadata":439,"spec":442,"status":443,"postCount":88},{"name":262,"creationTimestamp":318,"labels":440,"annotations":441},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":323,"slug":262,"cover":9,"description":324,"priority":325,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":327,"postCount":88,"visiblePostCount":88},[445,448],{"metadata":446,"spec":447},{"name":112},{"displayName":114,"slug":115},{"metadata":449,"spec":450},{"name":259},{"displayName":261,"slug":262},{"metadata":452,"spec":455,"status":462,"categories":466,"tags":478},{"name":453,"creationTimestamp":454},"post-dp-decorator-0d15e0d6","2026-09-13T10:01:04.972796Z",{"title":456,"slug":457,"cover":9,"excerpt":458,"publishTime":459,"categories":460,"tags":461,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"装饰器模式的原理和应用？","dp-decorator",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:05.021631Z",[244],[112,241],{"permalink":463,"excerpt":464,"lastModifyTime":465,"phase":314},"\u002Farchives\u002Fdp-decorator","一、定义 动态地给对象添加额外职责，比继承更灵活。 二、结构 Component：抽象组件。 ConcreteComponent：具体组件。 Decorator：装饰器抽象类，持有 Component 引用。 ConcreteDecorator：具体装饰器，添加职责。 三、Java IO 中的应用 ","2026-09-16T09:14:42.138299Z",[467],{"metadata":468,"spec":472,"status":476,"postCount":88},{"name":244,"creationTimestamp":469,"labels":470,"annotations":471},"2026-09-13T09:13:25.707776Z",{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":473,"slug":244,"cover":9,"description":474,"priority":475,"hideFromList":308,"preventParentPostCascadeQuery":308},"设计模式面试题","设计模式面试题：23 种设计模式的适用场景、实现要点及在主流框架中的真实应用。",16,{"permalink":477,"postCount":88,"visiblePostCount":88},"\u002Fcategories\u002Fdesign-pattern",[479,482],{"metadata":480,"spec":481},{"name":112},{"displayName":114,"slug":115},{"metadata":483,"spec":484},{"name":241},{"displayName":243,"slug":244},{"metadata":486,"spec":489,"status":496,"categories":500,"tags":507},{"name":487,"creationTimestamp":488},"post-dp-observer-d3062f72","2026-09-13T10:01:04.805950Z",{"title":490,"slug":491,"cover":9,"excerpt":492,"publishTime":493,"categories":494,"tags":495,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"观察者模式的原理和应用？","dp-observer",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:04.852967Z",[244],[112,241],{"permalink":497,"excerpt":498,"lastModifyTime":499,"phase":314},"\u002Farchives\u002Fdp-observer","一、定义 定义对象间一对多依赖，当一个对象状态变化时，所有依赖它的对象自动收到通知并更新。也叫发布-订阅模式。 二、结构 Subject（主题）：维护观察者列表，提供注册\u002F注销\u002F通知方法。 Observer（观察者）：定义更新接口。 三、JDK 实现 \u002F\u002F 主题\npublic class Subje","2026-09-16T09:14:43.048538Z",[501],{"metadata":502,"spec":505,"status":506,"postCount":88},{"name":244,"creationTimestamp":469,"labels":503,"annotations":504},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":473,"slug":244,"cover":9,"description":474,"priority":475,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":477,"postCount":88,"visiblePostCount":88},[508,511],{"metadata":509,"spec":510},{"name":112},{"displayName":114,"slug":115},{"metadata":512,"spec":513},{"name":241},{"displayName":243,"slug":244},{"metadata":515,"spec":518,"status":525,"categories":529,"tags":536},{"name":516,"creationTimestamp":517},"post-dp-strategy-9bce770c","2026-09-13T10:01:04.620695Z",{"title":519,"slug":520,"cover":9,"excerpt":521,"publishTime":522,"categories":523,"tags":524,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"策略模式的原理和应用？","dp-strategy",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:04.667250Z",[244],[241,112],{"permalink":526,"excerpt":527,"lastModifyTime":528,"phase":314},"\u002Farchives\u002Fdp-strategy","一、定义 定义一系列算法，封装成独立策略类，使它们可互换。客户端运行时选择策略，避免大量 if-else。 二、结构 Strategy：策略接口。 ConcreteStrategy：具体策略实现。 Context：持有策略引用，调用策略方法。 三、示例 public interface PayStr","2026-09-16T09:14:41.267303Z",[530],{"metadata":531,"spec":534,"status":535,"postCount":88},{"name":244,"creationTimestamp":469,"labels":532,"annotations":533},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":473,"slug":244,"cover":9,"description":474,"priority":475,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":477,"postCount":88,"visiblePostCount":88},[537,540],{"metadata":538,"spec":539},{"name":241},{"displayName":243,"slug":244},{"metadata":541,"spec":542},{"name":112},{"displayName":114,"slug":115},{"metadata":544,"spec":547,"status":554,"categories":558,"tags":565},{"name":545,"creationTimestamp":546},"post-dp-factory-76119879","2026-09-13T10:01:04.417941Z",{"title":548,"slug":549,"cover":9,"excerpt":550,"publishTime":551,"categories":552,"tags":553,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"工厂模式有哪几种？","dp-factory",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:04.465595Z",[244],[112,241],{"permalink":555,"excerpt":556,"lastModifyTime":557,"phase":314},"\u002Farchives\u002Fdp-factory","一、简单工厂 一个工厂类根据参数创建不同产品。违反开闭原则，新增产品需改工厂。 public class ShapeFactory {\n    public Shape create(String type) {\n        if (\"circle\".equals(type)) return n","2026-09-16T09:13:45.121345Z",[559],{"metadata":560,"spec":563,"status":564,"postCount":88},{"name":244,"creationTimestamp":469,"labels":561,"annotations":562},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":473,"slug":244,"cover":9,"description":474,"priority":475,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":477,"postCount":88,"visiblePostCount":88},[566,569],{"metadata":567,"spec":568},{"name":112},{"displayName":114,"slug":115},{"metadata":570,"spec":571},{"name":241},{"displayName":243,"slug":244},{"metadata":573,"spec":576,"status":583,"categories":587,"tags":594},{"name":574,"creationTimestamp":575},"post-dp-singleton-efb0465b","2026-09-13T10:01:04.095486Z",{"title":577,"slug":578,"cover":9,"excerpt":579,"publishTime":580,"categories":581,"tags":582,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"单例模式有哪些实现方式？","dp-singleton",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:04.302972Z",[244],[112,241],{"permalink":584,"excerpt":585,"lastModifyTime":586,"phase":314},"\u002Farchives\u002Fdp-singleton","一、饿汉式 public class Singleton {\n    private static final Singleton INSTANCE = new Singleton();\n    private Singleton() {}\n    public static Singleton g","2026-09-16T09:14:41.709744Z",[588],{"metadata":589,"spec":592,"status":593,"postCount":88},{"name":244,"creationTimestamp":469,"labels":590,"annotations":591},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":473,"slug":244,"cover":9,"description":474,"priority":475,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":477,"postCount":88,"visiblePostCount":88},[595,598],{"metadata":596,"spec":597},{"name":112},{"displayName":114,"slug":115},{"metadata":599,"spec":600},{"name":241},{"displayName":243,"slug":244},{"metadata":602,"spec":605,"status":613,"categories":616,"tags":628},{"name":603,"creationTimestamp":604},"post-sc-feign-edab66ba","2026-09-13T10:01:03.910779Z",{"title":606,"slug":607,"excerpt":608,"publishTime":610,"categories":611,"tags":612,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"OpenFeign 的工作原理？","sc-feign",{"raw":609,"autoGenerate":304},"一、使用 @FeignClient(name = \"user-service\")\npublic interface UserClient {\n    @GetMapping(\"\u002Fuser\u002F{id}\")\n    User getUser(@PathVariable Long id);\n}\n 二、原理 ","2026-09-13T10:01:03.959628Z",[196],[193,119,161,112],{"permalink":614,"excerpt":609,"lastModifyTime":615,"phase":314},"\u002Farchives\u002Fsc-feign","2026-10-07T00:57:53.274365Z",[617],{"metadata":618,"spec":622,"status":626,"postCount":88},{"name":196,"creationTimestamp":619,"labels":620,"annotations":621},"2026-09-13T09:13:25.651927Z",{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":623,"slug":196,"cover":9,"description":624,"priority":625,"hideFromList":308,"preventParentPostCascadeQuery":308},"Spring Cloud 面试题","Spring Cloud 微服务面试题：注册中心、网关、配置中心、熔断限流与链路治理。",14,{"permalink":627,"postCount":88,"visiblePostCount":88},"\u002Fcategories\u002Fspring-cloud",[629,632,635,638],{"metadata":630,"spec":631},{"name":193},{"displayName":195,"slug":196},{"metadata":633,"spec":634},{"name":119},{"displayName":121,"slug":122},{"metadata":636,"spec":637},{"name":161},{"displayName":163,"slug":164},{"metadata":639,"spec":640},{"name":112},{"displayName":114,"slug":115},{"metadata":642,"spec":645,"status":652,"categories":656,"tags":663},{"name":643,"creationTimestamp":644},"post-sc-sentinel-aca6d4ca","2026-09-13T10:01:03.588033Z",{"title":646,"slug":647,"cover":9,"excerpt":648,"publishTime":649,"categories":650,"tags":651,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"Sentinel 的工作原理？","sc-sentinel",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:03.793927Z",[196],[161,112,193,119],{"permalink":653,"excerpt":654,"lastModifyTime":655,"phase":314},"\u002Farchives\u002Fsc-sentinel","一、核心功能 流量控制：QPS、线程数限流，支持匀速、预热等模式。 熔断降级：慢调用比例、异常比例、异常数达到阈值时熔断。 系统保护：CPU、负载、入口 QPS、平均 RT、并发线程数。 热点参数限流：针对参数维度限流。 二、工作原理 基于滑动窗口统计实时指标。 通过责任链模式处理请求：NodeSe","2026-09-16T09:14:38.324239Z",[657],{"metadata":658,"spec":661,"status":662,"postCount":88},{"name":196,"creationTimestamp":619,"labels":659,"annotations":660},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":623,"slug":196,"cover":9,"description":624,"priority":625,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":627,"postCount":88,"visiblePostCount":88},[664,667,670,673],{"metadata":665,"spec":666},{"name":161},{"displayName":163,"slug":164},{"metadata":668,"spec":669},{"name":112},{"displayName":114,"slug":115},{"metadata":671,"spec":672},{"name":193},{"displayName":195,"slug":196},{"metadata":674,"spec":675},{"name":119},{"displayName":121,"slug":122},{"metadata":677,"spec":680,"status":687,"categories":691,"tags":698},{"name":678,"creationTimestamp":679},"post-sc-gateway-3716276a","2026-09-13T10:01:03.236916Z",{"title":681,"slug":682,"cover":9,"excerpt":683,"publishTime":684,"categories":685,"tags":686,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"Spring Cloud Gateway 的工作原理？","sc-gateway",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:03.432717Z",[196],[112,193,161,119],{"permalink":688,"excerpt":689,"lastModifyTime":690,"phase":314},"\u002Farchives\u002Fsc-gateway","一、核心概念 Route：路由，由 ID、目标 URI、断言、过滤器组成。 Predicate：断言，匹配 HTTP 请求的条件（路径、方法、Header 等）。 Filter：过滤器，请求前后处理（鉴权、限流、日志、修改请求\u002F响应）。 二、执行流程 请求进入 Gateway，由 HandlerMa","2026-09-16T09:14:40.145885Z",[692],{"metadata":693,"spec":696,"status":697,"postCount":88},{"name":196,"creationTimestamp":619,"labels":694,"annotations":695},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":623,"slug":196,"cover":9,"description":624,"priority":625,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":627,"postCount":88,"visiblePostCount":88},[699,702,705,708],{"metadata":700,"spec":701},{"name":112},{"displayName":114,"slug":115},{"metadata":703,"spec":704},{"name":193},{"displayName":195,"slug":196},{"metadata":706,"spec":707},{"name":161},{"displayName":163,"slug":164},{"metadata":709,"spec":710},{"name":119},{"displayName":121,"slug":122},{"metadata":712,"spec":715,"status":722,"categories":726,"tags":733},{"name":713,"creationTimestamp":714},"post-sc-nacos-14cc902b","2026-09-13T10:01:03.041394Z",{"title":716,"slug":717,"cover":9,"excerpt":718,"publishTime":719,"categories":720,"tags":721,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"Nacos 的 CP 和 AP 模式？","sc-nacos",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:03.086427Z",[196],[119,161,193,112],{"permalink":723,"excerpt":724,"lastModifyTime":725,"phase":314},"\u002Farchives\u002Fsc-nacos","一、AP 模式（临时实例） 服务实例注册后，通过心跳维持，心跳超时则剔除。 各节点数据可能短暂不一致，但保证可用性。 适合服务注册场景，实例变化频繁。 二、CP 模式（持久实例） 实例注册需要集群半数以上节点确认，强一致性。 节点不可用时不会自动剔除，需手动注销。 适合需要强一致性的场景。 三、切换","2026-09-16T09:14:39.577571Z",[727],{"metadata":728,"spec":731,"status":732,"postCount":88},{"name":196,"creationTimestamp":619,"labels":729,"annotations":730},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":623,"slug":196,"cover":9,"description":624,"priority":625,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":627,"postCount":88,"visiblePostCount":88},[734,737,740,743],{"metadata":735,"spec":736},{"name":119},{"displayName":121,"slug":122},{"metadata":738,"spec":739},{"name":161},{"displayName":163,"slug":164},{"metadata":741,"spec":742},{"name":193},{"displayName":195,"slug":196},{"metadata":744,"spec":745},{"name":112},{"displayName":114,"slug":115},{"metadata":747,"spec":750,"status":757,"categories":761,"tags":768},{"name":748,"creationTimestamp":749},"post-sc-components-dbcccb25","2026-09-13T10:01:02.855129Z",{"title":751,"slug":752,"cover":9,"excerpt":753,"publishTime":754,"categories":755,"tags":756,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"Spring Cloud 常用组件有哪些？","sc-components",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:02.906713Z",[196],[161,112,119,193],{"permalink":758,"excerpt":759,"lastModifyTime":760,"phase":314},"\u002Farchives\u002Fsc-components","一、注册中心 Eureka：Netflix 出品，AP，自我保护机制。 Nacos：阿里出品，支持 CP\u002FAP 切换，同时支持配置中心。 Consul：支持服务发现、KV 存储、健康检查。 二、配置中心 Spring Cloud Config：基于 Git。 Nacos Config：配置实时推送。","2026-09-16T09:14:35.918447Z",[762],{"metadata":763,"spec":766,"status":767,"postCount":88},{"name":196,"creationTimestamp":619,"labels":764,"annotations":765},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":623,"slug":196,"cover":9,"description":624,"priority":625,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":627,"postCount":88,"visiblePostCount":88},[769,772,775,778],{"metadata":770,"spec":771},{"name":161},{"displayName":163,"slug":164},{"metadata":773,"spec":774},{"name":112},{"displayName":114,"slug":115},{"metadata":776,"spec":777},{"name":119},{"displayName":121,"slug":122},{"metadata":779,"spec":780},{"name":193},{"displayName":195,"slug":196},{"metadata":782,"spec":785,"status":792,"categories":796,"tags":808},{"name":783,"creationTimestamp":784},"post-spring-circular-dependency-94e0cc24","2026-09-13T10:01:02.690961Z",{"title":786,"slug":787,"cover":9,"excerpt":788,"publishTime":789,"categories":790,"tags":791,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"Spring 如何解决循环依赖？","spring-circular-dependency",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:02.739844Z",[164],[112,119,161],{"permalink":793,"excerpt":794,"lastModifyTime":795,"phase":314},"\u002Farchives\u002Fspring-circular-dependency","一、什么是循环依赖 A 依赖 B，B 依赖 A，形成循环。 二、三级缓存 Spring 通过三级缓存解决 singleton 的循环依赖： singletonObjects：一级缓存，存完全初始化好的 Bean。 earlySingletonObjects：二级缓存，存早期引用（实例化但未属性赋值）","2026-09-16T09:14:37.864948Z",[797],{"metadata":798,"spec":802,"status":806,"postCount":88},{"name":164,"creationTimestamp":799,"labels":800,"annotations":801},"2026-09-13T09:13:25.731462Z",{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":803,"slug":164,"cover":9,"description":804,"priority":805,"hideFromList":308,"preventParentPostCascadeQuery":308},"Spring 面试题","Spring 面试题：IoC 容器、AOP 原理、声明式事务、Bean 生命周期与高频源码。",17,{"permalink":807,"postCount":88,"visiblePostCount":88},"\u002Fcategories\u002Fspring",[809,812,815],{"metadata":810,"spec":811},{"name":112},{"displayName":114,"slug":115},{"metadata":813,"spec":814},{"name":119},{"displayName":121,"slug":122},{"metadata":816,"spec":817},{"name":161},{"displayName":163,"slug":164},{"metadata":819,"spec":822,"status":829,"categories":833,"tags":840},{"name":820,"creationTimestamp":821},"post-spring-transaction-4d4be0d6","2026-09-13T10:01:02.510982Z",{"title":823,"slug":824,"cover":9,"excerpt":825,"publishTime":826,"categories":827,"tags":828,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"Spring 事务的传播行为和隔离级别？","spring-transaction",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:02.556020Z",[164],[112,119,161],{"permalink":830,"excerpt":831,"lastModifyTime":832,"phase":314},"\u002Farchives\u002Fspring-transaction","一、七种传播行为 传播行为 说明 REQUIRED（默认） 有事务就加入，没有就新建 REQUIRES_NEW 总是新建事务，挂起当前事务 SUPPORTS 有事务就加入，没有就非事务执行 NOT_SUPPORTED 非事务执行，挂起当前事务 MANDATORY 必须有事务，否则抛异常 NEVER ","2026-09-16T09:14:37.402303Z",[834],{"metadata":835,"spec":838,"status":839,"postCount":88},{"name":164,"creationTimestamp":799,"labels":836,"annotations":837},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":803,"slug":164,"cover":9,"description":804,"priority":805,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":807,"postCount":88,"visiblePostCount":88},[841,844,847],{"metadata":842,"spec":843},{"name":112},{"displayName":114,"slug":115},{"metadata":845,"spec":846},{"name":119},{"displayName":121,"slug":122},{"metadata":848,"spec":849},{"name":161},{"displayName":163,"slug":164},{"metadata":851,"spec":854,"status":861,"categories":865,"tags":872},{"name":852,"creationTimestamp":853},"post-spring-aop-000624ea","2026-09-13T10:01:02.330064Z",{"title":855,"slug":856,"cover":9,"excerpt":857,"publishTime":858,"categories":859,"tags":860,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"Spring AOP 的实现原理？","spring-aop",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:02.385481Z",[164],[119,161,112],{"permalink":862,"excerpt":863,"lastModifyTime":864,"phase":314},"\u002Farchives\u002Fspring-aop","一、AOP 概念 面向切面编程，把横切逻辑（日志、事务、权限）从业务代码中抽离，通过动态织入实现。 二、动态代理 JDK 动态代理：目标类实现接口时使用，基于反射生成代理类。 CGLIB 代理：目标类无接口时使用，基于 ASM 生成目标类的子类。 Spring 自动选择：有接口用 JDK，无接口用 ","2026-09-16T09:14:36.969681Z",[866],{"metadata":867,"spec":870,"status":871,"postCount":88},{"name":164,"creationTimestamp":799,"labels":868,"annotations":869},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":803,"slug":164,"cover":9,"description":804,"priority":805,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":807,"postCount":88,"visiblePostCount":88},[873,876,879],{"metadata":874,"spec":875},{"name":119},{"displayName":121,"slug":122},{"metadata":877,"spec":878},{"name":161},{"displayName":163,"slug":164},{"metadata":880,"spec":881},{"name":112},{"displayName":114,"slug":115},{"metadata":883,"spec":886,"status":893,"categories":897,"tags":904},{"name":884,"creationTimestamp":885},"post-spring-bean-scope-0026d011","2026-09-13T10:01:02.137013Z",{"title":887,"slug":888,"cover":9,"excerpt":889,"publishTime":890,"categories":891,"tags":892,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"Spring Bean 的作用域有哪些？","spring-bean-scope",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:02.186869Z",[164],[119,161,112],{"permalink":894,"excerpt":895,"lastModifyTime":896,"phase":314},"\u002Farchives\u002Fspring-bean-scope","一、singleton（默认） 容器中只有一个实例，全局共享。适合无状态 Bean。 二、prototype 每次获取都创建新实例。适合有状态 Bean。 三、request（Web） 每次 HTTP 请求一个实例。 四、session（Web） 每个 HTTP Session 一个实例。 五、ap","2026-09-16T09:14:36.382287Z",[898],{"metadata":899,"spec":902,"status":903,"postCount":88},{"name":164,"creationTimestamp":799,"labels":900,"annotations":901},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":803,"slug":164,"cover":9,"description":804,"priority":805,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":807,"postCount":88,"visiblePostCount":88},[905,908,911],{"metadata":906,"spec":907},{"name":119},{"displayName":121,"slug":122},{"metadata":909,"spec":910},{"name":161},{"displayName":163,"slug":164},{"metadata":912,"spec":913},{"name":112},{"displayName":114,"slug":115},{"metadata":915,"spec":918,"status":925,"categories":929,"tags":936},{"name":916,"creationTimestamp":917},"post-spring-ioc-di-413f32bf","2026-09-13T10:01:01.935988Z",{"title":919,"slug":920,"cover":9,"excerpt":921,"publishTime":922,"categories":923,"tags":924,"priority":42,"pinned":308,"deleted":308,"visible":309,"allowComment":304},"Spring 的 IOC 和 DI 是什么？","spring-ioc-di",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:01.985311Z",[164],[161,119,112],{"permalink":926,"excerpt":927,"lastModifyTime":928,"phase":314},"\u002Farchives\u002Fspring-ioc-di","一、IOC（控制反转） 对象的创建和依赖管理由容器负责，而不是在代码中 new。控制权从业务代码转移到 Spring 容器。 二、DI（依赖注入） IOC 的实现方式。容器把对象依赖的其他对象注入进去。 三种注入方式： - 构造器注入：通过构造方法，推荐（依赖不可变、无循环依赖风险）。 - sett","2026-09-16T09:13:51.823789Z",[930],{"metadata":931,"spec":934,"status":935,"postCount":88},{"name":164,"creationTimestamp":799,"labels":932,"annotations":933},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":321},{"displayName":803,"slug":164,"cover":9,"description":804,"priority":805,"hideFromList":308,"preventParentPostCascadeQuery":308},{"permalink":807,"postCount":88,"visiblePostCount":88},[937,940,943],{"metadata":938,"spec":939},{"name":161},{"displayName":163,"slug":164},{"metadata":941,"spec":942},{"name":119},{"displayName":121,"slug":122},{"metadata":944,"spec":945},{"name":112},{"displayName":114,"slug":115}]