{"id":462672,"date":"2025-06-10T10:09:30","date_gmt":"2025-06-10T10:09:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=462672"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=462672","title":{"rendered":"<span>\u041a\u0430\u043a \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442 \u043c\u0443\u0442\u0430\u0446\u0438\u0439 \u0432 DTO: \u043a\u043e\u0440\u043e\u0442\u043a\u043e<\/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<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e (\u0438\u043b\u0438 \u0437\u043b\u043e\u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0433\u043e) \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f <abbr class=\"habraabbr\" title=\"(Data Transfer Object) \u2014 \u043e\u0431\u044a\u0435\u043a\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u044f\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.\" data-title=\"&lt;p&gt;(Data Transfer Object) \u2014 \u043e\u0431\u044a\u0435\u043a\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u044f\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.&lt;\/p&gt;&lt;p&gt;&lt;\/p&gt;\" data-abbr=\"DTO\">DTO<\/abbr>, \u0447\u0435\u043c \u043e\u043f\u0430\u0441\u043d\u0430 \u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043a\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u044e\u0442 C#, Java, Python \u0438 Go, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043b\u043e\u0432\u0438\u043b\u0438 \u044d\u0442\u0438 \u0431\u0430\u0433\u0438.<\/p>\n<h3>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u0442\u044b\u043a: \u00ab\u043d\u0435\u0432\u0438\u043d\u043d\u044b\u0439\u00bb UserDto<\/h3>\n<pre><code class=\"cs\">\/\/ \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043e\u0442\u0434\u0430\u0451\u043c \u043d\u0430\u0440\u0443\u0436\u0443 \u00ab\u0447\u0438\u0441\u0442\u044b\u0439\u00bb UserDto public record UserDto(string Id, string Role, string Email);  \/\/ \u0421\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 public sealed class AuthService {     public bool CanEdit(UserDto user) =&gt; user.Role == \"Admin\"; }  \/\/ \u0433\u0434\u0435-\u0442\u043e \u0433\u043b\u0443\u0431\u0436\u0435\u2026 var dto = mapper.Map&lt;UserDto&gt;(entity);   \/\/ entity.Role == \"User\" DoBusiness(dto);                         \/\/ \u0440\u043e\u043b\u044c \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 if (authService.CanEdit(dto)) {     \/\/  \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0441\u044e\u0434\u0430 }<\/code><\/pre>\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0435 DTO \u0434\u043e\u043a\u0440\u0443\u0442\u0438\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u043e\u043d\u0443\u0441\u043d\u044b\u0445 \u0431\u0430\u043b\u043b\u043e\u0432 \u0438\u2026 \u043d\u0435\u0447\u0430\u044f\u043d\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 <code>Role<\/code>. \u041d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u0438\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 <strong>authService \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442<\/strong>. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0444\u0435\u0439\u043b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u044b\u0440\u043a\u0443 \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h3>\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0437\u0430\u0449\u0438\u0442\u044b<\/h3>\n<h4>\u0417\u0430\u0449\u0438\u0442\u043d\u044b\u0435 \u043a\u043e\u043f\u0438\u0438<\/h4>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 (\u0438 \u0434\u043e\u0440\u043e\u0433\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439) \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c DTO \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0445\u043e\u0434\u0435\/\u0432\u044b\u0445\u043e\u0434\u0435 \u0441\u043b\u043e\u044f.<\/p>\n<pre><code class=\"java\">UserDto safeCopy = incomingUserDto.clone(); \/\/ \u0414\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435<\/code><\/pre>\n<p><strong>\u041c\u0438\u043d\u0443\u0441:<\/strong> \u043c\u0443\u0441\u043e\u0440 \u0432 heap, \u0437\u0430\u0431\u044b\u0442\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043a\u043e\u043f\u0438\u044f \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u0430.<\/p>\n<h4>Mapping-\u0441\u043b\u043e\u0439<\/h4>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c AutoMapper\/MapStruct\/StructMapper, \u0447\u0442\u043e\u0431\u044b <em>\u0432\u0441\u0435\u0433\u0434\u0430<\/em> \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b.<\/p>\n<p>\u0412 .NET AutoMapper \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>PreserveReferences()<\/code> \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u044b \u0446\u0438\u043a\u043b\u044b. \u0412 Java MapStruct \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 compile-time \u2014 \u043b\u0438\u0448\u043d\u0438\u0439 GC \u0448\u0443\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0435\u043d.<\/p>\n<h4>Value Object-\u044b<\/h4>\n<p>\u0421\u0443\u0449\u043d\u043e\u0441\u0442\u044c = \u0434\u0430\u043d\u043d\u044b\u0435 + \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043d\u043e \u0431\u0435\u0437 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<pre><code class=\"cs\">public readonly record struct Money(decimal Amount, string Currency);<\/code><\/pre>\n<p>\u0423 Value Object \u043d\u0435\u0442 \u0441\u0435\u0442\u0442\u0435\u0440\u043e\u0432, \u0438 \u0435\u0433\u043e \u043b\u0435\u0433\u0447\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0432\u0445\u043e\u0434\u0435.<\/p>\n<h3>\u042f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0430\u043d\u0442\u0438-\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h3>\n<h4>C# 12\/13<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"161\" width=\"161\">\n<p align=\"left\">\u0421\u043f\u043e\u0441\u043e\u0431<\/p>\n<\/th>\n<th data-colwidth=\"196\" width=\"196\">\n<p align=\"left\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041a\u043e\u0434<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"left\"><code>record<\/code><\/p>\n<\/td>\n<td data-colwidth=\"196\" width=\"196\">\n<p align=\"left\">\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u0442\u0438\u043f \u0441\u043e <code>init<\/code>-\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>public record UserDto(string Id, string Role) { public string Email { get; init; } }<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"left\"><code>with<\/code>-copy<\/p>\n<\/td>\n<td data-colwidth=\"196\" width=\"196\">\n<p align=\"left\">\u041d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u0448\u0451\u0432\u044b\u0439 \u043a\u043e\u043f\u0438\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>var safe = dto with { Role = \"Guest\" };<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"left\"><code>readonly struct<\/code><\/p>\n<\/td>\n<td data-colwidth=\"196\" width=\"196\">\n<p align=\"left\">\u0417\u043d\u0430\u0447\u0438\u043c\u044b\u0439 \u0442\u0438\u043f, \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u043b\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>public readonly struct Coordinates(double Lat, double Lng);<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>positional <code>record<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <strong>immutable<\/strong>. \u0410 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C# 12 \u043a \u043d\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c <code>required<\/code>-\u0447\u043b\u0435\u043d\u044b \u0438 source-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 <code>init<\/code>\/<code>required<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/p>\n<h4>Java 21: record \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0430 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u044c<\/h4>\n<p>Java \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0437\u0434\u043d\u043e \u043f\u043e\u0434\u043e\u0448\u043b\u0430 \u043a \u0442\u0435\u043c\u0435 \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u041a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u2014 <code>record<\/code>. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 <code>public record UserDto(String id, String role, String email) {}<\/code>, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 <code>private final<\/code> \u043f\u043e\u043b\u044f, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, <code>equals<\/code>, <code>hashCode<\/code> \u0438 <code>toString<\/code>. <\/p>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u043e \u0432 API-\u0441\u043b\u043e\u044f\u0445, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b DTO, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u0440\u0443\u0436\u0443, \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u043c. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438: <code>new UserDto(user.id(), \"Admin\", user.email())<\/code>. <\/p>\n<p><code>record<\/code> \u2014 \u044d\u0442\u043e \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441. \u0415\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c. \u0422\u0430\u043a\u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440:<\/p>\n<pre><code class=\"java\">public record Email(String value) {     public Email {         if (!value.contains(\"@\")) throw new IllegalArgumentException(\"Invalid email\");     } }<\/code><\/pre>\n<p>\u0414\u043e \u0432\u0435\u0440\u0441\u0438\u0438 2.13 Jackson \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b <code>record<\/code>-\u044b, \u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 2.13 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 2025 \u0433\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 2.17.<\/p>\n<p>\u0412 Java \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>record<\/code>, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435 \u043d\u0435\u0441\u0451\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0430 \u043b\u0438\u0448\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0434\u0430\u043d\u043d\u044b\u0435. <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 <code>record<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 JPA-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0441\u043f\u043e\u0434\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442: Hibernate \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0435\u0442\u0442\u0435\u0440\u044b, \u0447\u0435\u0433\u043e \u0443 <code>record<\/code>-\u043e\u0432 \u043d\u0435\u0442. <\/p>\n<h4>Python 3.13 + Pydantic v2: \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043c\u043e\u0440\u0430\u0436\u0438\u0432\u0430\u0435\u043c<\/h4>\n<p>\u0412 Pydantic v2 \u043a\u043b\u044e\u0447 \u043a \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>frozen=True<\/code> \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">from pydantic import BaseModel, ConfigDict  class UserDto(BaseModel):     id: str     role: str     email: str      model_config = ConfigDict(frozen=True)<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438: \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f <code>dto.role = 'admin'<\/code> \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041c\u043e\u0434\u0435\u043b\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f hashable \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 <code>set<\/code> \u0438\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f. <\/p>\n<p>\u0421 \u0432\u044b\u0445\u043e\u0434\u043e\u043c Pydantic v2, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 Rust, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432\u044b\u0440\u043e\u0441\u043b\u0430. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 v1, \u0433\u0434\u0435 <code>frozen<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0435\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u0430\u044f \u0438 \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u0442\u044b\u0439 Python, \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u2014 <code>@dataclass(frozen=True)<\/code>. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">from dataclasses import dataclass  @dataclass(frozen=True) class UserDto:     id: str     role: str     email: str<\/code><\/pre>\n<p>\u0418\u043c\u0435\u0435\u043c \u0442\u0443 \u0436\u0435 \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u0431\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043d\u0443\u0436\u043d\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>mypy<\/code> \u0441 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c <code>pydantic<\/code>. \u041e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043c\u0443\u0442\u0430\u0446\u0438\u0439 \u0435\u0449\u0451 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 <code>mypy &gt;= 1.10<\/code> \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0434\u043b\u044f dataclass&#8217;\u043e\u0432, \u0438 \u0434\u043b\u044f pydantic-\u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c <code>frozen<\/code>, \u0438\u043d\u0430\u0447\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c. \u041e\u0431 \u044d\u0442\u043e\u043c, \u043a \u0441\u043b\u043e\u0432\u0443, \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442.<\/p>\n<h4>Go 1.22: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 \u043a\u043e\u043f\u0438\u044f<\/h4>\n<p>\u0412 Go \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e. \u042d\u0442\u043e \u0434\u0430\u0435\u0442 \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code class=\"go\">type UserDTO struct {     ID, Role, Email string }  func Promote(user UserDTO) {     user.Role = \"Admin\" }<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>user<\/code> \u044d\u0442\u043e \u043a\u043e\u043f\u0438\u044f. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 <code>Promote<\/code> \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c:<\/p>\n<pre><code class=\"go\">func PromotePtr(user *UserDTO) {     user.Role = \"Admin\" }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435  \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0447\u0438\u0441\u0442\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441-\u0441\u043b\u043e\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e. \u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u044d\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e: \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, I\/O \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 <code>sync.Mutex<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u043c\u0443\u0442\u0430\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c\u0438 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0435\u0442\u0442\u0435\u0440\u044b:<\/p>\n<pre><code class=\"go\">type UserDTO struct {     id    string     email string     role  string }  func (u UserDTO) ID() string   { return u.id } func (u UserDTO) Role() string { return u.role }<\/code><\/pre>\n<p>\u0421\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 \u0440\u0443\u0447\u043d\u0430\u044f \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0412 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0438\u0434\u0451\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0433\u0435\u0442\u0442\u0435\u0440-\u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u044f\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043b\u0434\u0435\u0440 \u0438\u043b\u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0443.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, Go \u043f\u043e\u043e\u0449\u0440\u044f\u0435\u0442 \u044f\u0432\u043d\u043e\u0441\u0442\u044c: \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u043c\u0443\u0442\u0430\u0446\u0438\u044e. <\/p>\n<h3>\u041c\u0438\u043d\u0438-\u0440\u0435\u0437\u044e\u043c\u0435<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">\u042f\u0437\u044b\u043a<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u0438\u0447\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0414\u043e\u043f. \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">C#<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>record<\/code>, <code>init<\/code>, <code>required<\/code>, <code>with<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">source generators, AutoMapper<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">Java<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>record<\/code> (JEP 395)<\/p>\n<\/td>\n<td>\n<p align=\"left\">Lombok <code>@Value<\/code>, MapStruct<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">Python<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>@dataclass(frozen)<\/code>, <code>pydantic.ConfigDict(frozen)<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">attrs, typing-immutability plugin<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">Go<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u0430 \u043d\u0435 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043b\u0438\u043d\u0442\u0435\u0440\u044b <code>staticcheck<\/code>, <code>go vet<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0418\u0442\u043e\u0433\u0438<\/h3>\n<p>Immutable-\u043f\u043e\u0434\u0445\u043e\u0434 \u2014 \u043d\u0435 \u043f\u0430\u043d\u0430\u0446\u0435\u044f, \u043d\u043e \u044d\u0442\u043e <strong>\u0434\u0435\u0448\u0435\u0432\u0435\u0439\u0448\u0430\u044f \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0430<\/strong> \u043e\u0442 \u043f\u0440\u043e\u0431\u0435\u043b\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432 \u043c\u0438\u043a\u0440\u043e- \u0438\u043b\u0438 \u043c\u0430\u043a\u0440\u043e\u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430\u0445. \u0427\u0435\u043c \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u044b \u0437\u0430\u0446\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0435 DTO, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0431\u0443\u0434\u0435\u0442\u0435 \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043c.<\/p>\n<hr\/>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442\u0435 \u0437\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0442\u043e \u0437\u043d\u0430\u0435\u0442\u0435, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u043e \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u0438\u0446\u0438\u0442 \u043d\u0430\u0432\u044b\u043a\u043e\u0432 \u2014 \u0431\u0435\u0437 \u043e\u0442\u0440\u044b\u0432\u0430 \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0441 \u0444\u043e\u043a\u0443\u0441\u043e\u043c \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412 OTUS \u0435\u0441\u0442\u044c \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b: backend \u0438 frontend \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430, DevOps, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b \u2014 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u0434 \u0441\u0442\u0435\u043a \u0438 \u0446\u0435\u043b\u0438 \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0424\u043e\u0440\u043c\u0430\u0442\u044b \u2014 \u0433\u0438\u0431\u043a\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b\u043e delivery. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u2014 <a href=\"https:\/\/otus.pw\/D4Lw\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0430 \u0441\u0430\u0439\u0442\u0435 OTUS.<\/a><\/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\/914418\/\"> https:\/\/habr.com\/ru\/articles\/914418\/<\/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<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e (\u0438\u043b\u0438 \u0437\u043b\u043e\u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0433\u043e) \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f <abbr class=\"habraabbr\" title=\"(Data Transfer Object) \u2014 \u043e\u0431\u044a\u0435\u043a\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u044f\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.\" data-title=\"&lt;p&gt;(Data Transfer Object) \u2014 \u043e\u0431\u044a\u0435\u043a\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u044f\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.&lt;\/p&gt;&lt;p&gt;&lt;\/p&gt;\" data-abbr=\"DTO\">\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u044f\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.&lt;\/p&gt;&lt;p&gt;&lt;\/p&gt;&#187; data-abbr=&#187;DTO&#187;>DTO<\/abbr>, \u0447\u0435\u043c \u043e\u043f\u0430\u0441\u043d\u0430 \u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043a\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u044e\u0442 C#, Java, Python \u0438 Go, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043b\u043e\u0432\u0438\u043b\u0438 \u044d\u0442\u0438 \u0431\u0430\u0433\u0438.<\/p>\n<h3>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u0442\u044b\u043a: \u00ab\u043d\u0435\u0432\u0438\u043d\u043d\u044b\u0439\u00bb UserDto<\/h3>\n<pre><code class=\"cs\">\/\/ \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043e\u0442\u0434\u0430\u0451\u043c \u043d\u0430\u0440\u0443\u0436\u0443 \u00ab\u0447\u0438\u0441\u0442\u044b\u0439\u00bb UserDto public record UserDto(string Id, string Role, string Email);  \/\/ \u0421\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 public sealed class AuthService {     public bool CanEdit(UserDto user) =&gt; user.Role == \"Admin\"; }  \/\/ \u0433\u0434\u0435-\u0442\u043e \u0433\u043b\u0443\u0431\u0436\u0435\u2026 var dto = mapper.Map&lt;UserDto&gt;(entity);   \/\/ entity.Role == \"User\" DoBusiness(dto);                         \/\/ \u0440\u043e\u043b\u044c \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 if (authService.CanEdit(dto)) {     \/\/  \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0441\u044e\u0434\u0430 }<\/code><\/pre>\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0435 DTO \u0434\u043e\u043a\u0440\u0443\u0442\u0438\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u043e\u043d\u0443\u0441\u043d\u044b\u0445 \u0431\u0430\u043b\u043b\u043e\u0432 \u0438\u2026 \u043d\u0435\u0447\u0430\u044f\u043d\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 <code>Role<\/code>. \u041d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u0438\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 <strong>authService \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442<\/strong>. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0444\u0435\u0439\u043b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u044b\u0440\u043a\u0443 \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h3>\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0437\u0430\u0449\u0438\u0442\u044b<\/h3>\n<h4>\u0417\u0430\u0449\u0438\u0442\u043d\u044b\u0435 \u043a\u043e\u043f\u0438\u0438<\/h4>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 (\u0438 \u0434\u043e\u0440\u043e\u0433\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439) \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c DTO \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0445\u043e\u0434\u0435\/\u0432\u044b\u0445\u043e\u0434\u0435 \u0441\u043b\u043e\u044f.<\/p>\n<pre><code class=\"java\">UserDto safeCopy = incomingUserDto.clone(); \/\/ \u0414\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435<\/code><\/pre>\n<p><strong>\u041c\u0438\u043d\u0443\u0441:<\/strong> \u043c\u0443\u0441\u043e\u0440 \u0432 heap, \u0437\u0430\u0431\u044b\u0442\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043a\u043e\u043f\u0438\u044f \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u0430.<\/p>\n<h4>Mapping-\u0441\u043b\u043e\u0439<\/h4>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c AutoMapper\/MapStruct\/StructMapper, \u0447\u0442\u043e\u0431\u044b <em>\u0432\u0441\u0435\u0433\u0434\u0430<\/em> \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b.<\/p>\n<p>\u0412 .NET AutoMapper \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>PreserveReferences()<\/code> \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u044b \u0446\u0438\u043a\u043b\u044b. \u0412 Java MapStruct \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 compile-time \u2014 \u043b\u0438\u0448\u043d\u0438\u0439 GC \u0448\u0443\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0435\u043d.<\/p>\n<h4>Value Object-\u044b<\/h4>\n<p>\u0421\u0443\u0449\u043d\u043e\u0441\u0442\u044c = \u0434\u0430\u043d\u043d\u044b\u0435 + \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043d\u043e \u0431\u0435\u0437 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<pre><code class=\"cs\">public readonly record struct Money(decimal Amount, string Currency);<\/code><\/pre>\n<p>\u0423 Value Object \u043d\u0435\u0442 \u0441\u0435\u0442\u0442\u0435\u0440\u043e\u0432, \u0438 \u0435\u0433\u043e \u043b\u0435\u0433\u0447\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0432\u0445\u043e\u0434\u0435.<\/p>\n<h3>\u042f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0430\u043d\u0442\u0438-\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h3>\n<h4>C# 12\/13<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"161\" width=\"161\">\n<p align=\"left\">\u0421\u043f\u043e\u0441\u043e\u0431<\/p>\n<\/th>\n<th data-colwidth=\"196\" width=\"196\">\n<p align=\"left\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041a\u043e\u0434<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"left\"><code>record<\/code><\/p>\n<\/td>\n<td data-colwidth=\"196\" width=\"196\">\n<p align=\"left\">\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u0442\u0438\u043f \u0441\u043e <code>init<\/code>-\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>public record UserDto(string Id, string Role) { public string Email { get; init; } }<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"left\"><code>with<\/code>-copy<\/p>\n<\/td>\n<td data-colwidth=\"196\" width=\"196\">\n<p align=\"left\">\u041d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u0448\u0451\u0432\u044b\u0439 \u043a\u043e\u043f\u0438\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>var safe = dto with { Role = \"Guest\" };<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"left\"><code>readonly struct<\/code><\/p>\n<\/td>\n<td data-colwidth=\"196\" width=\"196\">\n<p align=\"left\">\u0417\u043d\u0430\u0447\u0438\u043c\u044b\u0439 \u0442\u0438\u043f, \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u043b\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>public readonly struct Coordinates(double Lat, double Lng);<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>positional <code>record<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <strong>immutable<\/strong>. \u0410 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C# 12 \u043a \u043d\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c <code>required<\/code>-\u0447\u043b\u0435\u043d\u044b \u0438 source-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 <code>init<\/code>\/<code>required<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/p>\n<h4>Java 21: record \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0430 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u044c<\/h4>\n<p>Java \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0437\u0434\u043d\u043e \u043f\u043e\u0434\u043e\u0448\u043b\u0430 \u043a \u0442\u0435\u043c\u0435 \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u041a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u2014 <code>record<\/code>. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 <code>public record UserDto(String id, String role, String email) {}<\/code>, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 <code>private final<\/code> \u043f\u043e\u043b\u044f, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, <code>equals<\/code>, <code>hashCode<\/code> \u0438 <code>toString<\/code>. <\/p>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u043e \u0432 API-\u0441\u043b\u043e\u044f\u0445, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b DTO, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u0440\u0443\u0436\u0443, \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u043c. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438: <code>new UserDto(user.id(), \"Admin\", user.email())<\/code>. <\/p>\n<p><code>record<\/code> \u2014 \u044d\u0442\u043e \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441. \u0415\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c. \u0422\u0430\u043a\u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440:<\/p>\n<pre><code class=\"java\">public record Email(String value) {     public Email {         if (!value.contains(\"@\")) throw new IllegalArgumentException(\"Invalid email\");     } }<\/code><\/pre>\n<p>\u0414\u043e \u0432\u0435\u0440\u0441\u0438\u0438 2.13 Jackson \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b <code>record<\/code>-\u044b, \u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 2.13 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 2025 \u0433\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 2.17.<\/p>\n<p>\u0412 Java \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>record<\/code>, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435 \u043d\u0435\u0441\u0451\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0430 \u043b\u0438\u0448\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0434\u0430\u043d\u043d\u044b\u0435. <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 <code>record<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 JPA-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0441\u043f\u043e\u0434\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442: Hibernate \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0435\u0442\u0442\u0435\u0440\u044b, \u0447\u0435\u0433\u043e \u0443 <code>record<\/code>-\u043e\u0432 \u043d\u0435\u0442. <\/p>\n<h4>Python 3.13 + Pydantic v2: \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043c\u043e\u0440\u0430\u0436\u0438\u0432\u0430\u0435\u043c<\/h4>\n<p>\u0412 Pydantic v2 \u043a\u043b\u044e\u0447 \u043a \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>frozen=True<\/code> \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">from pydantic import BaseModel, ConfigDict  class UserDto(BaseModel):     id: str     role: str     email: str      model_config = ConfigDict(frozen=True)<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438: \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f <code>dto.role = 'admin'<\/code> \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041c\u043e\u0434\u0435\u043b\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f hashable \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 <code>set<\/code> \u0438\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f. <\/p>\n<p>\u0421 \u0432\u044b\u0445\u043e\u0434\u043e\u043c Pydantic v2, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 Rust, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432\u044b\u0440\u043e\u0441\u043b\u0430. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 v1, \u0433\u0434\u0435 <code>frozen<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0435\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u0430\u044f \u0438 \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u0442\u044b\u0439 Python, \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u2014 <code>@dataclass(frozen=True)<\/code>. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">from dataclasses import dataclass  @dataclass(frozen=True) class UserDto:     id: str     role: str     email: str<\/code><\/pre>\n<p>\u0418\u043c\u0435\u0435\u043c \u0442\u0443 \u0436\u0435 \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u0431\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043d\u0443\u0436\u043d\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>mypy<\/code> \u0441 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c <code>pydantic<\/code>. \u041e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043c\u0443\u0442\u0430\u0446\u0438\u0439 \u0435\u0449\u0451 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 <code>mypy &gt;= 1.10<\/code> \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0434\u043b\u044f dataclass&#8217;\u043e\u0432, \u0438 \u0434\u043b\u044f pydantic-\u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c <code>frozen<\/code>, \u0438\u043d\u0430\u0447\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c. \u041e\u0431 \u044d\u0442\u043e\u043c, \u043a \u0441\u043b\u043e\u0432\u0443, \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442.<\/p>\n<h4>Go 1.22: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 \u043a\u043e\u043f\u0438\u044f<\/h4>\n<p>\u0412 Go \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e. \u042d\u0442\u043e \u0434\u0430\u0435\u0442 \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code class=\"go\">type UserDTO struct {     ID, Role, Email string }  func Promote(user UserDTO) {     user.Role = \"Admin\" }<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>user<\/code> \u044d\u0442\u043e \u043a\u043e\u043f\u0438\u044f. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 <code>Promote<\/code> \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c:<\/p>\n<pre><code class=\"go\">func PromotePtr(user *UserDTO) {     user.Role = \"Admin\" }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435  \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0447\u0438\u0441\u0442\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441-\u0441\u043b\u043e\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e. \u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u044d\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e: \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, I\/O \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 <code>sync.Mutex<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u043c\u0443\u0442\u0430\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c\u0438 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0435\u0442\u0442\u0435\u0440\u044b:<\/p>\n<pre><code class=\"go\">type UserDTO struct {     id    string     email string     role  string }  func (u UserDTO) ID() string   { return u.id } func (u UserDTO) Role() string { return u.role }<\/code><\/pre>\n<p>\u0421\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 \u0440\u0443\u0447\u043d\u0430\u044f \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0412 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0438\u0434\u0451\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0433\u0435\u0442\u0442\u0435\u0440-\u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u044f\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043b\u0434\u0435\u0440 \u0438\u043b\u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0443.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, Go \u043f\u043e\u043e\u0449\u0440\u044f\u0435\u0442 \u044f\u0432\u043d\u043e\u0441\u0442\u044c: \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u043c\u0443\u0442\u0430\u0446\u0438\u044e. <\/p>\n<h3>\u041c\u0438\u043d\u0438-\u0440\u0435\u0437\u044e\u043c\u0435<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">\u042f\u0437\u044b\u043a<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u0438\u0447\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0414\u043e\u043f. \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">C#<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>record<\/code>, <code>init<\/code>, <code>required<\/code>, <code>with<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">source generators, AutoMapper<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">Java<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>record<\/code> (JEP 395)<\/p>\n<\/td>\n<td>\n<p align=\"left\">Lombok <code>@Value<\/code>, MapStruct<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">Python<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>@dataclass(frozen)<\/code>, <code>pydantic.ConfigDict(frozen)<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">attrs, typing-immutability plugin<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">Go<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u0430 \u043d\u0435 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043b\u0438\u043d\u0442\u0435\u0440\u044b <code>staticcheck<\/code>, <code>go vet<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0418\u0442\u043e\u0433\u0438<\/h3>\n<p>Immutable-\u043f\u043e\u0434\u0445\u043e\u0434 \u2014 \u043d\u0435 \u043f\u0430\u043d\u0430\u0446\u0435\u044f, \u043d\u043e \u044d\u0442\u043e <strong>\u0434\u0435\u0448\u0435\u0432\u0435\u0439\u0448\u0430\u044f \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0430<\/strong> \u043e\u0442 \u043f\u0440\u043e\u0431\u0435\u043b\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432 \u043c\u0438\u043a\u0440\u043e- \u0438\u043b\u0438 \u043c\u0430\u043a\u0440\u043e\u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430\u0445. \u0427\u0435\u043c \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u044b \u0437\u0430\u0446\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0435 DTO, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0431\u0443\u0434\u0435\u0442\u0435 \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043c.<\/p>\n<hr\/>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442\u0435 \u0437\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0442\u043e \u0437\u043d\u0430\u0435\u0442\u0435, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u043e \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u0438\u0446\u0438\u0442 \u043d\u0430\u0432\u044b\u043a\u043e\u0432 \u2014 \u0431\u0435\u0437 \u043e\u0442\u0440\u044b\u0432\u0430 \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0441 \u0444\u043e\u043a\u0443\u0441\u043e\u043c \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412 OTUS \u0435\u0441\u0442\u044c \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b: backend \u0438 frontend \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430, DevOps, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b \u2014 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u0434 \u0441\u0442\u0435\u043a \u0438 \u0446\u0435\u043b\u0438 \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0424\u043e\u0440\u043c\u0430\u0442\u044b \u2014 \u0433\u0438\u0431\u043a\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b\u043e delivery. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u2014 <a href=\"https:\/\/otus.pw\/D4Lw\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0430 \u0441\u0430\u0439\u0442\u0435 OTUS.<\/a><\/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\/914418\/\"> https:\/\/habr.com\/ru\/articles\/914418\/<\/a><br \/><\/br><\/br><\/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-462672","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/462672","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=462672"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/462672\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=462672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=462672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=462672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}