<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Method on PlumePHP</title><link>https://plumephp.com/tags/method/</link><description>Recent content in Method on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Wed, 12 Feb 2020 08:45:00 +0800</lastBuildDate><atom:link href="https://plumephp.com/tags/method/index.xml" rel="self" type="application/rss+xml"/><item><title>Go 结构体和方法：用组合组织真实业务数据</title><link>https://plumephp.com/go-structs-methods-and-composition/</link><pubDate>Wed, 12 Feb 2020 08:45:00 +0800</pubDate><guid>https://plumephp.com/go-structs-methods-and-composition/</guid><description>&lt;h2 id="结构体是-go-里最重要的建模工具"&gt;结构体是 Go 里最重要的建模工具&lt;/h2&gt;
&lt;p&gt;如果说变量和函数让程序能运行，那么结构体让程序开始表达业务。用户、订单、文章、配置、任务、支付记录，这些概念都需要有名字、有字段、有规则。Go 没有传统面向对象语言那种复杂类体系，它用结构体加方法来组织数据和行为，再通过组合表达复用。&lt;/p&gt;</description></item></channel></rss>