{"id":1897,"date":"2019-05-19T07:59:17","date_gmt":"2019-05-19T07:59:17","guid":{"rendered":"http:\/\/demensdeum.com\/blog\/?p=1897"},"modified":"2024-12-16T22:32:38","modified_gmt":"2024-12-16T19:32:38","slug":"strategy-pattern","status":"publish","type":"post","link":"https:\/\/demensdeum.com\/blog\/ru\/2019\/05\/19\/strategy-pattern\/","title":{"rendered":"\u041f\u0430\u0442\u0442\u0435\u0440\u043d \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f"},"content":{"rendered":"<p>\u041f\u0430\u0442\u0442\u0435\u0440\u043d &#8220;\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f&#8221; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0431\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<br \/>\n\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<figure id=\"attachment_1899\" aria-describedby=\"caption-attachment-1899\" style=\"width: 366px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/commons.wikimedia.org\/wiki\/File:Enchoen27n3200.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1899\" src=\"https:\/\/demensdeum.com\/blog\/wp-content\/uploads\/2019\/04\/suntzu.jpg\" alt=\"\" width=\"366\" height=\"550\" \/><\/a><figcaption id=\"caption-attachment-1899\" class=\"wp-caption-text\"><a href=\"https:\/\/commons.wikimedia.org\/wiki\/File:Enchoen27n3200.jpg\" target=\"_blank\" rel=\"noopener noreferrer\">\u0421\u0443\u043d\u044c \u0426\u0437\u044b<\/a><\/figcaption><\/figure>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0435\u0435\u0440 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u0435\u043a\u0430\u043c\u0438. \u041f\u043e\u0434 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u0435\u043a\u0430\u043c\u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435 \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u043a\u043e\u0434\u0435\u043a\u043e\u0432), \u043f\u043b\u0435\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0440\u0435\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445. \u0422\u0430\u043a\u0438\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043f\u043b\u0435\u0435\u0440 VLC, \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0432\u0438\u0434\u0435\u043e \u0438 \u0430\u0443\u0434\u0438\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0438\u0432\u043d\u0430\u044f \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043b\u0435\u0435\u0440\u0430:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">var<\/span> player: MusicPlayer?\r\n\r\nfunc <span style=\"color: #0066bb; font-weight: bold;\">play<\/span>(filePath: String) {\r\n    let extension = filePath.pathExtension\r\n\r\n    <span style=\"color: #008800; font-weight: bold;\">if<\/span> extension == <span style=\"background-color: #fff0f0;\">\"mp3\"<\/span> {\r\n        playMp3(filePath)\r\n    }\r\n    <span style=\"color: #008800; font-weight: bold;\">else<\/span> <span style=\"color: #008800; font-weight: bold;\">if<\/span> extension == <span style=\"background-color: #fff0f0;\">\"ogg\"<\/span> {\r\n        playOgg(filePath)\r\n    }\r\n}\r\n\r\nfunc <span style=\"color: #0066bb; font-weight: bold;\">playMp3<\/span>(_ filePath: String) {\r\n    player = MpegPlayer()\r\n    player?.playMp3(filePath)\r\n}\r\n\r\nfunc <span style=\"color: #0066bb; font-weight: bold;\">playOgg<\/span>(_ filePath: String) {\r\n    player = VorbisPlayer()\r\n    player?.playMusic(filePath)\r\n}\r\n<\/pre>\n<\/div>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041f\u043b\u044e\u0441 \u043f\u043b\u0435\u0435\u0440 \u043e\u0431\u044f\u0437\u0430\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 \u0430\u0443\u0434\u0438\u043e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438. \u041d\u0430\u043b\u0438\u0446\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043c\u0443\u0437\u044b\u043a\u0438, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u0449\u0438\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b MusicPlayerCodecAlgorithm, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0432 \u0434\u0432\u0443\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 MpegMusicPlayerCodecAlgorithm \u0438 VorbisMusicPlayerCodecAlgorithm, \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u044f mp3 \u0438 ogg \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e-\u043d\u043e. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 MusicPlayer, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441 \u043d\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c, \u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043a\u043e\u0434\u0435\u043a\u0430:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%;\">import Foundation\r\n\r\n<span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">MusicPlayer<\/span> {\r\n    <span style=\"color: #008800; font-weight: bold;\">var<\/span> playerCodecAlgorithm: MusicPlayerCodecAlgorithm?\r\n    \r\n\tfunc <span style=\"color: #0066bb; font-weight: bold;\">play<\/span>(_ filePath: String) {\r\n            playerCodecAlgorithm?.play(filePath)\r\n\t}\r\n}\r\n\r\nprotocol MusicPlayerCodecAlgorithm {\r\n    func <span style=\"color: #0066bb; font-weight: bold;\">play<\/span>(_ filePath: String)\r\n}\r\n\r\n<span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">MpegMusicPlayerCodecAlgorithm<\/span>: MusicPlayerCodecAlgorithm {\r\n\tfunc <span style=\"color: #0066bb; font-weight: bold;\">play<\/span>(_ filePath: String) {\r\n\t\tdebugPrint(<span style=\"background-color: #fff0f0;\">\"mpeg codec - play\"<\/span>)\r\n\t}\r\n}\r\n\r\n<span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">VorbisMusicPlayerCodecAlgorithm<\/span>: MusicPlayerCodecAlgorithm {\r\n\tfunc <span style=\"color: #0066bb; font-weight: bold;\">play<\/span>(_ filePath: String) {\r\n\t\tdebugPrint(<span style=\"background-color: #fff0f0;\">\"vorbis codec - play\"<\/span>)\t\r\n\t}\r\n}\r\n\r\nfunc <span style=\"color: #0066bb; font-weight: bold;\">play<\/span>(fileAtPath path: String) {\r\n\tguard let url = URL(string: path) <span style=\"color: #008800; font-weight: bold;\">else<\/span> { <span style=\"color: #008800; font-weight: bold;\">return<\/span> }\r\n\tlet fileExtension = url.pathExtension\r\n\t\t\r\n\tlet musicPlayer = MusicPlayer()\r\n\t<span style=\"color: #008800; font-weight: bold;\">var<\/span> playerCodecAlgorithm: MusicPlayerCodecAlgorithm? \r\n\t\t\r\n\t<span style=\"color: #008800; font-weight: bold;\">if<\/span> fileExtension == <span style=\"background-color: #fff0f0;\">\"mp3\"<\/span> {\r\n                playerCodecAlgorithm = MpegMusicPlayerCodecAlgorithm()\r\n\t}\r\n\t<span style=\"color: #008800; font-weight: bold;\">else<\/span> <span style=\"color: #008800; font-weight: bold;\">if<\/span> fileExtension == <span style=\"background-color: #fff0f0;\">\"ogg\"<\/span> {\r\n                playerCodecAlgorithm = VorbisMusicPlayerCodecAlgorithm()\r\n\t}\r\n\t\t\r\n\tmusicPlayer.playerCodecAlgorithm = playerCodecAlgorithm\r\n\tmusicPlayer.playerCodecAlgorithm?.play(path)\r\n}\r\n\r\nplay(fileAtPath: <span style=\"background-color: #fff0f0;\">\"Djentuggah.mp3\"<\/span>)\r\nplay(fileAtPath: <span style=\"background-color: #fff0f0;\">\"Procrastinallica.ogg\"<\/span>)\r\n<\/pre>\n<\/div>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 (\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043a\u043e\u0434\u0435\u043a\u0430 \u043e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430)<br \/>\n\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0447\u0442\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432.<\/p>\n<h3>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h3>\n<p><a href=\"https:\/\/refactoring.guru\/ru\/design-patterns\/strategy\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/refactoring.guru\/ru\/design-patterns\/strategy<\/a><\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/h3>\n<p><a href=\"https:\/\/gitlab.com\/demensdeum\/patterns\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/gitlab.com\/demensdeum\/patterns\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0430\u0442\u0442\u0435\u0440\u043d &#8220;\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f&#8221; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0431\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0435\u0435\u0440 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u0435\u043a\u0430\u043c\u0438. \u041f\u043e\u0434 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u0435\u043a\u0430\u043c\u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435 \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u043a\u043e\u0434\u0435\u043a\u043e\u0432), \u043f\u043b\u0435\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0440\u0435\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445. \u0422\u0430\u043a\u0438\u043c\u0438<a class=\"more-link\" href=\"https:\/\/demensdeum.com\/blog\/ru\/2019\/05\/19\/strategy-pattern\/\">Continue reading <span class=\"screen-reader-text\">&#8220;\u041f\u0430\u0442\u0442\u0435\u0440\u043d \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[61,52],"tags":[95,102],"class_list":["post-1897","post","type-post","status-publish","format-standard","hentry","category-techie","category-tutorials","tag-patterns","tag-strategy","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"ru","enabled_languages":["en","ru","zh","de","fr","ja","pt"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"ru":{"title":true,"content":true,"excerpt":false},"zh":{"title":false,"content":false,"excerpt":false},"de":{"title":false,"content":false,"excerpt":false},"fr":{"title":false,"content":false,"excerpt":false},"ja":{"title":false,"content":false,"excerpt":false},"pt":{"title":false,"content":false,"excerpt":false}}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/posts\/1897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/comments?post=1897"}],"version-history":[{"count":23,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/posts\/1897\/revisions"}],"predecessor-version":[{"id":1941,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/posts\/1897\/revisions\/1941"}],"wp:attachment":[{"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/media?parent=1897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/categories?post=1897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/tags?post=1897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}