diff --git a/unit-of-work/etc/unit-of-work.ucls b/unit-of-work/etc/unit-of-work.ucls deleted file mode 100644 index 15f777aad..000000000 --- a/unit-of-work/etc/unit-of-work.ucls +++ /dev/null @@ -1,48 +0,0 @@ -<?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> \ No newline at end of file diff --git a/unit-of-work/etc/unit-of-work.urm.png b/unit-of-work/etc/unit-of-work.urm.png index 46facff8d..3a7c0d377 100644 Binary files a/unit-of-work/etc/unit-of-work.urm.png and b/unit-of-work/etc/unit-of-work.urm.png differ diff --git a/unit-of-work/etc/unit-of-work.urm.puml b/unit-of-work/etc/unit-of-work.urm.puml index 329185e30..7f7920daf 100644 --- a/unit-of-work/etc/unit-of-work.urm.puml +++ b/unit-of-work/etc/unit-of-work.urm.puml @@ -1,10 +1,48 @@ @startuml package com.iluwatar.unitofwork { + interface IUnitOfWork<T> { + + DELETE : String {static} + + INSERT : String {static} + + MODIFY : String {static} + + commit() {abstract} + + registerDeleted(T) {abstract} + + registerModified(T) {abstract} + + registerNew(T) {abstract} + } class Student { - address : String - id : Integer - name : String + Student(id : Integer, name : String, address : String) + + getAddress() : String + + getId() : Integer + + getName() : String + } + class StudentDatabase { + + StudentDatabase() + + delete(student : Student) + + insert(student : Student) + + modify(student : Student) + } + class StudentManagementApp { + + StudentManagementApp() + + main(args : String[]) {static} + } + class StudentRepository { + - LOGGER : Logger {static} + - context : Map<String, List<Student>> + - studentDatabase : StudentDatabase + + StudentRepository(context : Map<String, List<Student>>, studentDatabase : StudentDatabase) + + commit() + - commitDelete() + - commitInsert() + - commitModify() + - register(student : Student, operation : String) + + registerDeleted(student : Student) + + registerModified(student : Student) + + registerNew(student : Student) } } +StudentRepository --> "-studentDatabase" StudentDatabase +StudentRepository ..|> IUnitOfWork @enduml \ No newline at end of file