{"id":5771,"date":"2022-07-31T17:45:52","date_gmt":"2022-07-31T09:45:52","guid":{"rendered":"https:\/\/1989lifejourney.com\/?p=5771"},"modified":"2022-07-31T17:47:48","modified_gmt":"2022-07-31T09:47:48","slug":"design-pattern%e5%ad%b8%e7%bf%92-4-simple-factory%e7%b0%a1%e5%96%ae%e5%b7%a5%e5%bb%a0%e6%a8%a1%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/1989lifejourney.com\/?p=5771","title":{"rendered":"Design pattern\u5b78\u7fd2 &#8211; 4 (Simple Factory\u7c21\u55ae\u5de5\u5ee0\u6a21\u5f0f)"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u76ee\u7684:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9a\u7fa9\u4e00\u500b\u7c21\u55ae\u5de5\u5ee0\uff0c\u50b3\u5165\u4e0d\u540c\u7684\u53c3\u6578\u53d6\u5f97\u4e0d\u540c\u7684\u985e\u5225\u7269\u4ef6\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5099\u8a3b:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Simple Factory\u5176\u5be6\u9055\u53cd\u4e86SOLID\u4e2d\u7684open\/close principle\uff0c\u56e0\u70ba\u6bcf\u6b21\u60f3\u8981\u64f4\u5145\u53ef\u7522\u751f\u7684object\u7a2e\u985e\uff0c\u90fd\u8981\u3127\u518d\u4fee\u6539Simple Factory\u4e2d\u8ca0\u8cac\u7522\u751fobject\u7684switch case\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Swift sample code:<\/h3>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler\"><div class=\"wp-block-embed__wrapper\">\n<style>.gist table { margin-bottom: 0; }<\/style><div style=\"tab-size: 8\" id=\"gist117613756\" class=\"gist\">\n    <div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n      <div class=\"gist-data\">\n        \n<div class=\"js-gist-file-update-container js-task-list-container\">\n      <div id=\"file-gistfile1-txt\" class=\"file my-2\">\n    \n    <div itemprop=\"text\"\n      class=\"Box-body p-0 blob-wrapper data type-text  \"\n      style=\"overflow: auto\" tabindex=\"0\" role=\"region\"\n      aria-label=\"gistfile1.txt content, created by tgnivekucn on 09:41AM on July 31, 2022.\"\n    >\n\n        \n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n\n  <template class=\"js-file-alert-template\">\n  <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" data-component=\"Octicon\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n    <span>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a>\n    <\/span>\n\n\n  <div data-view-component=\"true\" class=\"flash-action\">        <a href=\"{{ revealButtonHref }}\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters\n<\/a>\n<\/div>\n<\/div><\/template>\n<template class=\"js-line-alert-template\">\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\">\n    <svg aria-hidden=\"true\" data-component=\"Octicon\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n<\/span><\/template>\n\n  <table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"gistfile1.txt\">\n        <tr>\n          <td id=\"file-gistfile1-txt-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-gistfile1-txt-LC1\" class=\"blob-code blob-code-inner js-file-line\">\/\/ Product and Concrete Product<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-gistfile1-txt-LC2\" class=\"blob-code blob-code-inner js-file-line\">protocol Adventurer {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-gistfile1-txt-LC3\" class=\"blob-code blob-code-inner js-file-line\">    func getType() -&gt; String<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n          <td id=\"file-gistfile1-txt-LC4\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n          <td id=\"file-gistfile1-txt-LC5\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n          <td id=\"file-gistfile1-txt-LC6\" class=\"blob-code blob-code-inner js-file-line\">class Archer: Adventurer {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n          <td id=\"file-gistfile1-txt-LC7\" class=\"blob-code blob-code-inner js-file-line\">    func getType() -&gt; String {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n          <td id=\"file-gistfile1-txt-LC8\" class=\"blob-code blob-code-inner js-file-line\">        print(&quot;I&#39;m an archer&quot;)<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n          <td id=\"file-gistfile1-txt-LC9\" class=\"blob-code blob-code-inner js-file-line\">        return String(describing: Archer.self)<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n          <td id=\"file-gistfile1-txt-LC10\" class=\"blob-code blob-code-inner js-file-line\">    }<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n          <td id=\"file-gistfile1-txt-LC11\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n          <td id=\"file-gistfile1-txt-LC12\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n          <td id=\"file-gistfile1-txt-LC13\" class=\"blob-code blob-code-inner js-file-line\">class Warrior: Adventurer {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n          <td id=\"file-gistfile1-txt-LC14\" class=\"blob-code blob-code-inner js-file-line\">    func getType() -&gt; String {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n          <td id=\"file-gistfile1-txt-LC15\" class=\"blob-code blob-code-inner js-file-line\">        print(&quot;I&#39;m a warrior&quot;)<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n          <td id=\"file-gistfile1-txt-LC16\" class=\"blob-code blob-code-inner js-file-line\">        return String(describing: Warrior.self)<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L17\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"17\"><\/td>\n          <td id=\"file-gistfile1-txt-LC17\" class=\"blob-code blob-code-inner js-file-line\">    }<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L18\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n          <td id=\"file-gistfile1-txt-LC18\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L19\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n          <td id=\"file-gistfile1-txt-LC19\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L20\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"20\"><\/td>\n          <td id=\"file-gistfile1-txt-LC20\" class=\"blob-code blob-code-inner js-file-line\">\/\/ Simple Factory<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L21\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"21\"><\/td>\n          <td id=\"file-gistfile1-txt-LC21\" class=\"blob-code blob-code-inner js-file-line\">class TrainingCamp {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L22\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"22\"><\/td>\n          <td id=\"file-gistfile1-txt-LC22\" class=\"blob-code blob-code-inner js-file-line\">    static func trainAdventurer(type: String) -&gt; Adventurer? {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L23\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"23\"><\/td>\n          <td id=\"file-gistfile1-txt-LC23\" class=\"blob-code blob-code-inner js-file-line\">        switch type {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L24\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"24\"><\/td>\n          <td id=\"file-gistfile1-txt-LC24\" class=\"blob-code blob-code-inner js-file-line\">        case &quot;archer&quot;:<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L25\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"25\"><\/td>\n          <td id=\"file-gistfile1-txt-LC25\" class=\"blob-code blob-code-inner js-file-line\">            return Archer()<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L26\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"26\"><\/td>\n          <td id=\"file-gistfile1-txt-LC26\" class=\"blob-code blob-code-inner js-file-line\">        case &quot;warrior&quot;:<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L27\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"27\"><\/td>\n          <td id=\"file-gistfile1-txt-LC27\" class=\"blob-code blob-code-inner js-file-line\">            return Warrior()<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L28\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"28\"><\/td>\n          <td id=\"file-gistfile1-txt-LC28\" class=\"blob-code blob-code-inner js-file-line\">        default:<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L29\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"29\"><\/td>\n          <td id=\"file-gistfile1-txt-LC29\" class=\"blob-code blob-code-inner js-file-line\">            return nil<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L30\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"30\"><\/td>\n          <td id=\"file-gistfile1-txt-LC30\" class=\"blob-code blob-code-inner js-file-line\">        }<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L31\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"31\"><\/td>\n          <td id=\"file-gistfile1-txt-LC31\" class=\"blob-code blob-code-inner js-file-line\">    }<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L32\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"32\"><\/td>\n          <td id=\"file-gistfile1-txt-LC32\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L33\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"33\"><\/td>\n          <td id=\"file-gistfile1-txt-LC33\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L34\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"34\"><\/td>\n          <td id=\"file-gistfile1-txt-LC34\" class=\"blob-code blob-code-inner js-file-line\">let archer = TrainingCamp.trainAdventurer(type: &quot;archer&quot;)<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L35\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"35\"><\/td>\n          <td id=\"file-gistfile1-txt-LC35\" class=\"blob-code blob-code-inner js-file-line\">let warrior = TrainingCamp.trainAdventurer(type: &quot;warrior&quot;)<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L36\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"36\"><\/td>\n          <td id=\"file-gistfile1-txt-LC36\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L37\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"37\"><\/td>\n          <td id=\"file-gistfile1-txt-LC37\" class=\"blob-code blob-code-inner js-file-line\">assert(archer is Archer, &quot;Didn&#39;t get the archer object!!&quot;)<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-gistfile1-txt-L38\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"38\"><\/td>\n          <td id=\"file-gistfile1-txt-LC38\" class=\"blob-code blob-code-inner js-file-line\">assert(warrior is Warrior, &quot;Didn&#39;t get the warrior object!!&quot;)<\/td>\n        <\/tr>\n  <\/table>\n<\/div>\n\n\n    <\/div>\n\n  <\/div>\n\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/tgnivekucn\/15a421f7b757c6d43fbba1fa930197e6\/raw\/bd2e854bbf562cddfcb55fa476801e3c9c5e705a\/gistfile1.txt\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/tgnivekucn\/15a421f7b757c6d43fbba1fa930197e6#file-gistfile1-txt\" class=\"Link--inTextBlock\">\n          gistfile1.txt\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u7684: \u5b9a\u7fa9\u4e00\u500b\u7c21\u55ae\u5de5\u5ee0\uff0c\u50b3\u5165\u4e0d\u540c\u7684\u53c3\u6578\u53d6\u5f97\u4e0d\u540c\u7684\u985e\u5225\u7269\u4ef6\u3002 \u5099\u8a3b: Simple Factory\u5176\u5be6\u9055\u53cd\u4e86S [&hellip;]<\/p>\n","protected":false},"author":139426785,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_postgate_lock_override":"inherit","_postgate_lock_mode":"inherit","_postgate_preview_mode":"inherit","_postgate_preview_limit":0,"_postgate_product_ids":[],"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","jetpack_seo_llms_txt_always_include":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"{title}\n\n{excerpt}\n\n{url}","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[36769,11176,55138170,1],"tags":[],"post_folder":[],"class_list":["post-5771","post","type-post","status-publish","format-standard","hentry","category-design-pattern","category-software-engineering","category-technology-sharing","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paR5vw-1v5","jetpack-related-posts":[{"id":5776,"url":"https:\/\/1989lifejourney.com\/?p=5776","url_meta":{"origin":5771,"position":0},"title":"Design pattern\u5b78\u7fd2 &#8211; 5 (Factory\u5de5\u5ee0\u6a21\u5f0f)","author":"Kevin","date":"31 7 \u6708, 2022","format":false,"excerpt":"\u76ee\u7684: \u63d0\u4f9b\u4e00\u500b\u5de5\u5ee0\u4ecb\u9762\uff0c\u5c07\u7522\u751f\u5be6\u9ad4\u7684\u7a0b\u5f0f\u78bc\u4ea4\u7531\u5b50\u985e\u5225\u5404\u81ea\u5be6\u73fe\u3002 \u5099\u8a3b: \u7c21\u55ae\u5de5\u5ee0\u6a21\u5f0f\u548c\u5de5\u5ee0\u6a21\u5f0f\u6bd4\u8f03\u2026","rel":"","context":"\u5728\u300cDesign Pattern\u300d\u4e2d","block_context":{"text":"Design Pattern","link":"https:\/\/1989lifejourney.com\/?cat=36769"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6298,"url":"https:\/\/1989lifejourney.com\/?p=6298","url_meta":{"origin":5771,"position":1},"title":"\u5b78\u5230\u7684design pattern\u6574\u7406","author":"Kevin","date":"16 12 \u6708, 2022","format":false,"excerpt":"Creational patterns: Abstract factory Dependency I\u2026","rel":"","context":"\u5728\u300cDesign Pattern\u300d\u4e2d","block_context":{"text":"Design Pattern","link":"https:\/\/1989lifejourney.com\/?cat=36769"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5727,"url":"https:\/\/1989lifejourney.com\/?p=5727","url_meta":{"origin":5771,"position":2},"title":"Design Pattern\u5b78\u7fd2 &#8211; 1","author":"Kevin","date":"10 7 \u6708, 2022","format":false,"excerpt":"\u4ee5\u4e0b\u8cc7\u6599\u4f86\u6e90\u5927\u90e8\u5206\u90fd\u662f\u5f9e\u4e0b\u9762\u9019\u500b\u7db2\u7ad9\u800c\u4f86\uff0c\u9019\u88e1\u50c5\u4f5c\u500b\u4eba\u7b46\u8a18\u6574\u7406:\u53c3\u8003\u7db2\u7ad9: https:\/\/skyy\u2026","rel":"","context":"\u5728\u300cDesign Pattern\u300d\u4e2d","block_context":{"text":"Design Pattern","link":"https:\/\/1989lifejourney.com\/?cat=36769"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5750,"url":"https:\/\/1989lifejourney.com\/?p=5750","url_meta":{"origin":5771,"position":3},"title":"Design pattern\u5b78\u7fd2 &#8211; 3 (Singleton\u55ae\u4f8b\u6a21\u5f0f)","author":"Kevin","date":"31 7 \u6708, 2022","format":false,"excerpt":"\u76ee\u7684: \u4fdd\u8b49\u4e00\u500b\u985e\u5225\u53ea\u6703\u7522\u751f\u4e00\u500b\u7269\u4ef6\uff0c\u800c\u4e14\u8981\u63d0\u4f9b\u5b58\u53d6\u8a72\u7269\u4ef6\u7684\u7d71\u4e00\u65b9\u6cd5 \u9808\u8003\u616e\u7684\u60c5\u5883: lazy in\u2026","rel":"","context":"\u5728\u300cDesign Pattern\u300d\u4e2d","block_context":{"text":"Design Pattern","link":"https:\/\/1989lifejourney.com\/?cat=36769"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5808,"url":"https:\/\/1989lifejourney.com\/?p=5808","url_meta":{"origin":5771,"position":4},"title":"UML\u4e4b\u985e\u5225\u5716\u8b80\u66f8\u7b46\u8a18 &#8211; 1","author":"Kevin","date":"10 8 \u6708, 2022","format":false,"excerpt":"\u53c3\u8003\u7db2\u7ad9\uff1a https:\/\/misomiso43.medium.com\/%E7%B0%A1%E5%9\u2026","rel":"","context":"\u5728\u300cSoftware engineering\u300d\u4e2d","block_context":{"text":"Software engineering","link":"https:\/\/1989lifejourney.com\/?cat=11176"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2022\/08\/img_3556-1.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2022\/08\/img_3556-1.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2022\/08\/img_3556-1.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2022\/08\/img_3556-1.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2022\/08\/img_3556-1.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2022\/08\/img_3556-1.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":4024,"url":"https:\/\/1989lifejourney.com\/?p=4024","url_meta":{"origin":5771,"position":5},"title":"Using Responders and the Responder Chain to Handle Events","author":"Kevin","date":"8 1 \u6708, 2022","format":false,"excerpt":"App\u63a5\u6536\u548c\u8655\u7406\u4e8b\u4ef6\u65b9\u5f0f: App\u63a5\u6536\u548c\u8655\u7406\u4e8b\u4ef6\u662f\u7528responder objects(p.s. i\u2026","rel":"","context":"\u5728\u300cIOS Development\u300d\u4e2d","block_context":{"text":"IOS Development","link":"https:\/\/1989lifejourney.com\/?cat=37324612"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/posts\/5771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/users\/139426785"}],"replies":[{"embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5771"}],"version-history":[{"count":4,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/posts\/5771\/revisions"}],"predecessor-version":[{"id":5775,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/posts\/5771\/revisions\/5775"}],"wp:attachment":[{"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5771"},{"taxonomy":"post_folder","embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Fpost_folder&post=5771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}