{"id":208442,"date":"2014-01-08T12:33:02","date_gmt":"2014-01-08T08:33:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208442"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208442","title":{"rendered":"<span class=\"post_title\">\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 PHP<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0422\u0435\u043c\u0430 SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0447\u0438\u0441\u0442\u043e\u0442\u044b \u043a\u043e\u0434\u0430 \u043d\u0435 \u0440\u0430\u0437 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443\u0436\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0438\u0437\u044a\u0435\u0437\u0436\u0435\u043d\u043d\u0430\u044f. \u041d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043e\u0434\u043d\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e IT-\u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044e, \u0433\u0434\u0435 \u043c\u0435\u043d\u044f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445 SOLID \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0433\u0434\u0430 \u044f \u043d\u0435 \u0441\u043e\u0431\u043b\u044e\u043b \u044d\u0442\u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438 \u043a \u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e. \u0418 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0430 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u043f\u043e\u0434\u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u044d\u0442\u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438 \u0434\u0430\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u0441\u0435, \u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0438 \u0440\u0435\u0448\u0438\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0438 \u0434\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c \u0434\u043b\u044f \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0435\u0451 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u0421\u0442\u0430\u0442\u044c\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439, \u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044f\u0449\u0438\u0445\u0441\u044f \u0441 SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438, \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u00ab\u0441\u044a\u0435\u0432\u0448\u0438\u0445 \u0441\u043e\u0431\u0430\u043a\u0443\u00bb \u043d\u0430 SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445.<\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 \u0438 \u0445\u043e\u0447\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u0432\u0435\u0436\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043e \u043d\u0438\u0445 \u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043a \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  \u0427\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b? \u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e Wikipedia, \u044d\u0442\u043e: <\/p>\n<blockquote><p>\u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0430 \u043f\u044f\u0442\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u2014 <b>S<\/b>ingle responsibility, <b> O<\/b>pen-closed, <b> L<\/b>iskov substitution, <b>I<\/b>nterface segregation \u0438 <b>D<\/b>ependency inversion.<\/p><\/blockquote>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0438\u043c\u0435\u0435\u043c 5 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0438\u0436\u0435:  <\/p>\n<ul>\n<li>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 (Single responsibility)<\/li>\n<li>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438\/\u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438 (Open-closed)<\/li>\n<li>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0411\u0430\u0440\u0431\u0430\u0440\u044b \u041b\u0438\u0441\u043a\u043e\u0432 (Liskov substitution)<\/li>\n<li>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (Interface segregation)<\/li>\n<li>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (Dependency Invertion)<\/li>\n<\/ul>\n<h4>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 (Single responsibility)<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0438 \u0448\u0438\u0440\u043e\u043a\u043e\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d \u0441 \u0437\u0430\u043a\u0430\u0437\u0430\u043c\u0438, \u0442\u043e\u0432\u0430\u0440\u0430\u043c\u0438 \u0438 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044f\u043c\u0438.<\/p>\n<p>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0433\u043b\u0430\u0441\u0438\u0442 \u2014 <i>\u00ab\u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043b\u043e\u0436\u0435\u043d\u0430 \u043e\u0434\u043d\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c\u00bb<\/i>. \u0422.\u0435. \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0435\u0448\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u2014 \u043d\u0438 \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u0438 \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u0437\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435:  <\/p>\n<pre><code class=\"php\">class Order { \tpublic function calculateTotalSum(){\/*...*\/} \tpublic function getItems(){\/*...*\/} \tpublic function getItemsCount(){\/*...*\/} \tpublic function addItem($item){\/*...*\/} \tpublic function deleteItem($item){\/*...*\/}  \tpublic function printOrder(){\/*...*\/} \tpublic function showOrder(){\/*...*\/}  \tpublic function load(){\/*...*\/} \tpublic function save(){\/*...*\/} \tpublic function update(){\/*...*\/} \tpublic function delete(){\/*...*\/} } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f 3 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0439 \u0442\u0438\u043f\u043e\u0432 \u0437\u0430\u0434\u0430\u0447: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0441\u0430\u043c\u0438\u043c \u0437\u0430\u043a\u0430\u0437\u043e\u043c(<code>calculateTotalSum, getItems, getItemsCount, addItem, deleteItem<\/code>), \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0437\u0430(<code>printOrder, showOrder<\/code>) \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445(<code>load, save, update, delete<\/code>).<br \/>  \u041a \u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438?<br \/>  \u041f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0435\u0447\u0430\u0442\u0438 \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043a\u0430\u0437\u0430, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0435\u0433\u043e \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438.<br \/>  \u0420\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430 3 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439<\/p>\n<pre><code class=\"php\">class Order { \tpublic function calculateTotalSum(){\/*...*\/} \tpublic function getItems(){\/*...*\/} \tpublic function getItemsCount(){\/*...*\/} \tpublic function addItem($item){\/*...*\/} \tpublic function deleteItem($item){\/*...*\/} }  class OrderRepository { \tpublic function load($orderID){\/*...*\/} \tpublic function save($order){\/*...*\/} \tpublic function update($order){\/*...*\/} \tpublic function delete($order){\/*...*\/} }  class OrderViewer { \tpublic function printOrder($order){\/*...*\/} \tpublic function showOrder($order){\/*...*\/} } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 1 \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h4>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438\/\u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438 (Open-closed)<\/h4>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0433\u043b\u0430\u0441\u0438\u0442 \u2014 <code>&quot;\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044b \u0434\u043b\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438&quot;<\/code>. \u041d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a \u2014 \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0442.\u0434. \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u0445 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434.<br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 <code>OrderRepository<\/code>.  <\/p>\n<pre><code class=\"php\">class OrderRepository { \tpublic function load($orderID) \t{ \t\t$pdo = new PDO($this-&gt;config-&gt;getDns(), $this-&gt;config-&gt;getDBUser(), $this-&gt;config-&gt;getDBPassword()); \t\t$statement = $pdo-&gt;prepare('SELECT * FROM `orders` WHERE id=:id'); \t\t$statement-&gt;execute(array(':id' =&gt; $orderID)); \t\treturn $query-&gt;fetchObject('Order');\t \t} \tpublic function save($order){\/*...*\/} \tpublic function update($order){\/*...*\/} \tpublic function delete($order){\/*...*\/} } <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0443 \u043d\u0430\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, MySQL. \u041d\u043e \u0432\u0434\u0440\u0443\u0433 \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0437\u0430\u043a\u0430\u0437\u0430\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 API \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0431\u0435\u0440\u0451\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 1\u0421. \u041a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0441\u0442\u0438? \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <code>OrderRepository<\/code>, \u043d\u043e \u044d\u0442\u043e\u0442 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <i>\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438\/\u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438<\/i>, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0434\u0430 \u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0443\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0417\u043d\u0430\u0447\u0438\u0442, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <code>OrderRepository<\/code> \u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441\u0430\u043c\u043e\u0435 \u043b\u0443\u0447\u0448\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 <code>OrderRepository<\/code> \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u043e \u0432\u0441\u0435 \u0435\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <i>\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438\/\u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438<\/i> \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439c <code> IOrderSource<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 <code>MySQLOrderSource<\/code>, <code>ApiOrderSource<\/code> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IOrderSource \u0438 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">class OrderRepository { \tprivate $source;  \tpublic function setSource(IOrderSource $source) \t{ \t\t$this-&gt;source = $source; \t}  \tpublic function load($orderID) \t{ \t\treturn $this-&gt;source-&gt;load($orderID); \t} \tpublic function save($order){\/*...*\/} \tpublic function update($order){\/*...*\/} }  interace IOrderSource { \tpublic function load($orderID); \tpublic function save($order){\/*...*\/} \tpublic function update($order){\/*...*\/} \tpublic function delete($order){\/*...*\/} }  class MySQLOrderSource implements IOrderSource { \tpublic function load($orderID); \tpublic function save($order){\/*...*\/} \tpublic function update($order){\/*...*\/} \tpublic function delete($order){\/*...*\/} }  class ApiOrderSource implements IOrderSource { \tpublic function load($orderID); \tpublic function save($order){\/*...*\/} \tpublic function update($order){\/*...*\/} \tpublic function delete($order){\/*...*\/} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 <code>OrderRepository<\/code>, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 <code>IOrderSource<\/code>, \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 <code>OrderRepository<\/code>.<\/p>\n<h4>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0411\u0430\u0440\u0431\u0430\u0440\u044b \u041b\u0438\u0441\u043a\u043e\u0432 (Liskov substitution)<\/h4>\n<p>  \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u043f\u0440\u0438\u043d\u0446\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0430\u043c\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438. <br \/>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0433\u043b\u0430\u0441\u0438\u0442 \u2014 <i>\u00ab\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u044b \u0438\u0445 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\u00bb<\/i>. \u0421\u0432\u043e\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u044f \u0431\u044b \u044d\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u043b \u0442\u0430\u043a \u2014 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c \u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u0435\u0442\u043e\u0434.<br \/>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u043b\u044f \u044d\u0442\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u044f \u043d\u0435 \u0441\u043c\u043e\u0433, \u043d\u043e \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0435\u0439 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0438\u0433\u0443\u0440 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u0438. \u041a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0438\u0436\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0438\u0445 \u043f\u043b\u043e\u0449\u0430\u0434\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">class Rectangle { \tprotected $width; \tprotected $height;  \tpublic setWidth($width) \t{ \t\t$this-&gt;width = $width; \t}  \tpublic setHeight($height) \t{ \t\t$this-&gt;height = $height; \t}  \tpublic function getWidth() \t{ \t\treturn $this-&gt;width; \t}  \tpublic function getHeight() \t{ \t\treturn $this-&gt;height; \t} }  class Square extends Rectangle { \tpublic setWidth($width) \t{ \t\tparent::setWidth($width); \t\tparent::setHeight($width); \t}  \tpublic setHeight($height) \t{ \t\tparent::setHeight($height); \t\tparent::setWidth($height); \t} }  function calculateRectangleSquare(Rectangle $rectangle, $width, $height) { \t$rectangle-&gt;setWidth($width); \t$rectangle-&gt;setHeight($height); \treturn $rectangle-&gt;getHeight * $rectangle-&gt;getWidth; }  calculateRectangleSquare(new Rectangle, 4, 5); \/\/ 20 calculateRectangleSquare(new Square, 4, 5); \/\/ 25 ??? <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u044f\u0432\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u0442 \u043d\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0436\u0434\u0443\u0442. <br \/>  \u041d\u043e \u0432 \u0447\u0451\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430? \u0420\u0430\u0437\u0432\u0435 \u00ab\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u00bb \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u00ab\u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u043c\u00bb? \u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043d\u043e \u0432 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u0445. \u0412 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u0445 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u043d\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u00ab\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u00bb \u043d\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u00ab\u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u00bb.<\/p>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0436\u0435 \u043a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443?<br \/>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u043f\u043e\u043d\u044f\u0442\u0438\u0435\u043c \u043a\u0430\u043a <i> \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0443<\/i>. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0443 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u043d\u0435 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u0441\u0430\u044e\u0442\u0441\u044f <i>\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u041b\u0438\u0441\u043a\u043e\u0432<\/i>.<br \/>  \u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0443 \u0432\u0435\u0434\u0435\u0442 \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:  <\/p>\n<ul>\n<li>\u041f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0438\u043b\u0435\u043d\u044b \u0432 \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u0435.<\/li>\n<li>\u041f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0441\u043b\u0430\u0431\u043b\u0435\u043d\u044b \u0432 \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u0435.<\/li>\n<\/ul>\n<p>  \u00ab\u0427\u0442\u043e \u0435\u0449\u0451 \u0437\u0430 \u043f\u0440\u0435\u0434- \u0438 \u043f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u044f?\u00bb \u2014 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435 \u0412\u044b. <br \/>  <b>\u041e\u0442\u0432\u0435\u0442<\/b>: <i>\u043f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u044f<\/i> \u2013 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0430, <i>\u043f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u044f<\/i> \u2013 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e, \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c.<\/p>\n<p>  \u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u043f\u0440\u0435\u0434- \u0438 \u043f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u044f.<br \/>  \u041f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u044b\u0441\u043e\u0442\u044b \u0438 \u0448\u0438\u0440\u0438\u043d\u044b, \u0430 \u0432\u043e\u0442 \u043f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0435 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0430\u0431\u044b\u0435, \u0447\u0435\u0433\u043e \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u041b\u0438\u0441\u043a\u043e\u0432 \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044b\u043b\u043e \u043d\u0435\u043b\u044c\u0437\u044f. <br \/>  \u041e\u0441\u043b\u0430\u0431\u0438\u043b\u0438 \u043c\u044b \u0438\u0445 \u0432\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443. \u0415\u0441\u043b\u0438 \u0437\u0430 \u043f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <code>setWidth<\/code> \u043f\u0440\u0438\u043d\u044f\u0442\u044c <code>(($this-&gt;width == $width) && ($this-&gt;height == $oldHeight))<\/code> (<code>$oldHeight<\/code> \u043c\u044b \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043b\u0438 \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 setWidth), \u0442\u043e \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u044b \u0435\u0433\u043e \u043e\u0441\u043b\u0430\u0431\u0438\u043b\u0438 \u0438 <code>\u043f\u0440\u0438\u043d\u0446\u0438\u043f \u041b\u0438\u0441\u043a\u043e\u0432<\/code> \u043d\u0430\u0440\u0443\u0448\u0435\u043d.<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043b\u0443\u0447\u0448\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u041e\u041e\u041f \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u0438 \u0444\u0438\u0433\u0443\u0440\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u00ab\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u00bb \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u00ab\u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u00bb, \u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u043a\u0430\u043a 2 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<pre><code class=\"php\">class Rectangle { \tprotected $width; \tprotected $height;  \tpublic setWidth($width) \t{ \t\t$this-&gt;width = $width; \t}  \tpublic setHeight($height) \t{ \t\t$this-&gt;height = $height; \t}  \tpublic function getWidth() \t{ \t\treturn $this-&gt;width; \t}  \tpublic function getHeight() \t{ \t\treturn $this-&gt;height; \t} }  class Square { \tprotected $size; \t \tpublic setSize($size) \t{ \t\t$this-&gt;size = $size; \t}  \tpublic function getSize() \t{ \t\treturn $this-&gt;size; \t} } <\/code><\/pre>\n<h4>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (Interface segregation)<\/h4>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0433\u043b\u0430\u0441\u0438\u0442, \u0447\u0442\u043e <i>\u00ab\u041c\u043d\u043e\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043e\u0434\u0438\u043d \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439\u00bb<\/i><br \/>  \u0421\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0430\u0441\u0441\u044b-\u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439\/\u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0437\u043d\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u0442\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442, \u0447\u0442\u043e \u0432\u0435\u0434\u0451\u0442 \u043a \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0441 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u043c.<br \/>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u043d\u0430\u0448\u0438 \u0442\u043e\u0432\u0430\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434, \u0441\u043a\u0438\u0434\u043a\u0443, \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0446\u0435\u043d\u0430, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 \u0442.\u0434. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043e\u0434\u0435\u0436\u0434\u0430 \u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0451 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u043d\u0430, \u0446\u0432\u0435\u0442 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440.<br \/>  \u041e\u043f\u0438\u0448\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441  <\/p>\n<pre><code class=\"php\">interface IItem { \tpublic function applyDiscount($discount); \tpublic function applyPromocode($promocode);  \tpublic function setColor($color); \tpublic function setSize($size); \t \tpublic function setCondition($condition); \tpublic function setPrice($price); } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0444\u0435\u0439\u0441 \u043f\u043b\u043e\u0445 \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043a\u0438\u0434\u043e\u043a \u0438\u043b\u0438 \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434\u043e\u0432, \u043b\u0438\u0431\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u043d (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043a\u043d\u0438\u0433). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u043d\u0451\u043c \u043c\u0435\u0442\u043e\u0434\u044b, \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u043b\u043a\u0438\u0445 \u0438 \u043a\u0430\u0436\u0434\u044b\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 IItem \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">interface IItem { \tpublic function setCondition($condition); \tpublic function setPrice($price); }  interface IClothes { \tpublic function setColor($color); \tpublic function setSize($size); \tpublic function setMaterial($material); }  interface IDiscountable { \tpublic function applyDiscount($discount); \tpublic function applyPromocode($promocode); }  class Book implemets IItem, IDiscountable {     public function setCondition($condition){\/*...*\/}     public function setPrice($price){\/*...*\/}     public function applyDiscount($discount){\/*...*\/}     public function applyPromocode($promocode){\/*...*\/} }  class KidsClothes implemets IItem, IClothes {     public function setCondition($condition){\/*...*\/}     public function setPrice($price){\/*...*\/}     public function setColor($color){\/*...*\/}     public function setSize($size){\/*...*\/}     public function setMaterial($material){\/*...*\/} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h4>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (Dependency Invertion)<\/h4>\n<p>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0433\u043b\u0430\u0441\u0438\u0442 \u2014 <i>\u00ab\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439. \u041c\u043e\u0434\u0443\u043b\u0438 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0438\u0436\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0434\u0435\u0442\u0430\u043b\u0435\u0439. \u0414\u0435\u0442\u0430\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439\u00bb<\/i>. \u0414\u0430\u043d\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u2014 <i>\u00ab\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439, \u0430 \u043d\u0435 \u0434\u0435\u0442\u0430\u043b\u0435\u0439\u00bb<\/i>.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u043f\u043b\u0430\u0442\u0443 \u0437\u0430\u043a\u0430\u0437\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u0435\u043c.<\/p>\n<pre><code class=\"php\">class Customer { \tprivate $currentOrder = null;  \tpublic function buyItems() \t{\t \t\tif(is_null($this-&gt;currentOrder)){ \t\t\treturn false; \t\t}  \t\t$processor = new OrderProcessor(); \t\treturn $processor-&gt;checkout($this-&gt;currentOrder);\t \t}  \tpublic function addItem($item){ \t\tif(is_null($this-&gt;currentOrder)){ \t\t\t$this-&gt;currentOrder = new Order(); \t\t} \t\treturn $this-&gt;currentOrder-&gt;addItem($item); \t} \tpublic function removeItem($item){ \t\tif(is_null($this-&gt;currentOrder)){ \t\t\treturn false; \t\t} \t\treturn $this-&gt;currentOrder = new Order(); \t} }  class OrderProcessor { \tpublic function checkout($order){\/*...*\/} } <\/code><\/pre>\n<p>  \u0412\u0441\u0451 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0438 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c. \u041d\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u043a\u043b\u0430\u0441\u0441 <code>Customer<\/code> \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <code>OrderProcessor<\/code> (\u043c\u0430\u043b\u043e \u0442\u043e\u0433\u043e, \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438\/\u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438).<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u043e\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a \u0447\u0442\u043e\u0431\u044b <code>Customer<\/code> \u0437\u0430\u0432\u0438\u0441\u0435\u043b \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u0442.\u0435. \u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>IOrderProcessor<\/code>. \u0414\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0442\u0442\u0435\u0440\u044b, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u0430, \u0438\u043b\u0438 <code>Dependency Injection<\/code> \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u042f \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430 2 \u043c\u0435\u0442\u043e\u0434\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 Customer<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">class Customer { \tprivate $currentOrder = null;  \tpublic function buyItems(IOrderProcessor $processor) \t{\t \t\tif(is_null($this-&gt;currentOrder)){ \t\t\treturn false; \t\t} \t\t \t\treturn $processor-&gt;checkout($this-&gt;currentOrder);\t \t}  \tpublic function addItem($item){ \t\tif(is_null($this-&gt;currentOrder)){ \t\t\t$this-&gt;currentOrder = new Order(); \t\t} \t\treturn $this-&gt;currentOrder-&gt;addItem($item); \t} \tpublic function removeItem($item){ \t\tif(is_null($this-&gt;currentOrder)){ \t\t\treturn false; \t\t} \t\treturn $this-&gt;currentOrder = new Order(); \t} }  interface IOrderProcessor { \tpublic function checkout($order); }  class OrderProcessor implements IOrderProcessor { \tpublic function checkout($order){\/*...*\/} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043b\u0430\u0441\u0441 <code>Customer <\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0442.\u0435. \u0434\u0435\u0442\u0430\u043b\u0438, \u0435\u043c\u0443 \u043d\u0435 \u0442\u0430\u043a \u0432\u0430\u0436\u043d\u044b.<\/p>\n<h4>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430<\/h4>\n<p>  \u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u044f \u0432\u0441\u0451 \u0432\u044b\u0448\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0443  <\/p>\n<ul>\n<li><b>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 (Single responsibility)<\/b><br \/>   <i> \u00ab\u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043b\u043e\u0436\u0435\u043d\u0430 \u043e\u0434\u043d\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c\u00bb<\/i><br \/>   \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u2014 \u0435\u0441\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0439, \u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441.   <\/li>\n<li><b>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438\/\u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438 (Open-closed)<\/b><br \/>   <i> \u00ab\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044b \u0434\u043b\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\u00bb<\/i><br \/>   \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u043a\u0430\u043a \u00ab\u0447\u0451\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a\u00bb \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.   <\/li>\n<li><b>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0411\u0430\u0440\u0431\u0430\u0440\u044b \u041b\u0438\u0441\u043a\u043e\u0432 (Liskov substitution)<\/b><br \/>   <i>\u00ab\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u044b \u0438\u0445 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\u00bb<\/i><br \/>   \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043d\u0435 \u0443\u0441\u0438\u043b\u0438\u043b\u0438 \u043b\u0438 \u043c\u044b \u043f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043d\u0435 \u043e\u0441\u043b\u0430\u0431\u0438\u043b\u0438 \u043b\u0438 \u043f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u2014 \u0442\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043d\u0435 \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f   <\/li>\n<li><b>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (Interface segregation)<\/b><br \/>   <i>\u00ab\u041c\u043d\u043e\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043e\u0434\u0438\u043d \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439\u00bb<\/i><br \/>   \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u0438 \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u2014 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b.   <\/li>\n<li><b>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (Dependency Invertion)<\/b><br \/>  <i>\u00ab\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439, \u0430 \u043d\u0435 \u0434\u0435\u0442\u0430\u043b\u0435\u0439\u00bb<\/i><br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u043e\u0442 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432(\u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u0443\u044e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0442.\u0434) \u0438 \u0435\u0441\u043b\u0438 \u044d\u0442\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e, \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438.  <\/li>\n<\/ul>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043c\u043e\u044f \u00ab\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430\u00bb \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 SOLID \u0438 \u0434\u0430\u0441\u0442 \u0442\u043e\u043b\u0447\u043e\u043a \u043a \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<br \/>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/208442\/\"> http:\/\/habrahabr.ru\/post\/208442\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0422\u0435\u043c\u0430 SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0447\u0438\u0441\u0442\u043e\u0442\u044b \u043a\u043e\u0434\u0430 \u043d\u0435 \u0440\u0430\u0437 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443\u0436\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0438\u0437\u044a\u0435\u0437\u0436\u0435\u043d\u043d\u0430\u044f. \u041d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043e\u0434\u043d\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e IT-\u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044e, \u0433\u0434\u0435 \u043c\u0435\u043d\u044f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445 SOLID \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0433\u0434\u0430 \u044f \u043d\u0435 \u0441\u043e\u0431\u043b\u044e\u043b \u044d\u0442\u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438 \u043a \u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e. \u0418 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0430 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u043f\u043e\u0434\u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u044d\u0442\u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438 \u0434\u0430\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u0441\u0435, \u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0438 \u0440\u0435\u0448\u0438\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0438 \u0434\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c \u0434\u043b\u044f \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0435\u0451 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u0421\u0442\u0430\u0442\u044c\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439, \u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044f\u0449\u0438\u0445\u0441\u044f \u0441 SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438, \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u00ab\u0441\u044a\u0435\u0432\u0448\u0438\u0445 \u0441\u043e\u0431\u0430\u043a\u0443\u00bb \u043d\u0430 SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445.<\/p>\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-208442","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208442","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=208442"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208442\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}