{"id":473274,"date":"2025-09-02T16:02:49","date_gmt":"2025-09-02T16:02:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=473274"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=473274","title":{"rendered":"<span>\u041e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433: \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Overengineering\" rel=\"noopener noreferrer nofollow\">\u041e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/a> \u2014 \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a, \u0441\u043b\u043e\u0432\u043d\u043e \u0432\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u0441\u043e\u0444\u0442 \u0434\u043b\u044f NASA: \u0441 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430\u043c\u0438, \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f\u043c\u0438 \u0438 \u00ab\u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c\u044e \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435\u00bb, \u043a\u043e\u0442\u043e\u0440\u043e\u0439, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0438\u043a\u0442\u043e \u0442\u0430\u043a \u0438 \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a: \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/refactoring.guru\/design-patterns\/builder\" rel=\"noopener noreferrer nofollow\">Builder<\/a>, <a href=\"https:\/\/refactoring.guru\/design-patterns\/abstract-factory\" rel=\"noopener noreferrer nofollow\">Factory<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/refactoring.guru\/design-patterns\/adapter\" rel=\"noopener noreferrer nofollow\">Adapter<\/a> \u2014 \u0438 \u0440\u0443\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0447\u0435\u0441\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c, \u043d\u043e \u0432\u043e\u0442 \u0431\u0435\u0434\u0430: \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434 \u043d\u0435\u0433\u043e \u043d\u0435\u0442. \u0418 \u0442\u043e\u0433\u0434\u0430 \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0440\u0430\u0434\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b: \u043c\u043d\u043e\u0433\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u0431\u0438\u043b\u0434\u0435\u0440\u044b \u0434\u043b\u044f \u043e\u0448\u0438\u0431\u043e\u043a, \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0434\u043b\u044f \u0444\u0430\u0431\u0440\u0438\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0435 \u0448\u0435\u0434\u0435\u0432\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u043a\u043e\u0434 \u043d\u0435 \u043f\u0440\u043e\u0449\u0435, \u0430 \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u042d\u0442\u043e \u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u00ab\u0443\u0441\u043b\u044b\u0448\u0430\u043b \u0437\u0432\u043e\u043d, \u0434\u0430 \u043d\u0435 \u0437\u043d\u0430\u044e, \u0433\u0434\u0435 \u043e\u043d\u00bb \u2014 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u043d\u0438\u0435, \u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e, \u043f\u043e\u043a\u0430 \u043d\u0435\u0442.<\/p>\n<blockquote>\n<p>\ud83d\udca1 \u0412\u0430\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f: \u0446\u0435\u043b\u044c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u043d\u0435 \u0432\u044b\u0441\u043c\u0435\u0438\u0432\u0430\u0442\u044c \u0447\u0443\u0436\u043e\u0439 \u043a\u043e\u0434 \u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0438\u0436\u0435 \u2014 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043c\u043d\u0435 \u0438 \u043c\u043e\u0438\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445, \u043d\u043e \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u043c \u0438\u043b\u0438 \u043b\u044e\u0434\u044f\u043c.<\/p>\n<\/blockquote>\n<p>\u041c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Overengineering\" rel=\"noopener noreferrer nofollow\">\u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/a> \u0432 \u0436\u0438\u0432\u043e\u043c \u043a\u043e\u0434\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u043a\u0430\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u043c\u0435\u0436\u0434\u0443 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c\u044e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u2014 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0438 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445, \u0433\u0434\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0432\u0430\u0436\u043d\u0435\u0435 \u00ab\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432\u043e\u0441\u0442\u0438\u00bb.<\/p>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433?<\/h2>\n<p>\u041f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u00ab\u0443\u043f\u043b\u044b\u043b\u00bb \u0432 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Overengineering\" rel=\"noopener noreferrer nofollow\">\u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/a>, \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0441\u043b\u043e\u0436\u043d\u043e. \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0432\u043e\u0436\u043d\u044b\u0445 \u0437\u0432\u043e\u043d\u043e\u0447\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u044b \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430:<\/p>\n<h4>1. \u0418\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0446\u0435\u043b\u044b\u0435 \u00ab\u043f\u043e\u044f\u0441\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438\u00bb \u0432 \u0432\u0438\u0434\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u043e\u0451\u0432 \u2014 \u0431\u0438\u043b\u0434\u0435\u0440\u043e\u0432, \u0444\u0430\u0431\u0440\u0438\u043a, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0441\u043b\u043e\u0435\u043a \u2014 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f. \u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0440\u0430\u0434\u0438 \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u041e\u041a\u00bb.<\/p>\n<h4>2. \u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0440\u0430\u0434\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432<\/h4>\n<p>\u042d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 \u00ab\u0437\u0443\u0434\u0430\u00bb: \u0443\u0437\u043d\u0430\u043b \u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 \u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e. <a href=\"https:\/\/refactoring.guru\/design-patterns\/builder\" rel=\"noopener noreferrer nofollow\">Builder<\/a>, <a href=\"https:\/\/refactoring.guru\/design-patterns\/abstract-factory\" rel=\"noopener noreferrer nofollow\">Factory<\/a>, <a href=\"https:\/\/refactoring.guru\/design-patterns\/adapter\" rel=\"noopener noreferrer nofollow\">Adapter<\/a>, <a href=\"https:\/\/refactoring.guru\/design-patterns\/command\" rel=\"noopener noreferrer nofollow\">Command<\/a> \u2014 \u0432\u0441\u0435 \u0432 \u0431\u043e\u0439, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434 \u043d\u0438\u0445 \u043d\u0435\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0430 \u043f\u043e\u043b\u044c\u0437\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0439. \u042d\u0442\u043e \u043a\u0430\u043a \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0435\u0441\u0442\u044c \u0441\u0443\u043f \u043f\u0430\u043b\u043e\u0447\u043a\u0430\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u00ab\u0442\u0430\u043a \u043c\u043e\u0434\u043d\u0435\u0435\u00bb.<\/p>\n<h4>3. \u041a\u043b\u0430\u0441\u0441\u044b \u0440\u0430\u0434\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 <a href=\"https:\/\/docs.python.org\/3\/library\/functions.html#staticmethod\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <code>self<\/code> \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u043e\u0434\u0435\u0442\u044b\u0435 \u0432 \u00ab\u043a\u043b\u0430\u0441\u0441\u0438\u043a\u0438\u00bb. \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e, \u043d\u043e \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a, \u0447\u0442\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0448\u043b\u0430 \u0432\u0440\u0430\u0437\u043d\u043e\u0441 \u0438 \u0445\u043e\u0447\u0435\u0442 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435.<\/p>\n<h4>4. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u00ab\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c\u0443\u00bb \u0431\u0443\u0434\u0443\u0449\u0435\u043c\u0443<\/h4>\n<p>\u00ab\u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u044f\u0442\u044c \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0442\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439\u00bb \u2014 \u0437\u043d\u0430\u043a\u043e\u043c\u043e? \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u00ab\u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c\u00bb \u043c\u043e\u0436\u0435\u0442 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u0442\u044c. \u0410 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0438 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0437\u0430\u0432\u0442\u0440\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442\u0435 \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0449\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0443 \u0432\u0430\u0441 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438<\/h2>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0442\u0435\u043e\u0440\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u0433\u0434\u0435 \u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0438\u0437\u043b\u0438\u0448\u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c. <\/p>\n<blockquote>\n<p>\ud83d\udca1 \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435, \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u2014 \u0446\u0435\u043b\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434, \u0430 \u043d\u0435 \u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u0440\u0438\u0441\u0442\u044b\u0434\u0438\u0442\u044c.<\/p>\n<\/blockquote>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 1. \u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0432\u043c\u0435\u0441\u0442\u043e Enum<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class Report:     class Story:         USERS = \"USERS\"         COURSES = \"COURSES\"         ACCOUNTS = \"ACCOUNTS\"      class Feature:         USERS_SERVICE = \"USERS_SERVICE\"         COURSES_SERVICE = \"COURSES_SERVICE\"         ACCOUNTS_SERVICE = \"ACCOUNTS_SERVICE\"<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u0440\u043e\u0434\u0435 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e: \u0432\u0441\u0451 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e, \u0432\u043d\u0443\u0442\u0440\u0438 \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0430 \u00abStory \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, Feature \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u00bb. \u041d\u043e \u043d\u0430 \u0434\u0435\u043b\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0434\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c <code>Report.Story.USERS<\/code>. \u042d\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043b\u0438\u0448\u043d\u044e\u044e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0435\u0451 \u043d\u0435\u0442.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from enum import StrEnum  class Story(StrEnum):     USERS = \"USERS\"     COURSES = \"COURSES\"     ACCOUNTS = \"ACCOUNTS\"  class Feature(StrEnum):     USERS_SERVICE = \"USERS_SERVICE\"     COURSES_SERVICE = \"COURSES_SERVICE\"     ACCOUNTS_SERVICE = \"ACCOUNTS_SERVICE\"<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043f\u043b\u043e\u0441\u043a\u043e, \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0449\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/docs.python.org\/3\/library\/enum.html\" rel=\"noopener noreferrer nofollow\">Enum<\/a>, \u0447\u0442\u043e \u044f\u0432\u043d\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442: \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043a\u043e\u0440\u043e\u0447\u0435 (<code>Story.USERS<\/code>), \u0430 \u043a\u043e\u0434 \u0441\u0430\u043c\u043e\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0440\u0430\u0434\u0438 \u00ab\u043a\u0440\u0430\u0441\u043e\u0442\u044b\u00bb. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u2014 <a href=\"https:\/\/docs.python.org\/3\/library\/enum.html\" rel=\"noopener noreferrer nofollow\">Enum<\/a> \u0440\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u043b\u0443\u0447\u0448\u0435 \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 2. \u0424\u0430\u0431\u0440\u0438\u043a\u0430 \u0440\u0430\u0434\u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0438<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class User(BaseModel):     id: int     email: str     password: str  class ModelsFactory:     @staticmethod     def build_user(id: int, email: str, password: str) -&gt; User:         return User(id=id, email=email, password=password)  ModelsFactory.build_user(id=1, email=\"user@example.com\", password=\"qwerty\")<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u00ab\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u00bb: \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0430\u0431\u0440\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u00ab\u0441\u0442\u0440\u043e\u0438\u0442\u00bb \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f \u2014 \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0442\u0443\u0434\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u00ab\u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0440\u0430\u0434\u0438 \u043e\u0431\u0451\u0440\u0442\u043a\u0438\u00bb.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class User(BaseModel):     id: int     email: str     password: str  User(id=1, email=\"user@example.com\", password=\"qwerty\")<\/code><\/pre>\n<p>\u0412\u0441\u0451 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0441\u043b\u043e\u044f. \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u043d\u0435 \u043f\u0440\u044f\u0447\u0435\u043c \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0437\u0430 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u00ab\u0444\u0430\u0431\u0440\u0438\u043a\u043e\u0439\u00bb.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u0424\u0430\u0431\u0440\u0438\u043a\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (\u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438). \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430: \u043a\u043e\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435, \u0441\u043c\u044b\u0441\u043b\u0430 \u2014 \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 3.1. \u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f (UsersHTTPClient)<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class UsersHTTPClient:     def __init__(self, env: str):         ...  def build_client(env: str) -&gt; UsersHTTPClient:     if env == \"DEV\":         return UsersHTTPClient(env=\"dev\")     elif env == \"PROD\":         return UsersHTTPClient(env=\"prod\")     else:         raise ValueError(\"Unknown env\")<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u0441\u0451 \u0432\u0440\u043e\u0434\u0435 \u0447\u0451\u0442\u043a\u043e: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u043b\u0438\u0435\u043d\u0442. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f, \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0442\u043a\u0430\u043c\u0438 <code>if<\/code> \u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u0435 \u0431\u0443\u043a\u0432\u044b. \u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0443\u0442, \u0430 \u043b\u043e\u0433\u0438\u043a\u0438 \u2014 \u043c\u0438\u043d\u0438\u043c\u0443\u043c.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class UsersHTTPClient:     def __init__(self, env: str):         ...  def build_client(env: str) -&gt; UsersHTTPClient:     if env not in (\"DEV\", \"PROD\"):         raise ValueError(\"Unknown env\")      return UsersHTTPClient(env=env.lower())<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445 (\u0430 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0438 \u0442\u0440\u0451\u0445, \u0438 \u043f\u044f\u0442\u0438) \u0432\u0435\u0442\u043e\u043a \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0438\u0445 \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u041a\u043e\u0434 \u043a\u043e\u0440\u043e\u0447\u0435, \u043f\u0440\u043e\u0449\u0435 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 <code>elif<\/code>.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u0427\u0430\u0441\u0442\u043e \u00ab\u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0434\u0438 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f\u00bb \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0438\u0437 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u044f\u0432\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u041d\u043e \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b \u0438 \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0434\u043d\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e, \u043b\u0443\u0447\u0448\u0435 \u0435\u0451 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043a\u043e\u0434 \u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0440\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043e\u043a, \u0435\u0441\u043b\u0438 \u0437\u0430\u0432\u0442\u0440\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 3.2. \u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f (ClientError)<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class ClientError(BaseModel):     code: int     type: str     message: str  def build_client_error(type: str) -&gt; ClientError:     if type == \"not_found\":         return ClientError(code=4, type=\"not-found\", message=\"Not found!\")     elif type == \"internal\":         return ClientError(code=11, type=\"internal\", message=\"Internal!\")     else:         return ClientError(code=13, type=\"unknown\", message=\"Unknown!\")<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u00ab\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430\u00bb \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a. \u041d\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0443\u0447\u0430 <code>if<\/code> \u0440\u0430\u0434\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0438\u043c\u0435\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0433\u0438\u0431\u043a\u0430\u044f, \u043d\u043e \u043d\u0430 \u0434\u0435\u043b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443: \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u043e\u0448\u0438\u0431\u043a\u0438 \u2014 \u043f\u0438\u0448\u0438 \u043d\u043e\u0432\u044b\u0439 <code>elif<\/code>, \u043f\u043e\u0442\u043e\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0438 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class ClientError(BaseModel):     code: int     type: str     message: str  def build_not_found_client_error() -&gt; ClientError:     return ClientError(code=4, type=\"not-found\", message=\"Not found!\")  def build_internal_client_error() -&gt; ClientError:     return ClientError(code=11, type=\"internal\", message=\"Internal!\")  def build_unknown_client_error() -&gt; ClientError:     return ClientError(code=13, type=\"unknown\", message=\"Unknown!\")<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0449\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0440\u043e\u0449\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043e\u043d \u044f\u0432\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0435: \u00ab\u0445\u043e\u0447\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0448\u0438\u0431\u043a\u0443 \u0442\u0438\u043f\u0430 Not Found\u00bb.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0432\u0441\u0451 \u0432 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u043b\u0430\u0437\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u043d\u043e \u0447\u0430\u0441\u0442\u043e \u044d\u0442\u043e \u0432\u0435\u0434\u0451\u0442 \u043a \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0439. \u041a\u043e\u0433\u0434\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u043f\u0440\u043e\u0449\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0438\u043b\u0438 \u0445\u0435\u043b\u043f\u0435\u0440. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043f\u0440\u044f\u043c\u044b\u043c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c, \u0430 \u043d\u0435 \u00ab\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c \u043d\u0430 \u0431\u0443\u043c\u0430\u0433\u0435\u00bb.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 4. \u041f\u0435\u0440\u0435\u0443\u0441\u043b\u043e\u0436\u043d\u0451\u043d\u043d\u044b\u0439 Page Object<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class CourseCard:     def __init__(self, index: int, title: str, page: Page):         self.page = page         self.title = title         self.index = index      def check_visible(self):         expect(self.page.locator(\"#course-card\").nth(self.index)).to_be_visible()         expect(self.page.locator(\"#course-card\").nth(self.index)).to_have_text(self.title)   class CoursesPage:     def __init__(self, page: Page):         self.page = page      def check_course_card_visible(self, title: str, index: int):         card = CourseCard(page=self.page, index=index, title=title)         card.check_visible() <\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u00ab\u043f\u043e \u0432\u0441\u0435\u043c \u043a\u0430\u043d\u043e\u043d\u0430\u043c\u00bb: \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u043a\u0443\u0440\u0441\u0430, \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u044d\u0442\u0430 \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u043d\u0435 \u043d\u0435\u0441\u0451\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u044b. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0430\u0434\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430, \u0430 \u0441\u0430\u043c\u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0436\u0435\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0434\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u00ab\u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u00bb.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class CourseCard:     def __init__(self, page: Page):         self.page = page         self.card = page.locator(\"#course-card\")      def check_visible(self, index: int, title: str):         expect(self.card.nth(index)).to_be_visible()         expect(self.card.nth(index)).to_have_text(title)   class CoursesPage:     def __init__(self, page: Page):         self.page = page         self.card = CourseCard(page=page)   courses_page = CoursesPage(page=Page()) courses_page.card.check_visible(index=1, title=\"Hello!\") <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0449\u0435: \u0435\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438, \u043d\u043e \u043e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043b\u0438\u0448\u043d\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 (<code>index<\/code>, <code>title<\/code>) \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u041c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0438\u0445 \u0432 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u0435 \u0438 \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0440\u0430\u0434\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> Page Object \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d, \u043d\u043e \u0441 \u043d\u0438\u043c \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0449\u0438\u0442\u044c. \u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0434\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0438\u0448\u043d\u0438\u0439 \u0441\u043b\u043e\u0439. \u0427\u0435\u043c \u043f\u0440\u043e\u0449\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0442\u0435\u0441\u0442\u043e\u0432, \u0442\u0435\u043c \u043b\u0435\u0433\u0447\u0435 \u0435\u0451 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 5. \u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0431\u0435\u0437 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from typing import Protocol  class Storage(Protocol):     def save(self, data: str) -&gt; None: ...  class FileStorage(Storage):     def save(self, data: str) -&gt; None:         with open(\"file.txt\", \"w\") as f:             f.write(data)<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u00ab\u043f\u043e \u043d\u0430\u0443\u043a\u0435\u00bb: \u0435\u0441\u0442\u044c <a href=\"https:\/\/typing.python.org\/en\/latest\/spec\/protocol.html\" rel=\"noopener noreferrer nofollow\">\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/a> <code>Storage<\/code>, \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0433\u043b\u044f\u0434\u0435\u0442\u044c\u0441\u044f, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430, \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432 \u043e\u0431\u043e\u0437\u0440\u0438\u043c\u043e\u043c \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442, \u043d\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0442\u0430\u0441\u043a\u0430\u0442\u044c \u043f\u043e \u043a\u043e\u0434\u0443.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">def save_to_file(data: str) -&gt; None:     with open(\"file.txt\", \"w\") as f:         f.write(data)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u043e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u00ab\u043f\u0441\u0435\u0432\u0434\u043e\u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c\u0430\u00bb.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434: <\/strong><a href=\"https:\/\/typing.python.org\/en\/latest\/spec\/protocol.html\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b<\/a> \u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0438 \u0441 S3). \u041d\u043e \u0435\u0441\u043b\u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u043d\u0435\u0442 \u0438 \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2014 \u044d\u0442\u043e \u043b\u0438\u0448\u043d\u044f\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b: \u0437\u0430\u0447\u0435\u043c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043d\u0438\u0447\u0435\u043c\u0443 \u043d\u0435 \u0441\u043b\u0443\u0436\u0438\u0442?<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 6. DTO \u043f\u043e\u0432\u0435\u0440\u0445 Pydantic-\u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class UserDTO(BaseModel):     id: int     email: str  class UserResponse(BaseModel):     id: int     email: str  def to_dto(user: UserResponse) -&gt; UserDTO:     return UserDTO(id=user.id, email=user.email)<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e: \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Data_transfer_object\" rel=\"noopener noreferrer nofollow\">DTO<\/a>-\u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u0432\u0435\u0442\u0430. \u041d\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u2014 \u043e\u043d\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b. \u041c\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0434\u0438 \u00ab\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b\u00bb. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430, \u0430 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class UserResponse(BaseModel):     id: int     email: str  def to_dto(user: UserResponse) -&gt; UserResponse:     return user  # \u0443\u0436\u0435 Pydantic, \u0437\u0430\u0447\u0435\u043c \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c? <\/code><\/pre>\n<p>\u041c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043e\u0442 \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0438. <a href=\"https:\/\/docs.pydantic.dev\/latest\/\" rel=\"noopener noreferrer nofollow\">Pydantic-\u043c\u043e\u0434\u0435\u043b\u044c<\/a> \u0438 \u0442\u0430\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u043e\u043b\u044c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Data_transfer_object\" rel=\"noopener noreferrer nofollow\">DTO<\/a>: \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0443\u043c\u0435\u0435\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u043c\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Data_transfer_object\" rel=\"noopener noreferrer nofollow\">DTO<\/a> \u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u043a\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u0440\u044b\u0442\u044c \u043f\u043e\u043b\u044f, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442). \u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0443\u0436\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u00abDTO \u0440\u0430\u0434\u0438 DTO\u00bb \u2014 \u044d\u0442\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433: \u043a\u043e\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435, \u0441\u043c\u044b\u0441\u043b\u0430 \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 7. \u0421\u0435\u0440\u0432\u0438\u0441\u044b \u0441 \u043e\u0434\u043d\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">import hashlib  class PasswordService:     @staticmethod     def hash_password(password: str) -&gt; str:         return hashlib.sha256(password.encode()).hexdigest()<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u00ab\u043f\u043e-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u043c\u0443\u00bb: \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u041d\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u0434\u043d\u0443 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u00ab\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439\u00bb \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0434\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u044b\u043b.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">import hashlib  def hash_password(password: str) -&gt; str:     return hashlib.sha256(password.encode()).hexdigest()<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u043a\u043e\u0434 \u0441\u0442\u0430\u043b \u043f\u0440\u043e\u0449\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435: \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u00ab\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0439 \u043e\u0431\u0451\u0440\u0442\u043a\u0438\u00bb.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0445\u043e\u0440\u043e\u0448\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u0438 \u043e\u043d \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u2014 \u043f\u0440\u043e\u0449\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438 \u043a\u043e\u0440\u043e\u0447\u0435, \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u0435\u0435, \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0449\u0435.<\/p>\n<h3>\u041e\u0431\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 <\/h3>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043e\u0434\u043d\u043e: \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432 \u043d\u0438\u0445 \u0431\u044b\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u0433\u0438\u0431\u043a\u043e \u0438 \u00ab\u043f\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u00bb. \u0425\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u00ab\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u00bb \u2014 \u0441 \u0444\u0430\u0431\u0440\u0438\u043a\u0430\u043c\u0438, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438, \u0441\u043b\u043e\u044f\u043c\u0438 \u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430\u043c\u0438. \u041d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u043d\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u0447\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e,<\/p>\n<\/li>\n<li>\n<p>\u043d\u043e\u0432\u043e\u043c\u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442,<\/p>\n<\/li>\n<li>\n<p>\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0441\u0438\u043b\u0438\u0439, \u0447\u0435\u043c \u043c\u043e\u0433\u043b\u0438 \u0431\u044b.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\ud83d\udca1 \u0418\u0440\u043e\u043d\u0438\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043b\u0443\u0447\u0448\u0435 \u2014 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u044d\u0444\u0444\u0435\u043a\u0442\u0443: \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u044f\u0436\u0435\u043b\u0435\u0435 \u0438 \u043c\u0435\u043d\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u043c. \u041e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e \u043f\u043b\u043e\u0445\u043e\u0439 \u043a\u043e\u0434, \u044d\u0442\u043e \u043f\u0440\u043e \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u0435 \u0441\u0442\u0430\u0440\u0430\u043d\u0438\u0435 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043e\u043d\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<\/blockquote>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439, \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c, \u0435\u0441\u043b\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438, \u043e\u0431\u043e\u0431\u0449\u0430\u0442\u044c \u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<h2>\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430<\/h2>\n<h4>1. KISS (Keep It Simple, Stupid)<\/h4>\n<p>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430: \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u2014 <a href=\"https:\/\/en.wikipedia.org\/wiki\/KISS_principle\" rel=\"noopener noreferrer nofollow\">KISS<\/a>. \u0418\u043d\u043e\u0433\u0434\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0443 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439, \u043d\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u0434\u0430 \u0438 \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u2014 \u0442\u0435\u043c \u043f\u0440\u043e\u0449\u0435 \u0435\u0433\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<h4>2. YAGNI (You Aren\u2019t Gonna Need It)<\/h4>\n<p>\u041d\u0435 \u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u0434 \u00ab\u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435\u00bb, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/YAGNI\" rel=\"noopener noreferrer nofollow\">YAGNI<\/a>. \u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u00ab\u0430 \u0432\u0434\u0440\u0443\u0433 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f\u00bb. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f. \u0414\u0435\u043b\u0430\u0439\u0442\u0435 \u0440\u043e\u0432\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0438 \u0441\u0435\u0439\u0447\u0430\u0441, \u0430 \u0435\u0441\u043b\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u043d\u0430 \u0431\u0430\u0437\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0433\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<h4>3. \u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u0435\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <\/h4>\n<p>\u041a\u043e\u0434 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043d\u043e \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0438 \u0441\u043e\u0442\u043d\u0438 \u0440\u0430\u0437. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432: \u0438\u0445 \u0447\u0438\u0442\u0430\u044e\u0442 \u043d\u043e\u0432\u0438\u0447\u043a\u0438, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438, \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0430\u0436\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b. \u041b\u0443\u0447\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442 \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u043b, \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442, \u0447\u0435\u043c \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043a\u0430\u043a \u043c\u0438\u043d\u0438-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c.<\/p>\n<h4>4. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0435\u0441\u044f\u0442\u043a\u0430\u0445 \u043c\u0435\u0441\u0442 \u2014 \u0434\u0430, \u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0441. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d-\u0434\u0432\u0430 \u0440\u0430\u0437\u0430, \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0449\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u00ab\u043a\u0430\u043a \u0435\u0441\u0442\u044c\u00bb. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0443\u0441\u0438\u043b\u0438\u044f, \u0430 \u043d\u0435 \u0440\u0430\u0434\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u0430 \u00ab\u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u00bb.<\/p>\n<h4>5. \u042f\u0432\u043d\u043e\u0435 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043d\u0435\u044f\u0432\u043d\u043e\u0435 (Explicit is better than implicit) <\/h4>\n<p>\u042d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438\u0437 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B7%D0%B5%D0%BD_%D0%9F%D0%B0%D0%B9%D1%82%D0%BE%D0%BD%D0%B0\" rel=\"noopener noreferrer nofollow\">\u00ab\u0414\u0437\u0435\u043d Python\u00bb<\/a> \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0438 \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u043e\u043c. \u041a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d \u0438 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u0435\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c. \u0418\u0437\u043b\u0438\u0448\u043d\u0438\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0447\u0430\u0441\u0442\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u043a\u043e\u0434 \u00ab\u0443\u043c\u043d\u0435\u0435, \u0447\u0435\u043c \u043e\u043d \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435\u00bb: \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u0432\u044f\u0437\u044f\u0445, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u0430\u0445 \u0438 \u00ab\u043c\u0430\u0433\u0438\u0438\u00bb. \u041b\u0443\u0447\u0448\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u0440\u044f\u043c\u043e\u0439 \u0432\u044b\u0437\u043e\u0432, \u0447\u0435\u043c \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u0433 \u0434\u043e\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u043e\u043d\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u00ab\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c\u00bb.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Overengineering\" rel=\"noopener noreferrer nofollow\">\u041e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/a> \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e \u043f\u043b\u043e\u0445\u043e\u0439 \u043a\u043e\u0434 \u0438 \u043d\u0435 \u043f\u0440\u043e \u00ab\u043d\u0435\u0443\u043c\u0435\u043b\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432\u00bb. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435: \u043b\u044e\u0434\u0438 \u0445\u043e\u0442\u044f\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0437\u043d\u0430\u044e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u0443\u043c\u0435\u044e\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438 \u0434\u0443\u043c\u0430\u044e\u0442 \u00ab\u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435\u00bb. \u041d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e, \u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043c\u0435\u0448\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u0448\u0438\u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u2014 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u0438 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438. \u041d\u043e \u043f\u043e\u043a\u0430 \u0442\u0430\u043a\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435\u0442, \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442: \u043a\u043e\u0434 \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u0435\u0448\u0435\u0432\u043b\u0435, \u043d\u043e\u0432\u044b\u0435 \u043b\u044e\u0434\u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0438\u0442\u0430\u044e\u0442 \u0438 \u043d\u043e\u0432\u0438\u0447\u043a\u0438, \u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438, \u0438 \u0434\u0430\u0436\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b: \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/933412\/\"> https:\/\/habr.com\/ru\/articles\/933412\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Overengineering\" rel=\"noopener noreferrer nofollow\">\u041e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/a> \u2014 \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a, \u0441\u043b\u043e\u0432\u043d\u043e \u0432\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u0441\u043e\u0444\u0442 \u0434\u043b\u044f NASA: \u0441 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430\u043c\u0438, \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f\u043c\u0438 \u0438 \u00ab\u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c\u044e \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435\u00bb, \u043a\u043e\u0442\u043e\u0440\u043e\u0439, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0438\u043a\u0442\u043e \u0442\u0430\u043a \u0438 \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a: \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/refactoring.guru\/design-patterns\/builder\" rel=\"noopener noreferrer nofollow\">Builder<\/a>, <a href=\"https:\/\/refactoring.guru\/design-patterns\/abstract-factory\" rel=\"noopener noreferrer nofollow\">Factory<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/refactoring.guru\/design-patterns\/adapter\" rel=\"noopener noreferrer nofollow\">Adapter<\/a> \u2014 \u0438 \u0440\u0443\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0447\u0435\u0441\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c, \u043d\u043e \u0432\u043e\u0442 \u0431\u0435\u0434\u0430: \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434 \u043d\u0435\u0433\u043e \u043d\u0435\u0442. \u0418 \u0442\u043e\u0433\u0434\u0430 \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0440\u0430\u0434\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b: \u043c\u043d\u043e\u0433\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u0431\u0438\u043b\u0434\u0435\u0440\u044b \u0434\u043b\u044f \u043e\u0448\u0438\u0431\u043e\u043a, \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0434\u043b\u044f \u0444\u0430\u0431\u0440\u0438\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0435 \u0448\u0435\u0434\u0435\u0432\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u043a\u043e\u0434 \u043d\u0435 \u043f\u0440\u043e\u0449\u0435, \u0430 \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u042d\u0442\u043e \u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u00ab\u0443\u0441\u043b\u044b\u0448\u0430\u043b \u0437\u0432\u043e\u043d, \u0434\u0430 \u043d\u0435 \u0437\u043d\u0430\u044e, \u0433\u0434\u0435 \u043e\u043d\u00bb \u2014 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u043d\u0438\u0435, \u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e, \u043f\u043e\u043a\u0430 \u043d\u0435\u0442.<\/p>\n<blockquote>\n<p>\ud83d\udca1 \u0412\u0430\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f: \u0446\u0435\u043b\u044c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u043d\u0435 \u0432\u044b\u0441\u043c\u0435\u0438\u0432\u0430\u0442\u044c \u0447\u0443\u0436\u043e\u0439 \u043a\u043e\u0434 \u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0438\u0436\u0435 \u2014 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043c\u043d\u0435 \u0438 \u043c\u043e\u0438\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445, \u043d\u043e \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u043c \u0438\u043b\u0438 \u043b\u044e\u0434\u044f\u043c.<\/p>\n<\/blockquote>\n<p>\u041c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Overengineering\" rel=\"noopener noreferrer nofollow\">\u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/a> \u0432 \u0436\u0438\u0432\u043e\u043c \u043a\u043e\u0434\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u043a\u0430\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u043c\u0435\u0436\u0434\u0443 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c\u044e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u2014 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0438 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445, \u0433\u0434\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0432\u0430\u0436\u043d\u0435\u0435 \u00ab\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432\u043e\u0441\u0442\u0438\u00bb.<\/p>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433?<\/h2>\n<p>\u041f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u00ab\u0443\u043f\u043b\u044b\u043b\u00bb \u0432 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Overengineering\" rel=\"noopener noreferrer nofollow\">\u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/a>, \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0441\u043b\u043e\u0436\u043d\u043e. \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0432\u043e\u0436\u043d\u044b\u0445 \u0437\u0432\u043e\u043d\u043e\u0447\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u044b \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430:<\/p>\n<h4>1. \u0418\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0446\u0435\u043b\u044b\u0435 \u00ab\u043f\u043e\u044f\u0441\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438\u00bb \u0432 \u0432\u0438\u0434\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u043e\u0451\u0432 \u2014 \u0431\u0438\u043b\u0434\u0435\u0440\u043e\u0432, \u0444\u0430\u0431\u0440\u0438\u043a, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0441\u043b\u043e\u0435\u043a \u2014 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f. \u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0440\u0430\u0434\u0438 \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u041e\u041a\u00bb.<\/p>\n<h4>2. \u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0440\u0430\u0434\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432<\/h4>\n<p>\u042d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 \u00ab\u0437\u0443\u0434\u0430\u00bb: \u0443\u0437\u043d\u0430\u043b \u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 \u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e. <a href=\"https:\/\/refactoring.guru\/design-patterns\/builder\" rel=\"noopener noreferrer nofollow\">Builder<\/a>, <a href=\"https:\/\/refactoring.guru\/design-patterns\/abstract-factory\" rel=\"noopener noreferrer nofollow\">Factory<\/a>, <a href=\"https:\/\/refactoring.guru\/design-patterns\/adapter\" rel=\"noopener noreferrer nofollow\">Adapter<\/a>, <a href=\"https:\/\/refactoring.guru\/design-patterns\/command\" rel=\"noopener noreferrer nofollow\">Command<\/a> \u2014 \u0432\u0441\u0435 \u0432 \u0431\u043e\u0439, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434 \u043d\u0438\u0445 \u043d\u0435\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0430 \u043f\u043e\u043b\u044c\u0437\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0439. \u042d\u0442\u043e \u043a\u0430\u043a \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0435\u0441\u0442\u044c \u0441\u0443\u043f \u043f\u0430\u043b\u043e\u0447\u043a\u0430\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u00ab\u0442\u0430\u043a \u043c\u043e\u0434\u043d\u0435\u0435\u00bb.<\/p>\n<h4>3. \u041a\u043b\u0430\u0441\u0441\u044b \u0440\u0430\u0434\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 <a href=\"https:\/\/docs.python.org\/3\/library\/functions.html#staticmethod\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <code>self<\/code> \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u043e\u0434\u0435\u0442\u044b\u0435 \u0432 \u00ab\u043a\u043b\u0430\u0441\u0441\u0438\u043a\u0438\u00bb. \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e, \u043d\u043e \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a, \u0447\u0442\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0448\u043b\u0430 \u0432\u0440\u0430\u0437\u043d\u043e\u0441 \u0438 \u0445\u043e\u0447\u0435\u0442 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435.<\/p>\n<h4>4. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u00ab\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c\u0443\u00bb \u0431\u0443\u0434\u0443\u0449\u0435\u043c\u0443<\/h4>\n<p>\u00ab\u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u044f\u0442\u044c \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0442\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439\u00bb \u2014 \u0437\u043d\u0430\u043a\u043e\u043c\u043e? \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u00ab\u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c\u00bb \u043c\u043e\u0436\u0435\u0442 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u0442\u044c. \u0410 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0438 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0437\u0430\u0432\u0442\u0440\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442\u0435 \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0449\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0443 \u0432\u0430\u0441 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438<\/h2>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0442\u0435\u043e\u0440\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u0433\u0434\u0435 \u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0438\u0437\u043b\u0438\u0448\u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c. <\/p>\n<blockquote>\n<p>\ud83d\udca1 \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435, \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u2014 \u0446\u0435\u043b\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434, \u0430 \u043d\u0435 \u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u0440\u0438\u0441\u0442\u044b\u0434\u0438\u0442\u044c.<\/p>\n<\/blockquote>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 1. \u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0432\u043c\u0435\u0441\u0442\u043e Enum<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class Report:     class Story:         USERS = \"USERS\"         COURSES = \"COURSES\"         ACCOUNTS = \"ACCOUNTS\"      class Feature:         USERS_SERVICE = \"USERS_SERVICE\"         COURSES_SERVICE = \"COURSES_SERVICE\"         ACCOUNTS_SERVICE = \"ACCOUNTS_SERVICE\"<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u0440\u043e\u0434\u0435 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e: \u0432\u0441\u0451 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e, \u0432\u043d\u0443\u0442\u0440\u0438 \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0430 \u00abStory \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, Feature \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u00bb. \u041d\u043e \u043d\u0430 \u0434\u0435\u043b\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0434\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c <code>Report.Story.USERS<\/code>. \u042d\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043b\u0438\u0448\u043d\u044e\u044e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0435\u0451 \u043d\u0435\u0442.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from enum import StrEnum  class Story(StrEnum):     USERS = \"USERS\"     COURSES = \"COURSES\"     ACCOUNTS = \"ACCOUNTS\"  class Feature(StrEnum):     USERS_SERVICE = \"USERS_SERVICE\"     COURSES_SERVICE = \"COURSES_SERVICE\"     ACCOUNTS_SERVICE = \"ACCOUNTS_SERVICE\"<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043f\u043b\u043e\u0441\u043a\u043e, \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0449\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/docs.python.org\/3\/library\/enum.html\" rel=\"noopener noreferrer nofollow\">Enum<\/a>, \u0447\u0442\u043e \u044f\u0432\u043d\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442: \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043a\u043e\u0440\u043e\u0447\u0435 (<code>Story.USERS<\/code>), \u0430 \u043a\u043e\u0434 \u0441\u0430\u043c\u043e\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0440\u0430\u0434\u0438 \u00ab\u043a\u0440\u0430\u0441\u043e\u0442\u044b\u00bb. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u2014 <a href=\"https:\/\/docs.python.org\/3\/library\/enum.html\" rel=\"noopener noreferrer nofollow\">Enum<\/a> \u0440\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u043b\u0443\u0447\u0448\u0435 \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 2. \u0424\u0430\u0431\u0440\u0438\u043a\u0430 \u0440\u0430\u0434\u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0438<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class User(BaseModel):     id: int     email: str     password: str  class ModelsFactory:     @staticmethod     def build_user(id: int, email: str, password: str) -&gt; User:         return User(id=id, email=email, password=password)  ModelsFactory.build_user(id=1, email=\"user@example.com\", password=\"qwerty\")<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u00ab\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u00bb: \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0430\u0431\u0440\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u00ab\u0441\u0442\u0440\u043e\u0438\u0442\u00bb \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f \u2014 \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0442\u0443\u0434\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u00ab\u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0440\u0430\u0434\u0438 \u043e\u0431\u0451\u0440\u0442\u043a\u0438\u00bb.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class User(BaseModel):     id: int     email: str     password: str  User(id=1, email=\"user@example.com\", password=\"qwerty\")<\/code><\/pre>\n<p>\u0412\u0441\u0451 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0441\u043b\u043e\u044f. \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u043d\u0435 \u043f\u0440\u044f\u0447\u0435\u043c \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0437\u0430 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u00ab\u0444\u0430\u0431\u0440\u0438\u043a\u043e\u0439\u00bb.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u0424\u0430\u0431\u0440\u0438\u043a\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (\u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438). \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0432\u0435\u0440\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430: \u043a\u043e\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435, \u0441\u043c\u044b\u0441\u043b\u0430 \u2014 \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 3.1. \u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f (UsersHTTPClient)<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class UsersHTTPClient:     def __init__(self, env: str):         ...  def build_client(env: str) -&gt; UsersHTTPClient:     if env == \"DEV\":         return UsersHTTPClient(env=\"dev\")     elif env == \"PROD\":         return UsersHTTPClient(env=\"prod\")     else:         raise ValueError(\"Unknown env\")<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u0441\u0451 \u0432\u0440\u043e\u0434\u0435 \u0447\u0451\u0442\u043a\u043e: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u043b\u0438\u0435\u043d\u0442. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f, \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0442\u043a\u0430\u043c\u0438 <code>if<\/code> \u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u0435 \u0431\u0443\u043a\u0432\u044b. \u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0443\u0442, \u0430 \u043b\u043e\u0433\u0438\u043a\u0438 \u2014 \u043c\u0438\u043d\u0438\u043c\u0443\u043c.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class UsersHTTPClient:     def __init__(self, env: str):         ...  def build_client(env: str) -&gt; UsersHTTPClient:     if env not in (\"DEV\", \"PROD\"):         raise ValueError(\"Unknown env\")      return UsersHTTPClient(env=env.lower())<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445 (\u0430 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0438 \u0442\u0440\u0451\u0445, \u0438 \u043f\u044f\u0442\u0438) \u0432\u0435\u0442\u043e\u043a \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0438\u0445 \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u041a\u043e\u0434 \u043a\u043e\u0440\u043e\u0447\u0435, \u043f\u0440\u043e\u0449\u0435 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 <code>elif<\/code>.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u0427\u0430\u0441\u0442\u043e \u00ab\u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0434\u0438 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f\u00bb \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0438\u0437 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u044f\u0432\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u041d\u043e \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b \u0438 \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0434\u043d\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e, \u043b\u0443\u0447\u0448\u0435 \u0435\u0451 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043a\u043e\u0434 \u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0440\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043e\u043a, \u0435\u0441\u043b\u0438 \u0437\u0430\u0432\u0442\u0440\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 3.2. \u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f (ClientError)<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class ClientError(BaseModel):     code: int     type: str     message: str  def build_client_error(type: str) -&gt; ClientError:     if type == \"not_found\":         return ClientError(code=4, type=\"not-found\", message=\"Not found!\")     elif type == \"internal\":         return ClientError(code=11, type=\"internal\", message=\"Internal!\")     else:         return ClientError(code=13, type=\"unknown\", message=\"Unknown!\")<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u00ab\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430\u00bb \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a. \u041d\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0443\u0447\u0430 <code>if<\/code> \u0440\u0430\u0434\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0438\u043c\u0435\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0433\u0438\u0431\u043a\u0430\u044f, \u043d\u043e \u043d\u0430 \u0434\u0435\u043b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443: \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u043e\u0448\u0438\u0431\u043a\u0438 \u2014 \u043f\u0438\u0448\u0438 \u043d\u043e\u0432\u044b\u0439 <code>elif<\/code>, \u043f\u043e\u0442\u043e\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0438 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">from pydantic import BaseModel  class ClientError(BaseModel):     code: int     type: str     message: str  def build_not_found_client_error() -&gt; ClientError:     return ClientError(code=4, type=\"not-found\", message=\"Not found!\")  def build_internal_client_error() -&gt; ClientError:     return ClientError(code=11, type=\"internal\", message=\"Internal!\")  def build_unknown_client_error() -&gt; ClientError:     return ClientError(code=13, type=\"unknown\", message=\"Unknown!\")<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0449\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0440\u043e\u0449\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043e\u043d \u044f\u0432\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0435: \u00ab\u0445\u043e\u0447\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0448\u0438\u0431\u043a\u0443 \u0442\u0438\u043f\u0430 Not Found\u00bb.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434:<\/strong> \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0432\u0441\u0451 \u0432 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u043b\u0430\u0437\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u043d\u043e \u0447\u0430\u0441\u0442\u043e \u044d\u0442\u043e \u0432\u0435\u0434\u0451\u0442 \u043a \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0439. \u041a\u043e\u0433\u0434\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u043f\u0440\u043e\u0449\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0438\u043b\u0438 \u0445\u0435\u043b\u043f\u0435\u0440. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043f\u0440\u044f\u043c\u044b\u043c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c, \u0430 \u043d\u0435 \u00ab\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c \u043d\u0430 \u0431\u0443\u043c\u0430\u0433\u0435\u00bb.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 4. \u041f\u0435\u0440\u0435\u0443\u0441\u043b\u043e\u0436\u043d\u0451\u043d\u043d\u044b\u0439 Page Object<\/h3>\n<p><strong>\u041a\u0430\u043a \u0431\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class CourseCard:     def __init__(self, index: int, title: str, page: Page):         self.page = page         self.title = title         self.index = index      def check_visible(self):         expect(self.page.locator(\"#course-card\").nth(self.index)).to_be_visible()         expect(self.page.locator(\"#course-card\").nth(self.index)).to_have_text(self.title)   class CoursesPage:     def __init__(self, page: Page):         self.page = page      def check_course_card_visible(self, title: str, index: int):         card = CourseCard(page=self.page, index=index, title=title)         card.check_visible() <\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u00ab\u043f\u043e \u0432\u0441\u0435\u043c \u043a\u0430\u043d\u043e\u043d\u0430\u043c\u00bb: \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u043a\u0443\u0440\u0441\u0430, \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u044d\u0442\u0430 \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u043d\u0435 \u043d\u0435\u0441\u0451\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u044b. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0430\u0434\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430, \u0430 \u0441\u0430\u043c\u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0436\u0435\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0434\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u00ab\u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u00bb.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"python\">class CourseCard:     def __init__(self, page: Page):         self.page = page         self.card = page.locator(\"#course-card\")      def check_visible(self, index: int, title: str):         expect(self.card.nth(index)).to_be_visible()         expect(self.card.nth(index)).to_have_text(title)   class CoursesPage:     def __init__(self, page: Page):         self.page = page       <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-473274","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=473274"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473274\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=473274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=473274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=473274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}