<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>分层 on PlumePHP</title><link>https://plumephp.com/tags/%E5%88%86%E5%B1%82/</link><description>Recent content in 分层 on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Wed, 13 Aug 2025 10:00:00 +0800</lastBuildDate><atom:link href="https://plumephp.com/tags/%E5%88%86%E5%B1%82/index.xml" rel="self" type="application/rss+xml"/><item><title>Go 轻量分层入门：Handler、Service、Store 怎么刚刚好</title><link>https://plumephp.com/go-clean-architecture-lightweight-2024/</link><pubDate>Wed, 13 Aug 2025 10:00:00 +0800</pubDate><guid>https://plumephp.com/go-clean-architecture-lightweight-2024/</guid><description>&lt;h2 id="分层不是为了画图好看"&gt;分层不是为了画图好看&lt;/h2&gt;
&lt;p&gt;Go 项目写到一定规模后，总会遇到一个问题：HTTP handler 里东西越来越多。它既解析 JSON，又校验参数，又查数据库，又拼响应，还打日志。短期写得快，长期很难改。于是很多人开始学习 Clean Architecture、DDD、六边形架构。这些思想有价值，但入门项目照搬全套目录，很容易过度设计。&lt;/p&gt;</description></item></channel></rss>