Hands-On Software Architecture with C# 8 and .NET Core 3 by Francesco Abbruzzese
Author:Francesco Abbruzzese
Language: eng
Format: epub
Tags: COM051310 - COMPUTERS / Programming Languages / C#, COM051240 - COMPUTERS / Software Development and Engineering / Systems Analysis and Design, COM051440 - COMPUTERS / Software Development and Engineering / Tools
Publisher: Packt Publishing
Published: 2019-11-29T13:34:35+00:00
Before we describe these patterns, we need to understand the concept of aggregates.
Aggregates
So far, we have talked about entities as the units that are processed by a DDD-based business layer. However, several entities can be manipulated and made into single entities. An example of this is a purchase order and all of its items. In fact, it makes absolutely no sense to process a single order item independently of the order it belongs to. This happens because order-items are actually subparts of an order, not independent entities.
There is no transaction that may affect a single order-item without it affecting the order that the item is in. Imagine that two different people in the same company are trying to increase the total quantity of cement but one increases the quantity of type-1 cement (item 1) while the other increases the quantity of type-2 cement (item 2). If each item is processed as an independent entity, both quantities will be increased, which could cause an incoherent purchase order since the total quantity of cement would be increased twice.
On the other hand, if the whole order, along with all its order-items, is loaded and saved with every single transaction by both people, one of the two will overwrite the changes of the other one, so whoever makes the final change will have their requirements set. In a web application, it isn't possible to lock the purchase order for the whole time the user sees and modifies it, so an optimistic concurrency policy is used. For instance, it is enough to add a version number to each purchase order and to do the following:
Read the order without opening any transaction.
Before saving the modified order, we open a transaction and perform a second read.
If the version number of the newly retrieved order differs from the one of the order that was modified by the user, the operation is aborted because someone else modified the order that was shown to the user immediately after the first read. In this case, the user is informed of the problem and the newly retrieved order is shown to the user once more.
If the version number is unchanged, we increase the version number, proceed with the save, and commit the transaction.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12566)
Hello! Python by Anthony Briggs(9911)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9795)
The Mikado Method by Ola Ellnestam Daniel Brolund(9777)
Dependency Injection in .NET by Mark Seemann(9336)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8293)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7758)
Grails in Action by Glen Smith Peter Ledbrook(7693)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7037)
Microservices with Go by Alexander Shuiskov(6802)
Practical Design Patterns for Java Developers by Miroslav Wengner(6713)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6653)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6409)
Angular Projects - Third Edition by Aristeidis Bampakos(6062)
The Art of Crafting User Stories by The Art of Crafting User Stories(5591)
NetSuite for Consultants - Second Edition by Peter Ries(5529)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5331)
Kotlin in Action by Dmitry Jemerov(5062)
