#590 Add new presentation for Singleton

This commit is contained in:
Ilkka Seppälä
2017-08-12 18:20:45 +03:00
parent 600553ec0f
commit 746e452c2b
5 changed files with 27 additions and 149 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,104 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<class-diagram version="1.1.8" icons="true" automaticImage="PNG" always-add-relationships="false" generalizations="true"
realizations="true" associations="true" dependencies="false" nesting-relationships="true">
<class id="1" language="java" name="com.iluwatar.singleton.InitializingOnDemandHolderIdiom.HelperHolder"
project="singleton" file="/singleton/src/main/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiom.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="88" width="133" x="328" y="457"/>
<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.singleton.IvoryTower" project="singleton"
file="/singleton/src/main/java/com/iluwatar/singleton/IvoryTower.java" binary="false" corner="BOTTOM_RIGHT">
<position height="106" width="164" x="114" y="275"/>
<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.singleton.InitializingOnDemandHolderIdiom" project="singleton"
file="/singleton/src/main/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiom.java" binary="false"
corner="BOTTOM_RIGHT">
<position height="142" width="295" x="328" y="275"/>
<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>
<enumeration id="4" language="java" name="com.iluwatar.singleton.EnumIvoryTower" project="singleton"
file="/singleton/src/main/java/com/iluwatar/singleton/EnumIvoryTower.java" binary="false" corner="BOTTOM_RIGHT">
<position height="124" width="190" x="663" y="275"/>
<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>
</enumeration>
<class id="5" language="java" name="com.iluwatar.singleton.ThreadSafeLazyLoadedIvoryTower" project="singleton"
file="/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeLazyLoadedIvoryTower.java" binary="false"
corner="BOTTOM_RIGHT">
<position height="106" width="299" x="893" y="275"/>
<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="6" language="java" name="com.iluwatar.singleton.ThreadSafeDoubleCheckLocking" project="singleton"
file="/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeDoubleCheckLocking.java" binary="false"
corner="BOTTOM_RIGHT">
<position height="106" width="292" x="1242" y="275"/>
<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="7">
<end type="SOURCE" refId="2" navigable="false">
<attribute id="8" name="instance"/>
<multiplicity id="9" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="2" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="10">
<end type="SOURCE" refId="6" navigable="false">
<attribute id="11" name="INSTANCE"/>
<multiplicity id="12" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="6" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="13">
<end type="SOURCE" refId="1" navigable="false">
<attribute id="14" name="INSTANCE"/>
<multiplicity id="15" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="3" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<nesting id="16">
<end type="SOURCE" refId="3"/>
<end type="TARGET" refId="1"/>
</nesting>
<association id="17">
<end type="SOURCE" refId="5" navigable="false">
<attribute id="18" name="instance"/>
<multiplicity id="19" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="5" 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>

View File

@ -1,43 +0,0 @@
@startuml
package com.iluwatar.singleton {
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
enum EnumIvoryTower {
+ INSTANCE {static}
+ toString() : String
+ valueOf(name : String) : EnumIvoryTower {static}
+ values() : EnumIvoryTower[] {static}
}
class InitializingOnDemandHolderIdiom {
- InitializingOnDemandHolderIdiom()
+ getInstance() : InitializingOnDemandHolderIdiom {static}
}
-class HelperHolder {
- INSTANCE : InitializingOnDemandHolderIdiom {static}
- HelperHolder()
}
class IvoryTower {
- INSTANCE : IvoryTower {static}
- IvoryTower()
+ getInstance() : IvoryTower {static}
}
class ThreadSafeDoubleCheckLocking {
- instance : ThreadSafeDoubleCheckLocking {static}
- ThreadSafeDoubleCheckLocking()
+ getInstance() : ThreadSafeDoubleCheckLocking {static}
}
class ThreadSafeLazyLoadedIvoryTower {
- instance : ThreadSafeLazyLoadedIvoryTower {static}
- ThreadSafeLazyLoadedIvoryTower()
+ getInstance() : ThreadSafeLazyLoadedIvoryTower {static}
}
}
IvoryTower --> "-INSTANCE" IvoryTower
ThreadSafeDoubleCheckLocking --> "-instance" ThreadSafeDoubleCheckLocking
ThreadSafeLazyLoadedIvoryTower --> "-instance" ThreadSafeLazyLoadedIvoryTower
HelperHolder ..+ InitializingOnDemandHolderIdiom
HelperHolder --> "-INSTANCE" InitializingOnDemandHolderIdiom
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB