{"id":82208,"date":"2026-07-25T07:18:25","date_gmt":"2026-07-24T23:18:25","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/82208.html"},"modified":"2026-07-25T07:18:25","modified_gmt":"2026-07-24T23:18:25","slug":"java-flyweight-pattern","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/82208.html","title":{"rendered":"java: Flyweight Pattern"},"content":{"rendered":"<p>\u9879\u76ee\u7ed3\u6784&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"861\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724231823-6a63f2bf4ce04.png\" width=\"561\" \/><\/p>\n<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 22:45<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : IStaffFlyweight.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.core.abstractions;<\/p>\n<p>import org.slf4j.Logger;<\/p>\n<p>\/**<br \/>\n * \u4eab\u5143\u62bd\u8c61\u63a5\u53e3&#xff1a;\u73e0\u5b9d\u884c\u4e1a\u5c97\u4f4d\u5de5\u4f5c\u4eba\u5458<br \/>\n * \u5185\u90e8\u72b6\u6001&#xff1a;\u5c97\u4f4d\u540d\u79f0\u3001\u5c97\u4f4d\u804c\u8d23\u3001\u6240\u5c5e\u90e8\u95e8&#xff08;\u53ef\u5171\u4eab&#xff0c;\u5e38\u9a7b\u5185\u5b58&#xff09;<br \/>\n * \u5916\u90e8\u72b6\u6001&#xff1a;\u4e1a\u52a1\u6d41\u6c34\u53f7\u3001\u4e1a\u52a1\u63cf\u8ff0&#xff08;\u6bcf\u6b21\u6267\u884c\u52a8\u6001\u4f20\u5165&#xff0c;\u4e0d\u5b58\u5165\u4eab\u5143\u5bf9\u8c61&#xff09;<br \/>\n *\/<br \/>\npublic interface IStaffFlyweight {<\/p>\n<p>    \/**<br \/>\n     * \u6267\u884c\u5c97\u4f4d\u4e1a\u52a1\u64cd\u4f5c<br \/>\n     * &#064;param logger \u65e5\u5fd7\u5b9e\u4f8b<br \/>\n     * &#064;param businessNo \u4e1a\u52a1\u6d41\u6c34\u53f7\u3010\u5916\u90e8\u72b6\u6001\u3011<br \/>\n     * &#064;param businessContext \u4e1a\u52a1\u4e0a\u4e0b\u6587\u63cf\u8ff0\u3010\u5916\u90e8\u72b6\u6001\u3011<br \/>\n     *\/<br \/>\n    void executeWork(Logger logger, String businessNo, String businessContext);<\/p>\n<p>    \/**<br \/>\n     * \u83b7\u53d6\u5c97\u4f4d\u540d\u79f0&#xff08;\u5185\u90e8\u5171\u4eab\u72b6\u6001&#xff09;<br \/>\n     * &#064;return \u5c97\u4f4d\u540d\u79f0<br \/>\n     *\/<br \/>\n    String getPositionName();<\/p>\n<p>    \/**<br \/>\n     * \u83b7\u53d6\u5c97\u4f4d\u804c\u8d23&#xff08;\u5185\u90e8\u5171\u4eab\u72b6\u6001&#xff09;<br \/>\n     * &#064;return \u804c\u8d23\u63cf\u8ff0<br \/>\n     *\/<br \/>\n    String getDuty();<br \/>\n}<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 23:01<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : IStaffFlyweightFactory.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.core.abstractions;<\/p>\n<p>\/**<br \/>\n * \u4eab\u5143\u5de5\u5382\u63a5\u53e3&#xff1a;\u8d1f\u8d23\u521b\u5efa\u3001\u7f13\u5b58\u5c97\u4f4d\u4eab\u5143\u5b9e\u4f8b<br \/>\n * \u4fdd\u8bc1\u540c\u4e00\u5c97\u4f4d\u5168\u5c40\u53ea\u5b58\u5728\u552f\u4e00\u5b9e\u4f8b&#xff0c;\u5b9e\u73b0\u5bf9\u8c61\u590d\u7528&#xff0c;\u964d\u4f4eGC\u538b\u529b<br \/>\n *\/<br \/>\npublic interface IStaffFlyweightFactory {<\/p>\n<p>    \/**<br \/>\n     * \u6839\u636e\u5c97\u4f4d\u540d\u79f0\u83b7\u53d6\u4eab\u5143\u5bf9\u8c61<br \/>\n     * &#064;param positionName \u5c97\u4f4d\u540d\u79f0<br \/>\n     * &#064;return \u5c97\u4f4d\u4eab\u5143\u5b9e\u4f8b<br \/>\n     *\/<br \/>\n    IStaffFlyweight getStaffFlyweight(String positionName);<\/p>\n<p>    \/**<br \/>\n     * \u83b7\u53d6\u5f53\u524d\u7f13\u5b58\u4eab\u5143\u6570\u91cf<br \/>\n     * &#064;return \u7f13\u5b58\u6570\u91cf<br \/>\n     *\/<br \/>\n    int getCacheCount();<\/p>\n<p>    \/**<br \/>\n     * \u9884\u52a0\u8f7d\u73e0\u5b9d\u5168\u90e8\u4e1a\u52a1\u5c97\u4f4d\u4eab\u5143<br \/>\n     *\/<br \/>\n    void preloadAllJewelryPositions();<br \/>\n}<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 23:02<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : PositionDutyModel.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.core.models;<\/p>\n<p>\/**<br \/>\n * \u5c97\u4f4d\u57fa\u7840\u4fe1\u606f\u6a21\u578b&#xff0c;\u7528\u4e8e\u521d\u59cb\u5316\u4eab\u5143\u5185\u90e8\u72b6\u6001<br \/>\n *\/<br \/>\npublic class PositionDutyModel {<br \/>\n    \/**\u5c97\u4f4d\u540d\u79f0*\/<br \/>\n    private String positionName;<br \/>\n    \/**\u6240\u5c5e\u90e8\u95e8*\/<br \/>\n    private String department;<br \/>\n    \/**\u5c97\u4f4d\u804c\u8d23\u63cf\u8ff0*\/<br \/>\n    private String duty;<\/p>\n<p>    public String getPositionName() {<br \/>\n        return positionName;<br \/>\n    }<\/p>\n<p>    public void setPositionName(String positionName) {<br \/>\n        this.positionName &#061; positionName;<br \/>\n    }<\/p>\n<p>    public String getDepartment() {<br \/>\n        return department;<br \/>\n    }<\/p>\n<p>    public void setDepartment(String department) {<br \/>\n        this.department &#061; department;<br \/>\n    }<\/p>\n<p>    public String getDuty() {<br \/>\n        return duty;<br \/>\n    }<\/p>\n<p>    public void setDuty(String duty) {<br \/>\n        this.duty &#061; duty;<br \/>\n    }<br \/>\n}<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 23:03<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : JewelryStaffFlyweightFactory.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.infrastructure.flyweight;<\/p>\n<p>import FlyweightPattern.core.abstractions.IStaffFlyweight;<br \/>\nimport FlyweightPattern.core.abstractions.IStaffFlyweightFactory;<br \/>\nimport FlyweightPattern.core.models.PositionDutyModel;<br \/>\nimport org.slf4j.Logger;<br \/>\nimport org.slf4j.LoggerFactory;<\/p>\n<p>import java.util.List;<br \/>\nimport java.util.Map;<br \/>\nimport java.util.concurrent.ConcurrentHashMap;<\/p>\n<p>\/**<br \/>\n * \u73e0\u5b9d\u5c97\u4f4d\u4eab\u5143\u5de5\u5382\u5b9e\u73b0<br \/>\n * ConcurrentHashMap \u4fdd\u8bc1\u591a\u7ebf\u7a0b\u5e76\u53d1\u5b89\u5168\u7f13\u5b58<br \/>\n *\/<br \/>\npublic class JewelryStaffFlyweightFactory implements IStaffFlyweightFactory {<\/p>\n<p>    private static final Logger log &#061; LoggerFactory.getLogger(JewelryStaffFlyweightFactory.class);<\/p>\n<p>    \/**\u4eab\u5143\u5bf9\u8c61\u7f13\u5b58\u6c60&#xff0c;\u7ebf\u7a0b\u5b89\u5168Map Key&#xff1a;\u5c97\u4f4d\u540d\u79f0*\/<br \/>\n    private final ConcurrentHashMap&lt;String, IStaffFlyweight&gt; flyweightPool &#061; new ConcurrentHashMap&lt;&gt;();<\/p>\n<p>    public JewelryStaffFlyweightFactory() {<br \/>\n        preloadAllJewelryPositions();<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u83b7\u53d6\u5c97\u4f4d\u4eab\u5143&#xff0c;\u5b58\u5728\u76f4\u63a5\u8fd4\u56de&#xff0c;\u4e0d\u5b58\u5728\u629b\u51fa\u5f02\u5e38<br \/>\n     *\/<br \/>\n    &#064;Override<br \/>\n    public IStaffFlyweight getStaffFlyweight(String positionName) {<br \/>\n        if (positionName &#061;&#061; null || positionName.isBlank()) {<br \/>\n            throw new IllegalArgumentException(&#034;\u5c97\u4f4d\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a&#034;);<br \/>\n        }<br \/>\n        if (flyweightPool.containsKey(positionName)) {<br \/>\n            log.debug(&#034;\u547d\u4e2d\u4eab\u5143\u7f13\u5b58&#xff0c;\u5c97\u4f4d&#xff1a;{}&#034;, positionName);<br \/>\n            return flyweightPool.get(positionName);<br \/>\n        }<br \/>\n        throw new RuntimeException(&#034;\u672a\u9884\u52a0\u8f7d\u5c97\u4f4d\u3010&#034; &#043; positionName &#043; &#034;\u3011&#xff0c;\u8bf7\u68c0\u67e5\u5c97\u4f4d\u914d\u7f6e&#034;);<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public int getCacheCount() {<br \/>\n        return flyweightPool.size();<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u9884\u52a0\u8f7d\u73e0\u5b9d\u5168\u4e1a\u52a1\u5c97\u4f4d\u4eab\u5143<br \/>\n     *\/<br \/>\n    &#064;Override<br \/>\n    public void preloadAllJewelryPositions() {<br \/>\n        log.info(&#034;\u5f00\u59cb\u9884\u52a0\u8f7d\u73e0\u5b9d\u884c\u4e1a\u6240\u6709\u4e1a\u52a1\u5c97\u4f4d\u4eab\u5143\u5bf9\u8c61&#034;);<\/p>\n<p>        List&lt;PositionDutyModel&gt; positionList &#061; List.of(<br \/>\n                createModel(&#034;\u539f\u6599\u91c7\u8d2d\u6838\u9a8c&#034;, &#034;\u4f9b\u5e94\u94fe\u90e8&#034;, &#034;\u8d35\u91d1\u5c5e\/\u5b9d\u77f3\u539f\u6599\u91c7\u8d2d\u3001\u5165\u5e93\u8d28\u68c0\u3001\u539f\u6599\u6210\u8272\u6838\u9a8c\u3001\u4f9b\u5e94\u5546\u5bf9\u8d26&#034;),<br \/>\n                createModel(&#034;\u8bbe\u8ba1\u5236\u56fe&#034;, &#034;\u7814\u53d1\u8bbe\u8ba1\u90e8&#034;, &#034;\u9996\u9970\u6b3e\u5f0f\u521b\u610f\u3001CAD\u5236\u56fe\u30013D\u5efa\u6a21\u3001\u6548\u679c\u56fe\u8f93\u51fa\u3001\u5de5\u827a\u56fe\u7eb8&#034;),<br \/>\n                createModel(&#034;\u52a0\u5de5\u751f\u4ea7&#034;, &#034;\u751f\u4ea7\u8f66\u95f4&#034;, &#034;\u5931\u8721\u94f8\u9020\u3001\u6267\u6a21\u3001\u9576\u77f3\u3001\u629b\u5149\u3001\u7535\u9540\u3001\u534a\u6210\u54c1\u52a0\u5de5&#034;),<br \/>\n                createModel(&#034;\u8d28\u68c0&#034;, &#034;\u54c1\u63a7\u90e8&#034;, &#034;\u6210\u8272\u68c0\u6d4b\u3001\u5b9d\u77f3\u5206\u7ea7\u3001\u5916\u89c2\u7455\u75b5\u68c0\u9a8c\u3001\u5c3a\u5bf8\u6821\u9a8c\u3001\u5408\u683c\u5224\u5b9a&#034;),<br \/>\n                createModel(&#034;\u5305\u88c5&#034;, &#034;\u4ed3\u50a8\u90e8&#034;, &#034;\u9996\u9970\u6e05\u6d01\u3001\u793c\u76d2\u5c01\u88c5\u3001\u6807\u7b7e\u7c98\u8d34\u3001\u4ea7\u54c1\u5165\u5e93\u5206\u62e3&#034;),<br \/>\n                createModel(&#034;\u7269\u6d41&#034;, &#034;\u4ed3\u50a8\u90e8&#034;, &#034;\u8ba2\u5355\u6253\u5305\u3001\u5feb\u9012\u5bf9\u63a5\u3001\u7269\u6d41\u8ddf\u8e2a\u3001\u8d27\u54c1\u51fa\u5165\u5e93\u7ba1\u63a7&#034;),<br \/>\n                createModel(&#034;\u8d22\u52a1&#034;, &#034;\u8d22\u52a1\u90e8&#034;, &#034;\u6210\u672c\u6838\u7b97\u3001\u5e94\u6536\u5e94\u4ed8\u3001\u5f00\u7968\u3001\u5de5\u8d44\u6838\u7b97\u3001\u8d44\u91d1\u7ba1\u7406&#034;),<br \/>\n                createModel(&#034;\u8425\u9500\u63a8\u5e7f&#034;, &#034;\u5e02\u573a\u90e8&#034;, &#034;\u7ebf\u4e0a\u7ebf\u4e0b\u63a8\u5e7f\u3001\u76f4\u64ad\u8fd0\u8425\u3001\u6d3b\u52a8\u7b56\u5212\u3001\u54c1\u724c\u5ba3\u4f20&#034;),<br \/>\n                createModel(&#034;\u4e1a\u52a1&#034;, &#034;\u9500\u552e\u90e8&#034;, &#034;\u5ba2\u6237\u63a5\u5f85\u3001\u8ba2\u5355\u6d3d\u8c08\u3001\u96f6\u552e\u6279\u53d1\u3001\u552e\u540e\u6c9f\u901a&#034;),<br \/>\n                createModel(&#034;\u4eba\u4e8b\u884c\u653f&#034;, &#034;\u884c\u653f\u4eba\u4e8b\u90e8&#034;, &#034;\u62db\u8058\u3001\u8003\u52e4\u3001\u5236\u5ea6\u7ba1\u7406\u3001\u540e\u52e4\u3001\u529e\u516c\u7269\u8d44\u7ba1\u7406&#034;),<br \/>\n                createModel(&#034;IT&#034;, &#034;\u4fe1\u606f\u90e8&#034;, &#034;\u7cfb\u7edf\u8fd0\u7ef4\u3001\u670d\u52a1\u5668\u7ef4\u62a4\u3001\u8f6f\u4ef6\u6545\u969c\u5904\u7406\u3001\u6570\u636e\u4fdd\u969c&#034;),<br \/>\n                createModel(&#034;\u57f9\u8bad&#034;, &#034;\u57f9\u8bad\u90e8&#034;, &#034;\u5458\u5de5\u6280\u80fd\u57f9\u8bad\u3001\u9500\u552e\u8bdd\u672f\u57f9\u8bad\u3001\u5de5\u827a\u77e5\u8bc6\u6559\u5b66&#034;)<br \/>\n        );<\/p>\n<p>        for (PositionDutyModel item : positionList) {<br \/>\n            StaffFlyweight flyweight &#061; new StaffFlyweight(item.getPositionName(), item.getDepartment(), item.getDuty());<br \/>\n            flyweightPool.putIfAbsent(item.getPositionName(), flyweight);<br \/>\n            log.debug(&#034;\u5c97\u4f4d\u4eab\u5143\u52a0\u8f7d\u5b8c\u6210&#xff1a;{}&#034;, item.getPositionName());<br \/>\n        }<br \/>\n        log.info(&#034;\u5c97\u4f4d\u4eab\u5143\u9884\u52a0\u8f7d\u5b8c\u6210&#xff0c;\u7f13\u5b58\u5c97\u4f4d\u603b\u6570&#xff1a;{}&#034;, flyweightPool.size());<br \/>\n    }<\/p>\n<p>    private PositionDutyModel createModel(String posName, String dept, String duty) {<br \/>\n        PositionDutyModel m &#061; new PositionDutyModel();<br \/>\n        m.setPositionName(posName);<br \/>\n        m.setDepartment(dept);<br \/>\n        m.setDuty(duty);<br \/>\n        return m;<br \/>\n    }<br \/>\n}<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 23:02<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : StaffFlyweight.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.infrastructure.flyweight;<\/p>\n<p>import FlyweightPattern.core.abstractions.IStaffFlyweight;<br \/>\nimport org.slf4j.Logger;<\/p>\n<p>import java.util.Random;<\/p>\n<p>\/**<br \/>\n * \u5177\u4f53\u4eab\u5143\u5bf9\u8c61&#xff1a;\u73e0\u5b9d\u4f01\u4e1a\u5c97\u4f4d\u4eba\u5458<br \/>\n * \u5185\u90e8\u72b6\u6001\u4e0d\u53ef\u53d8&#xff0c;\u5bf9\u8c61\u5168\u5c40\u590d\u7528&#xff1b;\u5916\u90e8\u72b6\u6001\u901a\u8fc7\u65b9\u6cd5\u53c2\u6570\u4f20\u5165<br \/>\n *\/<br \/>\npublic class StaffFlyweight implements IStaffFlyweight {<\/p>\n<p>    \/**\u5c97\u4f4d\u540d\u79f0 &#8211; \u5185\u90e8\u72b6\u6001&#xff08;\u4e0d\u53ef\u53d8&#xff09;*\/<br \/>\n    private final String positionName;<br \/>\n    \/**\u6240\u5c5e\u90e8\u95e8 &#8211; \u5185\u90e8\u72b6\u6001&#xff08;\u4e0d\u53ef\u53d8&#xff09;*\/<br \/>\n    private final String department;<br \/>\n    \/**\u5c97\u4f4d\u804c\u8d23 &#8211; \u5185\u90e8\u72b6\u6001&#xff08;\u4e0d\u53ef\u53d8&#xff09;*\/<br \/>\n    private final String duty;<\/p>\n<p>    private static final Random RANDOM &#061; new Random();<\/p>\n<p>    \/**<br \/>\n     * \u6784\u9020\u51fd\u6570\u521d\u59cb\u5316\u56fa\u5b9a\u5185\u90e8\u72b6\u6001<br \/>\n     * &#064;param positionName \u5c97\u4f4d\u540d\u79f0<br \/>\n     * &#064;param department \u90e8\u95e8\u540d\u79f0<br \/>\n     * &#064;param duty \u5c97\u4f4d\u804c\u8d23<br \/>\n     *\/<br \/>\n    public StaffFlyweight(String positionName, String department, String duty) {<br \/>\n        this.positionName &#061; positionName;<br \/>\n        this.department &#061; department;<br \/>\n        this.duty &#061; duty;<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u6267\u884c\u5c97\u4f4d\u4e1a\u52a1&#xff0c;\u5916\u90e8\u72b6\u6001\u7531\u8c03\u7528\u65b9\u4f20\u5165<br \/>\n     *\/<br \/>\n    &#064;Override<br \/>\n    public void executeWork(Logger logger, String businessNo, String businessContext) {<br \/>\n        logger.info(&#034;[\u4e1a\u52a1\u5355\u53f7:{}]\u3010{}-{}\u3011\u5f00\u59cb\u5904\u7406\u4e1a\u52a1&#xff1a;{}&#xff0c;\u5c97\u4f4d\u804c\u8d23&#xff1a;{}&#034;,<br \/>\n                businessNo, department, positionName, businessContext, duty);<\/p>\n<p>        simulateBusinessWork(logger, businessNo);<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u6a21\u62df\u5c97\u4f4d\u4e1a\u52a1\u6267\u884c\u903b\u8f91<br \/>\n     *\/<br \/>\n    private void simulateBusinessWork(Logger logger, String businessNo) {<br \/>\n        int costMs &#061; RANDOM.nextInt(50, 200);<br \/>\n        try {<br \/>\n            Thread.sleep(costMs);<br \/>\n        } catch (InterruptedException e) {<br \/>\n            Thread.currentThread().interrupt();<br \/>\n        }<\/p>\n<p>        double randVal &#061; RANDOM.nextDouble();<br \/>\n        if (randVal &lt; 0.08) {<br \/>\n            logger.warn(&#034;[\u4e1a\u52a1\u5355\u53f7:{}]\u3010{}\u3011\u4e1a\u52a1\u5b58\u5728\u8f7b\u5fae\u5f02\u5e38\u98ce\u9669&#034;, businessNo, positionName);<br \/>\n        }<br \/>\n        if (randVal &lt; 0.03) {<br \/>\n            logger.error(&#034;[\u4e1a\u52a1\u5355\u53f7:{}]\u3010{}\u3011\u4e1a\u52a1\u5904\u7406\u51fa\u73b0\u4e34\u65f6\u6545\u969c&#034;, businessNo, positionName);<br \/>\n        }<\/p>\n<p>        logger.debug(&#034;[\u4e1a\u52a1\u5355\u53f7:{}]\u3010{}\u3011\u5904\u7406\u8017\u65f6{}ms&#034;, businessNo, positionName, costMs);<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public String getPositionName() {<br \/>\n        return positionName;<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public String getDuty() {<br \/>\n        return duty;<br \/>\n    }<br \/>\n}<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 23:04<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : LoggingConfiguration.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.infrastructure.logging;<\/p>\n<p>import org.slf4j.Logger;<br \/>\nimport org.slf4j.LoggerFactory;<br \/>\nimport org.springframework.context.annotation.Configuration;<\/p>\n<p>\/**<br \/>\n * \u65e5\u5fd7\u914d\u7f6e\u5165\u53e3<br \/>\n * \u5b9e\u9645\u65e5\u5fd7\u6eda\u52a8\u7b56\u7565\u7531 resources\/logback.xml \u63a7\u5236<br \/>\n * \u65e5\u5fd7\u76ee\u5f55&#xff1a;Logs\/yyyy-MM-dd\/app-{Level}.log<br \/>\n * \u63a7\u5236\u53f0\u4e0e\u6587\u4ef6\u65e5\u5fd7\u683c\u5f0f\u4fdd\u6301\u4e00\u81f4<br \/>\n *\/<br \/>\n&#064;Configuration<br \/>\npublic class LoggingConfiguration {<br \/>\n    private static final Logger log &#061; LoggerFactory.getLogger(LoggingConfiguration.class);<\/p>\n<p>    public LoggingConfiguration() {<br \/>\n        log.info(&#034;\u65e5\u5fd7\u7cfb\u7edf\u521d\u59cb\u5316\u5b8c\u6210&#xff0c;\u65e5\u5fd7\u6839\u76ee\u5f55&#xff1a;Logs\/&#034;);<br \/>\n    }<br \/>\n}<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 23:04<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : IJewelryBusinessScheduler.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.business.abstractions;<\/p>\n<p>import java.util.concurrent.CompletableFuture;<\/p>\n<p>\/**<br \/>\n * \u73e0\u5b9d\u4e1a\u52a1\u8c03\u5ea6\u5668\u62bd\u8c61<br \/>\n * \u8d1f\u8d23\u9a71\u52a8\u6574\u6761\u73e0\u5b9d\u4e1a\u52a1\u6d41\u6c34\u7ebf\u6267\u884c<br \/>\n *\/<br \/>\npublic interface IJewelryBusinessScheduler {<\/p>\n<p>    \/**<br \/>\n     * \u6267\u884c\u5355\u6761\u8ba2\u5355\u5b8c\u6574\u4e1a\u52a1\u6d41\u7a0b<br \/>\n     * &#064;param businessNo \u4e1a\u52a1\u6d41\u6c34\u53f7<br \/>\n     * &#064;param orderTitle \u8ba2\u5355\u540d\u79f0<br \/>\n     * &#064;return \u5f02\u6b65\u4efb\u52a1<br \/>\n     *\/<br \/>\n    CompletableFuture&lt;Void&gt; runFullJewelryBusinessFlowAsync(String businessNo, String orderTitle);<\/p>\n<p>    \/**<br \/>\n     * \u5e76\u53d1\u6279\u91cf\u6267\u884c\u591a\u6761\u8ba2\u5355<br \/>\n     * &#064;param orderCount \u6a21\u62df\u8ba2\u5355\u6570\u91cf<br \/>\n     * &#064;return \u5f02\u6b65\u4efb\u52a1<br \/>\n     *\/<br \/>\n    CompletableFuture&lt;Void&gt; runMultiOrderConcurrentAsync(int orderCount);<br \/>\n}<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 23:04<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : JewelryBusinessScheduler.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.business.implementations;<\/p>\n<p>import FlyweightPattern.business.abstractions.IJewelryBusinessScheduler;<br \/>\nimport FlyweightPattern.core.abstractions.IStaffFlyweight;<br \/>\nimport FlyweightPattern.core.abstractions.IStaffFlyweightFactory;<br \/>\nimport org.slf4j.Logger;<br \/>\nimport org.slf4j.LoggerFactory;<\/p>\n<p>import java.util.List;<br \/>\nimport java.util.concurrent.CompletableFuture;<\/p>\n<p>\/**<br \/>\n * \u73e0\u5b9d\u4e1a\u52a1\u6d41\u6c34\u7ebf\u8c03\u5ea6\u5b9e\u73b0<br \/>\n * \u4e32\u8054\u5168\u6d41\u7a0b\u5c97\u4f4d&#xff0c;\u901a\u8fc7\u4eab\u5143\u5de5\u5382\u590d\u7528\u5c97\u4f4d\u5b9e\u4f8b<br \/>\n *\/<br \/>\npublic class JewelryBusinessScheduler implements IJewelryBusinessScheduler {<\/p>\n<p>    private static final Logger log &#061; LoggerFactory.getLogger(JewelryBusinessScheduler.class);<br \/>\n    private final IStaffFlyweightFactory flyweightFactory;<\/p>\n<p>    public JewelryBusinessScheduler(IStaffFlyweightFactory flyweightFactory) {<br \/>\n        this.flyweightFactory &#061; flyweightFactory;<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u5355\u8ba2\u5355\u5b8c\u6574\u4e1a\u52a1\u6d41\u6c34\u7ebf<br \/>\n     *\/<br \/>\n    &#064;Override<br \/>\n    public CompletableFuture&lt;Void&gt; runFullJewelryBusinessFlowAsync(String businessNo, String orderTitle) {<br \/>\n        return CompletableFuture.runAsync(() -&gt; {<br \/>\n            log.info(&#034;&#061;&#061;&#061;&#061;&#061;\u542f\u52a8\u73e0\u5b9d\u5b8c\u6574\u4e1a\u52a1\u6d41\u7a0b&#xff0c;\u5355\u53f7:{},\u8ba2\u5355:{}&#061;&#061;&#061;&#061;&#061;&#034;, businessNo, orderTitle);<\/p>\n<p>            List&lt;String&gt; positionSequence &#061; List.of(<br \/>\n                    &#034;\u539f\u6599\u91c7\u8d2d\u6838\u9a8c&#034;,<br \/>\n                    &#034;\u8bbe\u8ba1\u5236\u56fe&#034;,<br \/>\n                    &#034;\u52a0\u5de5\u751f\u4ea7&#034;,<br \/>\n                    &#034;\u8d28\u68c0&#034;,<br \/>\n                    &#034;\u5305\u88c5&#034;,<br \/>\n                    &#034;\u7269\u6d41&#034;,<br \/>\n                    &#034;\u8d22\u52a1&#034;,<br \/>\n                    &#034;\u8425\u9500\u63a8\u5e7f&#034;,<br \/>\n                    &#034;\u4e1a\u52a1&#034;,<br \/>\n                    &#034;\u4eba\u4e8b\u884c\u653f&#034;,<br \/>\n                    &#034;IT&#034;,<br \/>\n                    &#034;\u57f9\u8bad&#034;<br \/>\n            );<\/p>\n<p>            for (String position : positionSequence) {<br \/>\n                IStaffFlyweight staff &#061; flyweightFactory.getStaffFlyweight(position);<br \/>\n                staff.executeWork(log, businessNo, &#034;\u8ba2\u5355[&#034; &#043; orderTitle &#043; &#034;]\u6d41\u7a0b\u5904\u7406&#034;);<br \/>\n                try {<br \/>\n                    Thread.sleep(30);<br \/>\n                } catch (InterruptedException e) {<br \/>\n                    Thread.currentThread().interrupt();<br \/>\n                }<br \/>\n            }<br \/>\n            log.info(&#034;&#061;&#061;&#061;&#061;&#061;\u73e0\u5b9d\u4e1a\u52a1\u6d41\u7a0b\u5168\u90e8\u6267\u884c\u5b8c\u6210&#xff0c;\u5355\u53f7:{}&#061;&#061;&#061;&#061;&#061;&#034;, businessNo);<br \/>\n        });<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u591a\u8ba2\u5355\u5e76\u53d1\u6267\u884c&#xff0c;\u6d4b\u8bd5\u9ad8\u5e76\u53d1\u573a\u666f<br \/>\n     *\/<br \/>\n    &#064;Override<br \/>\n    public CompletableFuture&lt;Void&gt; runMultiOrderConcurrentAsync(int orderCount) {<br \/>\n        log.info(&#034;\u5f00\u59cb\u5e76\u53d1\u6a21\u62df{}\u6761\u73e0\u5b9d\u8ba2\u5355\u4e1a\u52a1\u6d41\u7a0b&#034;, orderCount);<br \/>\n        CompletableFuture&lt;?&gt;[] tasks &#061; new CompletableFuture[orderCount];<\/p>\n<p>        for (int i &#061; 1; i &lt;&#061; orderCount; i&#043;&#043;) {<br \/>\n            String orderNo &#061; &#034;JH&#034; &#043; System.currentTimeMillis() &#043; String.format(&#034;%06d&#034;, i);<br \/>\n            String orderName &#061; &#034;\u5b9a\u5236\u9996\u9970\u8ba2\u5355-&#034; &#043; i &#043; &#034;\u53f7&#034;;<br \/>\n            tasks[i &#8211; 1] &#061; runFullJewelryBusinessFlowAsync(orderNo, orderName);<br \/>\n        }<br \/>\n        return CompletableFuture.allOf(tasks)<br \/>\n                .thenRun(() -&gt; log.info(&#034;\u5168\u90e8\u5e76\u53d1\u8ba2\u5355\u5904\u7406\u5b8c\u6bd5&#034;));<br \/>\n    }<br \/>\n}<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 23:05<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : ScheduleStartupService.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.scheduler.hostedservices;<\/p>\n<p>import FlyweightPattern.scheduler.jobs.JewelryScheduleJob;<br \/>\nimport org.quartz.*;<br \/>\nimport org.slf4j.Logger;<br \/>\nimport org.slf4j.LoggerFactory;<br \/>\nimport org.springframework.context.event.ContextRefreshedEvent;<br \/>\nimport org.springframework.context.event.EventListener;<br \/>\nimport org.springframework.stereotype.Service;<\/p>\n<p>\/**<br \/>\n * \u8c03\u5ea6\u542f\u52a8\u6258\u7ba1\u670d\u52a1<br \/>\n * Spring\u5bb9\u5668\u542f\u52a8\u5b8c\u6210\u540e\u81ea\u52a8\u6ce8\u518c\u5b9a\u65f6\u4efb\u52a1<br \/>\n *\/<br \/>\n&#064;Service<br \/>\npublic class ScheduleStartupService {<\/p>\n<p>    private static final Logger log &#061; LoggerFactory.getLogger(ScheduleStartupService.class);<br \/>\n    private final Scheduler scheduler;<\/p>\n<p>    public ScheduleStartupService(Scheduler scheduler) {<br \/>\n        this.scheduler &#061; scheduler;<br \/>\n    }<\/p>\n<p>    &#064;EventListener(ContextRefreshedEvent.class)<br \/>\n    public void startScheduler() throws SchedulerException {<br \/>\n        log.info(&#034;\u5f00\u59cb\u521d\u59cb\u5316Quartz\u5b9a\u65f6\u8c03\u5ea6\u5668&#034;);<\/p>\n<p>        \/\/ &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;\u4efb\u52a11&#xff1a;\u6bcf\u969430\u79d2\u81ea\u52a8\u6267\u884c\u4e00\u6b21&#xff0c;\u6a21\u62df\u65e5\u5e38\u81ea\u52a8\u4e1a\u52a1\u6d41\u6c34\u7ebf&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n        JobKey job1Key &#061; new JobKey(&#034;JewelryNormalFlowJob&#034;, &#034;JewelryGroup&#034;);<br \/>\n        JobDetail normalJob &#061; JobBuilder.newJob(JewelryScheduleJob.class)<br \/>\n                .withIdentity(job1Key)<br \/>\n                .storeDurably()<br \/>\n                .build();<br \/>\n        normalJob.getJobDataMap().put(&#034;BusinessNo&#034;, &#034;JH-SCHED-001&#034;);<br \/>\n        normalJob.getJobDataMap().put(&#034;OrderTitle&#034;, &#034;\u5b9a\u65f6\u81ea\u52a8-\u65e5\u5e38\u9996\u9970\u751f\u4ea7\u8ba2\u5355&#034;);<\/p>\n<p>        Trigger normalTrigger &#061; TriggerBuilder.newTrigger()<br \/>\n                .withIdentity(&#034;NormalFlowTrigger&#034;, &#034;JewelryGroup&#034;)<br \/>\n                .startNow()<br \/>\n                .withSchedule(SimpleScheduleBuilder.simpleSchedule()<br \/>\n                        .withIntervalInSeconds(30)<br \/>\n                        .repeatForever())<br \/>\n                .build();<\/p>\n<p>        \/\/ &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;\u4efb\u52a12&#xff1a;Cron\u793a\u4f8b\u3010\u6bcf\u5929\u51cc\u666802:00\u6267\u884c\u6279\u91cf10\u5355\u5e76\u53d1\u3011&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n        JobKey job2Key &#061; new JobKey(&#034;JewelryBatchJob&#034;, &#034;JewelryGroup&#034;);<br \/>\n        JobDetail batchJob &#061; JobBuilder.newJob(JewelryScheduleJob.class)<br \/>\n                .withIdentity(job2Key)<br \/>\n                .storeDurably()<br \/>\n                .build();<br \/>\n        batchJob.getJobDataMap().put(&#034;ConcurrentOrderCount&#034;, 10);<\/p>\n<p>        Trigger batchTrigger &#061; TriggerBuilder.newTrigger()<br \/>\n                .withIdentity(&#034;BatchFlowTrigger&#034;, &#034;JewelryGroup&#034;)<br \/>\n                .startNow()<br \/>\n                .withSchedule(CronScheduleBuilder.cronSchedule(&#034;0 0 2 * * ?&#034;))<br \/>\n                .build();<\/p>\n<p>        scheduler.addJob(normalJob, false);<br \/>\n        scheduler.scheduleJob(normalTrigger);<br \/>\n        scheduler.addJob(batchJob, false);<br \/>\n        scheduler.scheduleJob(batchTrigger);<\/p>\n<p>        scheduler.start();<br \/>\n        log.info(&#034;Quartz\u8c03\u5ea6\u5668\u542f\u52a8\u6210\u529f&#xff0c;\u5b9a\u65f6\u4efb\u52a1\u5df2\u52a0\u8f7d&#034;);<br \/>\n    }<br \/>\n}<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/23 &#8211; 23:05<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : JewelryScheduleJob.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package FlyweightPattern.scheduler.jobs;<\/p>\n<p>import FlyweightPattern.business.abstractions.IJewelryBusinessScheduler;<br \/>\nimport org.quartz.Job;<br \/>\nimport org.quartz.JobExecutionContext;<br \/>\nimport org.quartz.JobExecutionException;<br \/>\nimport org.slf4j.Logger;<br \/>\nimport org.slf4j.LoggerFactory;<br \/>\nimport org.springframework.stereotype.Component;<\/p>\n<p>\/**<br \/>\n * \u73e0\u5b9d\u4e1a\u52a1\u5b9a\u65f6\u4efb\u52a1Job<br \/>\n * Quartz\u8c03\u5ea6\u89e6\u53d1&#xff0c;\u6267\u884c\u5b8c\u6574\u73e0\u5b9d\u4e1a\u52a1\u6d41\u6c34\u7ebf<br \/>\n *\/<br \/>\n&#064;Component<br \/>\npublic class JewelryScheduleJob implements Job {<\/p>\n<p>    private static final Logger log &#061; LoggerFactory.getLogger(JewelryScheduleJob.class);<br \/>\n    private final IJewelryBusinessScheduler businessScheduler;<\/p>\n<p>    public JewelryScheduleJob(IJewelryBusinessScheduler businessScheduler) {<br \/>\n        this.businessScheduler &#061; businessScheduler;<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * Quartz\u4efb\u52a1\u6267\u884c\u5165\u53e3<br \/>\n     *\/<br \/>\n    &#064;Override<br \/>\n    public void execute(JobExecutionContext context) throws JobExecutionException {<br \/>\n        try {<br \/>\n            log.info(&#034;\u3010\u5b9a\u65f6\u4efb\u52a1\u89e6\u53d1\u3011\u4efb\u52a1Key:{}&#034;, context.getJobDetail().getKey());<\/p>\n<p>            String businessNo &#061; context.getJobDetail().getJobDataMap().getString(&#034;BusinessNo&#034;);<br \/>\n            String orderTitle &#061; context.getJobDetail().getJobDataMap().getString(&#034;OrderTitle&#034;);<br \/>\n            int concurrentCount &#061; context.getJobDetail().getJobDataMap().getInt(&#034;ConcurrentOrderCount&#034;);<\/p>\n<p>            if (businessNo !&#061; null &amp;&amp; !businessNo.isBlank() &amp;&amp; orderTitle !&#061; null &amp;&amp; !orderTitle.isBlank()) {<br \/>\n                businessScheduler.runFullJewelryBusinessFlowAsync(businessNo, orderTitle).join();<br \/>\n            } else if (concurrentCount &gt; 0) {<br \/>\n                businessScheduler.runMultiOrderConcurrentAsync(concurrentCount).join();<br \/>\n            } else {<br \/>\n                log.warn(&#034;\u5b9a\u65f6\u4efb\u52a1\u672a\u4f20\u5165\u6709\u6548\u4e1a\u52a1\u53c2\u6570&#xff0c;\u8df3\u8fc7\u4e1a\u52a1\u6267\u884c&#034;);<br \/>\n            }<br \/>\n            log.info(&#034;\u3010\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u5b8c\u6210\u3011\u4efb\u52a1Key:{}&#034;, context.getJobDetail().getKey());<br \/>\n        } catch (Exception ex) {<br \/>\n            log.error(ex.getMessage(), &#034;\u3010\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u5f02\u5e38\u3011\u4efb\u52a1Key:{}&#034;, context.getJobDetail().getKey());<br \/>\n            throw new JobExecutionException(ex);<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8c03\u7528&#xff1a;<\/p>\n<p>\/**<br \/>\n * encoding: utf-8<br \/>\n * \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae<br \/>\n * \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce<br \/>\n * \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern<br \/>\n * Author    : geovindu,Geovin Du \u6d82\u805a\u6587.<br \/>\n * IDE       : IntelliJ IDEA 2024.3.6 Java 17<br \/>\n * # database  : Oracle21c,MySQL 9.0,SQL Server 2019,PostgreSQL 17.1 Neo4j<br \/>\n * # OS        : window10<br \/>\n * Datetime  : 2026 &#8211; 2026\/7\/5 &#8211; 11:03<br \/>\n * User      : geovindu<br \/>\n * Product   : IntelliJ IDEA<br \/>\n * Project   : javadesginpattern<br \/>\n * File      : FlyweightBll.java<br \/>\n * explain   : \u5b66\u4e60  \u7c7b<br \/>\n **\/<\/p>\n<p>package BLL;<\/p>\n<p>import FlyweightPattern.business.abstractions.IJewelryBusinessScheduler;<br \/>\nimport FlyweightPattern.business.implementations.JewelryBusinessScheduler;<br \/>\nimport FlyweightPattern.infrastructure.flyweight.JewelryStaffFlyweightFactory;<br \/>\nimport org.slf4j.Logger;<br \/>\nimport org.slf4j.LoggerFactory;<\/p>\n<p>import java.util.concurrent.CompletableFuture;<\/p>\n<p>public class FlyweightBll {<br \/>\n    private static final Logger logger &#061; LoggerFactory.getLogger(FlyweightBll.class);<\/p>\n<p>    public void demo() {<br \/>\n        JewelryStaffFlyweightFactory flyweightFactory &#061; new JewelryStaffFlyweightFactory();<br \/>\n        IJewelryBusinessScheduler businessScheduler &#061; new JewelryBusinessScheduler(flyweightFactory);<\/p>\n<p>        logger.info(&#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u73e0\u5b9d\u4f01\u4e1a\u4eab\u5143\u6a21\u5f0f\u4e1a\u52a1\u7cfb\u7edf\u542f\u52a8\u5b8c\u6210 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;);<br \/>\n        logger.info(&#034;\u4eab\u5143\u7f13\u5b58\u5c97\u4f4d\u6570\u91cf&#xff1a;{}&#034;, flyweightFactory.getCacheCount());<\/p>\n<p>        businessScheduler.runFullJewelryBusinessFlowAsync(&#034;JH20260723001&#034;, &#034;18K\u91d1\u94bb\u77f3\u6212\u6307\u8ba2\u5355&#034;).join();<\/p>\n<p>        logger.info(&#034;\\\\n&#8212;&#8212;&#8211; \u9ad8\u5e76\u53d1\u6d4b\u8bd5&#xff1a;\u5e76\u53d1\u5904\u74063\u6761\u8ba2\u5355 &#8212;&#8212;&#8211;&#034;);<br \/>\n        businessScheduler.runMultiOrderConcurrentAsync(3).join();<\/p>\n<p>        logger.info(&#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u4eab\u5143\u6a21\u5f0f\u4e1a\u52a1\u6d41\u7a0b\u5168\u90e8\u6267\u884c\u5b8c\u6bd5 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;);<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1215\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724231823-6a63f2bf6315b.png\" width=\"2493\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9879\u76ee\u7ed3\u6784&#xff1a;\/*** encoding: utf-8* \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae* \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce* \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern* Author    : geovindu,Geovin Du \u6d82\u805a\u6587.* IDE       : IntelliJ IDEA 2024.3.6 Java 17<\/p>\n","protected":false},"author":2,"featured_media":82206,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9181,9182,99,292,190],"topic":[],"class_list":["post-82208","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-9181","tag-9182","tag-java","tag-292","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>java: Flyweight Pattern - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/82208.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"java: Flyweight Pattern - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u9879\u76ee\u7ed3\u6784&#xff1a;\/*** encoding: utf-8* \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae* \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce* \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern* Author  : geovindu,Geovin Du \u6d82\u805a\u6587.* IDE    : IntelliJ IDEA 2024.3.6 Java 17\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/82208.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-24T23:18:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724231823-6a63f2bf4ce04.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82208.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/82208.html\",\"name\":\"java: Flyweight Pattern - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-24T23:18:25+00:00\",\"dateModified\":\"2026-07-24T23:18:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/82208.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/82208.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82208.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"java: Flyweight Pattern\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"java: Flyweight Pattern - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/82208.html","og_locale":"zh_CN","og_type":"article","og_title":"java: Flyweight Pattern - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u9879\u76ee\u7ed3\u6784&#xff1a;\/*** encoding: utf-8* \u7248\u6743\u6240\u6709 2026 \u00a9\u6d82\u805a\u6587\u6709\u9650\u516c\u53f8 \u00ae* \u8bb8\u53ef\u4fe1\u606f\u67e5\u770b&#xff1a;\u8a00\u8a9e\u6210\u4e86\u9080\u529f\u76e1\u8cac\u7684\u529f\u81e3&#xff0c;\u9084\u9700\u8981\u884c\u7232\u6bcf\u65e5\u4f86\u503c\u73ed\u55ce* \u63cf\u8ff0&#xff1a;\u7ed3\u6784\u578b\u6a21\u5f0f Structural Patterns \u4eab\u5143\u6a21\u5f0fFlyweight Pattern* Author  : geovindu,Geovin Du \u6d82\u805a\u6587.* IDE    : IntelliJ IDEA 2024.3.6 Java 17","og_url":"https:\/\/www.wsisp.com\/helps\/82208.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-24T23:18:25+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724231823-6a63f2bf4ce04.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/82208.html","url":"https:\/\/www.wsisp.com\/helps\/82208.html","name":"java: Flyweight Pattern - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-24T23:18:25+00:00","dateModified":"2026-07-24T23:18:25+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/82208.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/82208.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/82208.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"java: Flyweight Pattern"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/82208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=82208"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/82208\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/82206"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=82208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=82208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=82208"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=82208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}