You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It isn’t required to all of those operations complete at the same time.</td>
251
+
<td>It merges different, business domains.</td>
252
+
</tr>
253
+
</table>
254
+
</div>
255
+
</td>
256
+
</tr>
257
+
</table>
258
+
</div>
259
+
<divclass="paragraph">
260
+
<p>Similar methods are, unfortunately, quite common in business applications.
261
+
At first glance, many developers don’t see any problems with similar code.
262
+
Let’s break down the problems in detail.</p>
263
+
</div>
264
+
<divclass="sect3">
265
+
<h4id="_overuse_of_transactional_processing"><aclass="anchor" href="#_overuse_of_transactional_processing"></a><aclass="link" href="#_overuse_of_transactional_processing">1.1.1. Overuse of transactional processing</a></h4>
266
+
<divclass="paragraph">
267
+
<p>The transactional processing has been the cornerstone of many business applications.
268
+
However, in most cases, the transactional processing isn’t the best fit for real-world processes.</p>
269
+
</div>
270
+
<divclass="paragraph">
271
+
<p>In our example, when the ride finishes, that’s a real-world situation.
272
+
However, the example uses the <code>@Transational</code> annotation, and operate on number of unrelated data.
273
+
This means that when one of those operations fails, the whole processing will be rolled back.
274
+
In effect, the end-user will receive a nasty error message.</p>
275
+
</div>
276
+
<divclass="admonitionblock note">
277
+
<table>
278
+
<tr>
279
+
<tdclass="icon">
280
+
<iclass="fa icon-note" title="Note"></i>
281
+
</td>
282
+
<tdclass="content">
283
+
<divclass="paragraph">
284
+
<p>Outages from the dependant services must not invalidate the main intent.
285
+
In fact, all the operations in this example could happen independently, and at different, yet reasonable times.</p>
286
+
</div>
287
+
</td>
249
288
</tr>
250
289
</table>
251
290
</div>
291
+
</div>
292
+
<divclass="sect3">
293
+
<h4id="_bundling_of_different_logical_domains"><aclass="anchor" href="#_bundling_of_different_logical_domains"></a><aclass="link" href="#_bundling_of_different_logical_domains">1.1.2. Bundling of different logical domains</a></h4>
294
+
<divclass="paragraph">
295
+
<p>Our example is also very chatty, and hard to understand at first glance.
296
+
In fact, this is quite common in similar applications.
297
+
The code starts small, easy to understand.
298
+
When new features are added, it keeps growing as developers cramp new instructions into methods like <code>completeTransit</code>.</p>
299
+
</div>
300
+
<divclass="paragraph">
301
+
<p>Of course, the developers could re-architect the code, to extract instructions to a separate blocks, but that is just a half-measure.
302
+
Still, the application will do all the operations, starting from <code>completeTransit</code> method in the same time, and withing the same <em>"script"</em>.</p>
0 commit comments