#352- Unit Of Work : added the readme file

This commit is contained in:
Piyush Chaudhari 2017-09-19 20:39:48 +05:30
parent 2c9098aecc
commit 530b9e9662
3 changed files with 79 additions and 0 deletions

31
unit-of-work/README.md Normal file
View File

@ -0,0 +1,31 @@
---
layout: pattern
title: Unit Of Work
folder: unit-of-work
permalink: /patterns/unit-of-work/
pumlid:
categories: Architectural
tags:
- Java
- KISS
- YAGNI
- Difficulty-Beginner
---
## Intent
When a business transaction is completed all the these updates are sent as one
big unit of work to be persisted in a database in one go so as to minimize database trips.
![alt text](etc/unit-of-work.urm.png "unit-of-work")
## Applicability
Use the Unit Of Work pattern when
* The client is asking to optimize the time taken for database transactions.
* When you want to boost the performance to get database records.
* You want reduce number of database calls.
## Credits
* [Design Pattern - Unit Of Work Pattern](https://www.codeproject.com/Articles/581487/Unit-of-Work-Design-Pattern)
* [Unit Of Work](https://martinfowler.com/eaaCatalog/unitOfWork.html)

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<class-diagram version="1.2.0" icons="true" always-add-relationships="false" generalizations="true" realizations="true"
associations="true" dependencies="false" nesting-relationships="true" router="FAN">
<class id="1" language="java" name="com.iluwatar.datatransfer.CustomerClientApp" project="data-transfer-object"
file="/data-transfer-object/src/main/java/com/iluwatar/datatransfer/CustomerClientApp.java" binary="false"
corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="145" y="93"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="2" language="java" name="com.iluwatar.datatransfer.CustomerDto" project="data-transfer-object"
file="/data-transfer-object/src/main/java/com/iluwatar/datatransfer/CustomerDto.java" binary="false"
corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="386" y="329"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="3" language="java" name="com.iluwatar.datatransfer.CustomerResource" project="data-transfer-object"
file="/data-transfer-object/src/main/java/com/iluwatar/datatransfer/CustomerResource.java" binary="false"
corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="677" y="93"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<association id="4">
<end type="SOURCE" refId="3" navigable="false">
<attribute id="5" name="customers"/>
<multiplicity id="6" minimum="0" maximum="2147483647"/>
</end>
<end type="TARGET" refId="2" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</classifier-display>
<association-display labels="true" multiplicity="true"/>
</class-diagram>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB