#190 Remove urm plugin
This commit is contained in:
parent
4450000a83
commit
b0f9582824
@ -1,59 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.abstractdocument.domain {
|
|
||||||
class Car {
|
|
||||||
+ Car(properties : Map<String, Object>)
|
|
||||||
}
|
|
||||||
interface HasModel {
|
|
||||||
+ PROPERTY : String {static}
|
|
||||||
+ getModel() : Optional<String>
|
|
||||||
}
|
|
||||||
interface HasParts {
|
|
||||||
+ PROPERTY : String {static}
|
|
||||||
+ getParts() : Stream<Part>
|
|
||||||
}
|
|
||||||
interface HasPrice {
|
|
||||||
+ PROPERTY : String {static}
|
|
||||||
+ getPrice() : Optional<Number>
|
|
||||||
}
|
|
||||||
interface HasType {
|
|
||||||
+ PROPERTY : String {static}
|
|
||||||
+ getType() : Optional<String>
|
|
||||||
}
|
|
||||||
class Part {
|
|
||||||
+ Part(properties : Map<String, Object>)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.abstractdocument {
|
|
||||||
abstract class AbstractDocument {
|
|
||||||
- properties : Map<String, Object>
|
|
||||||
# AbstractDocument(properties : Map<String, Object>)
|
|
||||||
+ children(key : String, constructor : Function<Map<String, Object>, T>) : Stream<T>
|
|
||||||
+ get(key : String) : Object
|
|
||||||
+ put(key : String, value : Object)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
interface Document {
|
|
||||||
+ children(String, Function<Map<String, Object>, T>) : Stream<T> {abstract}
|
|
||||||
+ get(String) : Object {abstract}
|
|
||||||
+ put(String, Object) {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AbstractDocument ..|> Document
|
|
||||||
Car ..|> HasModel
|
|
||||||
Car ..|> HasPrice
|
|
||||||
Car ..|> HasParts
|
|
||||||
Car --|> AbstractDocument
|
|
||||||
HasModel --|> Document
|
|
||||||
HasParts --|> Document
|
|
||||||
HasPrice --|> Document
|
|
||||||
HasType --|> Document
|
|
||||||
Part ..|> HasType
|
|
||||||
Part ..|> HasModel
|
|
||||||
Part ..|> HasPrice
|
|
||||||
Part --|> AbstractDocument
|
|
||||||
@enduml
|
|
@ -1,43 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.aggregator.microservices {
|
|
||||||
class Aggregator {
|
|
||||||
- informationClient : ProductInformationClient
|
|
||||||
- inventoryClient : ProductInventoryClient
|
|
||||||
+ Aggregator()
|
|
||||||
+ getProduct() : Product
|
|
||||||
}
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Product {
|
|
||||||
- productInventories : int
|
|
||||||
- title : String
|
|
||||||
+ Product()
|
|
||||||
+ getProductInventories() : int
|
|
||||||
+ getTitle() : String
|
|
||||||
+ setProductInventories(productInventories : int)
|
|
||||||
+ setTitle(title : String)
|
|
||||||
}
|
|
||||||
interface ProductInformationClient {
|
|
||||||
+ getProductTitle() : String {abstract}
|
|
||||||
}
|
|
||||||
class ProductInformationClientImpl {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ ProductInformationClientImpl()
|
|
||||||
+ getProductTitle() : String
|
|
||||||
}
|
|
||||||
interface ProductInventoryClient {
|
|
||||||
+ getProductInventories() : int {abstract}
|
|
||||||
}
|
|
||||||
class ProductInventoryClientImpl {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ ProductInventoryClientImpl()
|
|
||||||
+ getProductInventories() : int
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Aggregator --> "-informationClient" ProductInformationClient
|
|
||||||
Aggregator --> "-inventoryClient" ProductInventoryClient
|
|
||||||
ProductInformationClientImpl ..|> ProductInformationClient
|
|
||||||
ProductInventoryClientImpl ..|> ProductInventoryClient
|
|
||||||
@enduml
|
|
@ -1,12 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.information.microservice {
|
|
||||||
class InformationApplication {
|
|
||||||
+ InformationApplication()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class InformationController {
|
|
||||||
+ InformationController()
|
|
||||||
+ getProductTitle() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,12 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.inventory.microservice {
|
|
||||||
class InventoryApplication {
|
|
||||||
+ InventoryApplication()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class InventoryController {
|
|
||||||
+ InventoryController()
|
|
||||||
+ getProductInventories() : int
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -34,27 +34,6 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>aggregator-microservices</artifactId>
|
<artifactId>aggregator-microservices</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.github.markusmo3.urm</groupId>
|
|
||||||
<artifactId>urm-maven-plugin</artifactId>
|
|
||||||
<version>${urm.version}</version>
|
|
||||||
<configuration combine.self="override">
|
|
||||||
<outputDirectory>${project.basedir}/../etc</outputDirectory>
|
|
||||||
<packages>
|
|
||||||
<param>com.iluwatar</param>
|
|
||||||
</packages>
|
|
||||||
<skipForProjects>
|
|
||||||
<!-- skip for parent project -->
|
|
||||||
<param>aggregator-microservices</param>
|
|
||||||
</skipForProjects>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>information-microservice</module>
|
<module>information-microservice</module>
|
||||||
<module>aggregator-service</module>
|
<module>aggregator-service</module>
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.api.gateway {
|
|
||||||
class ApiGateway {
|
|
||||||
- imageClient : ImageClient
|
|
||||||
- priceClient : PriceClient
|
|
||||||
+ ApiGateway()
|
|
||||||
+ getProductDesktop() : DesktopProduct
|
|
||||||
+ getProductMobile() : MobileProduct
|
|
||||||
}
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class DesktopProduct {
|
|
||||||
- imagePath : String
|
|
||||||
- price : String
|
|
||||||
+ DesktopProduct()
|
|
||||||
+ getImagePath() : String
|
|
||||||
+ getPrice() : String
|
|
||||||
+ setImagePath(imagePath : String)
|
|
||||||
+ setPrice(price : String)
|
|
||||||
}
|
|
||||||
interface ImageClient {
|
|
||||||
+ getImagePath() : String {abstract}
|
|
||||||
}
|
|
||||||
class ImageClientImpl {
|
|
||||||
+ ImageClientImpl()
|
|
||||||
+ getImagePath() : String
|
|
||||||
}
|
|
||||||
class MobileProduct {
|
|
||||||
- price : String
|
|
||||||
+ MobileProduct()
|
|
||||||
+ getPrice() : String
|
|
||||||
+ setPrice(price : String)
|
|
||||||
}
|
|
||||||
interface PriceClient {
|
|
||||||
+ getPrice() : String {abstract}
|
|
||||||
}
|
|
||||||
class PriceClientImpl {
|
|
||||||
+ PriceClientImpl()
|
|
||||||
+ getPrice() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ApiGateway --> "-imageClient" ImageClient
|
|
||||||
ApiGateway --> "-priceClient" PriceClient
|
|
||||||
ImageClientImpl ..|> ImageClient
|
|
||||||
PriceClientImpl ..|> PriceClient
|
|
||||||
@enduml
|
|
@ -1,12 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.image.microservice {
|
|
||||||
class ImageApplication {
|
|
||||||
+ ImageApplication()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class ImageController {
|
|
||||||
+ ImageController()
|
|
||||||
+ getImagePath() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,12 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.price.microservice {
|
|
||||||
class PriceApplication {
|
|
||||||
+ PriceApplication()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class PriceController {
|
|
||||||
+ PriceController()
|
|
||||||
+ getPrice() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -34,27 +34,6 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>api-gateway</artifactId>
|
<artifactId>api-gateway</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.github.markusmo3.urm</groupId>
|
|
||||||
<artifactId>urm-maven-plugin</artifactId>
|
|
||||||
<version>${urm.version}</version>
|
|
||||||
<configuration combine.self="override">
|
|
||||||
<outputDirectory>${project.basedir}/../etc</outputDirectory>
|
|
||||||
<packages>
|
|
||||||
<param>com.iluwatar</param>
|
|
||||||
</packages>
|
|
||||||
<skipForProjects>
|
|
||||||
<!-- skip for parent project -->
|
|
||||||
<param>api-gateway</param>
|
|
||||||
</skipForProjects>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>image-microservice</module>
|
<module>image-microservice</module>
|
||||||
<module>price-microservice</module>
|
<module>price-microservice</module>
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.async.method.invocation {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
- callback(name : String) : AsyncCallback<T> {static}
|
|
||||||
- lazyval(value : T, delayMillis : long) : Callable<T> {static}
|
|
||||||
- log(msg : String) {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
interface AsyncCallback<T> {
|
|
||||||
+ onComplete(T, Optional<Exception>) {abstract}
|
|
||||||
}
|
|
||||||
interface AsyncExecutor {
|
|
||||||
+ endProcess(AsyncResult<T>) : T {abstract}
|
|
||||||
+ startProcess(Callable<T>) : AsyncResult<T> {abstract}
|
|
||||||
+ startProcess(Callable<T>, AsyncCallback<T>) : AsyncResult<T> {abstract}
|
|
||||||
}
|
|
||||||
interface AsyncResult<T> {
|
|
||||||
+ await() {abstract}
|
|
||||||
+ getValue() : T {abstract}
|
|
||||||
+ isCompleted() : boolean {abstract}
|
|
||||||
}
|
|
||||||
class ThreadAsyncExecutor {
|
|
||||||
- idx : AtomicInteger
|
|
||||||
+ ThreadAsyncExecutor()
|
|
||||||
+ endProcess(asyncResult : AsyncResult<T>) : T
|
|
||||||
+ startProcess(task : Callable<T>) : AsyncResult<T>
|
|
||||||
+ startProcess(task : Callable<T>, callback : AsyncCallback<T>) : AsyncResult<T>
|
|
||||||
}
|
|
||||||
-class CompletableResult<T> {
|
|
||||||
~ COMPLETED : int {static}
|
|
||||||
~ FAILED : int {static}
|
|
||||||
~ RUNNING : int {static}
|
|
||||||
~ callback : Optional<AsyncCallback<T>>
|
|
||||||
~ exception : Exception
|
|
||||||
~ lock : Object
|
|
||||||
~ state : int
|
|
||||||
~ value : T
|
|
||||||
~ CompletableResult<T>(callback : AsyncCallback<T>)
|
|
||||||
+ await()
|
|
||||||
+ getValue() : T
|
|
||||||
+ isCompleted() : boolean
|
|
||||||
~ setException(exception : Exception)
|
|
||||||
~ setValue(value : T)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CompletableResult ..+ ThreadAsyncExecutor
|
|
||||||
ThreadAsyncExecutor ..|> AsyncExecutor
|
|
||||||
CompletableResult ..|> AsyncResult
|
|
||||||
@enduml
|
|
@ -1,24 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.balking {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class WashingMachine {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- washingMachineState : WashingMachineState
|
|
||||||
+ WashingMachine()
|
|
||||||
+ endOfWashing()
|
|
||||||
+ getWashingMachineState() : WashingMachineState
|
|
||||||
+ wash()
|
|
||||||
}
|
|
||||||
enum WashingMachineState {
|
|
||||||
+ ENABLED {static}
|
|
||||||
+ WASHING {static}
|
|
||||||
+ valueOf(name : String) : WashingMachineState {static}
|
|
||||||
+ values() : WashingMachineState[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
WashingMachine --> "-washingMachineState" WashingMachineState
|
|
||||||
@enduml
|
|
@ -1,57 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.business.delegate {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class BusinessDelegate {
|
|
||||||
- businessService : BusinessService
|
|
||||||
- lookupService : BusinessLookup
|
|
||||||
- serviceType : ServiceType
|
|
||||||
+ BusinessDelegate()
|
|
||||||
+ doTask()
|
|
||||||
+ setLookupService(businessLookup : BusinessLookup)
|
|
||||||
+ setServiceType(serviceType : ServiceType)
|
|
||||||
}
|
|
||||||
class BusinessLookup {
|
|
||||||
- ejbService : EjbService
|
|
||||||
- jmsService : JmsService
|
|
||||||
+ BusinessLookup()
|
|
||||||
+ getBusinessService(serviceType : ServiceType) : BusinessService
|
|
||||||
+ setEjbService(ejbService : EjbService)
|
|
||||||
+ setJmsService(jmsService : JmsService)
|
|
||||||
}
|
|
||||||
interface BusinessService {
|
|
||||||
+ doProcessing() {abstract}
|
|
||||||
}
|
|
||||||
class Client {
|
|
||||||
- businessDelegate : BusinessDelegate
|
|
||||||
+ Client(businessDelegate : BusinessDelegate)
|
|
||||||
+ doTask()
|
|
||||||
}
|
|
||||||
class EjbService {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ EjbService()
|
|
||||||
+ doProcessing()
|
|
||||||
}
|
|
||||||
class JmsService {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ JmsService()
|
|
||||||
+ doProcessing()
|
|
||||||
}
|
|
||||||
enum ServiceType {
|
|
||||||
+ EJB {static}
|
|
||||||
+ JMS {static}
|
|
||||||
+ valueOf(name : String) : ServiceType {static}
|
|
||||||
+ values() : ServiceType[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BusinessLookup --> "-ejbService" EjbService
|
|
||||||
BusinessDelegate --> "-serviceType" ServiceType
|
|
||||||
Client --> "-businessDelegate" BusinessDelegate
|
|
||||||
BusinessDelegate --> "-businessService" BusinessService
|
|
||||||
BusinessDelegate --> "-lookupService" BusinessLookup
|
|
||||||
BusinessLookup --> "-jmsService" JmsService
|
|
||||||
EjbService ..|> BusinessService
|
|
||||||
JmsService ..|> BusinessService
|
|
||||||
@enduml
|
|
@ -1,110 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.caching {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
+ useCacheAsideStategy()
|
|
||||||
+ useReadAndWriteThroughStrategy()
|
|
||||||
+ useReadThroughAndWriteAroundStrategy()
|
|
||||||
+ useReadThroughAndWriteBehindStrategy()
|
|
||||||
}
|
|
||||||
class AppManager {
|
|
||||||
- cachingPolicy : CachingPolicy {static}
|
|
||||||
- AppManager()
|
|
||||||
+ find(userId : String) : UserAccount {static}
|
|
||||||
- findAside(userId : String) : UserAccount {static}
|
|
||||||
+ initCacheCapacity(capacity : int) {static}
|
|
||||||
+ initCachingPolicy(policy : CachingPolicy) {static}
|
|
||||||
+ initDb(useMongoDb : boolean) {static}
|
|
||||||
+ printCacheContent() : String {static}
|
|
||||||
+ save(userAccount : UserAccount) {static}
|
|
||||||
- saveAside(userAccount : UserAccount) {static}
|
|
||||||
}
|
|
||||||
class CacheStore {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
~ cache : LruCache {static}
|
|
||||||
- CacheStore()
|
|
||||||
+ clearCache() {static}
|
|
||||||
+ flushCache() {static}
|
|
||||||
+ get(userId : String) : UserAccount {static}
|
|
||||||
+ initCapacity(capacity : int) {static}
|
|
||||||
+ invalidate(userId : String) {static}
|
|
||||||
+ print() : String {static}
|
|
||||||
+ readThrough(userId : String) : UserAccount {static}
|
|
||||||
+ readThroughWithWriteBackPolicy(userId : String) : UserAccount {static}
|
|
||||||
+ set(userId : String, userAccount : UserAccount) {static}
|
|
||||||
+ writeAround(userAccount : UserAccount) {static}
|
|
||||||
+ writeBehind(userAccount : UserAccount) {static}
|
|
||||||
+ writeThrough(userAccount : UserAccount) {static}
|
|
||||||
}
|
|
||||||
enum CachingPolicy {
|
|
||||||
+ AROUND {static}
|
|
||||||
+ ASIDE {static}
|
|
||||||
+ BEHIND {static}
|
|
||||||
+ THROUGH {static}
|
|
||||||
- policy : String
|
|
||||||
+ getPolicy() : String
|
|
||||||
+ valueOf(name : String) : CachingPolicy {static}
|
|
||||||
+ values() : CachingPolicy[] {static}
|
|
||||||
}
|
|
||||||
class DbManager {
|
|
||||||
- db : MongoDatabase {static}
|
|
||||||
- mongoClient : MongoClient {static}
|
|
||||||
- useMongoDB : boolean {static}
|
|
||||||
- virtualDB : Map<String, UserAccount> {static}
|
|
||||||
- DbManager()
|
|
||||||
+ connect() {static}
|
|
||||||
+ createVirtualDb() {static}
|
|
||||||
+ readFromDb(userId : String) : UserAccount {static}
|
|
||||||
+ updateDb(userAccount : UserAccount) {static}
|
|
||||||
+ upsertDb(userAccount : UserAccount) {static}
|
|
||||||
+ writeToDb(userAccount : UserAccount) {static}
|
|
||||||
}
|
|
||||||
class LruCache {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
~ cache : Map<String, Node>
|
|
||||||
~ capacity : int
|
|
||||||
~ end : Node
|
|
||||||
~ head : Node
|
|
||||||
+ LruCache(capacity : int)
|
|
||||||
+ clear()
|
|
||||||
+ contains(userId : String) : boolean
|
|
||||||
+ get(userId : String) : UserAccount
|
|
||||||
+ getCacheDataInListForm() : List<UserAccount>
|
|
||||||
+ getLruData() : UserAccount
|
|
||||||
+ invalidate(userId : String)
|
|
||||||
+ isFull() : boolean
|
|
||||||
+ remove(node : Node)
|
|
||||||
+ set(userId : String, userAccount : UserAccount)
|
|
||||||
+ setCapacity(newCapacity : int)
|
|
||||||
+ setHead(node : Node)
|
|
||||||
}
|
|
||||||
~class Node {
|
|
||||||
~ next : Node
|
|
||||||
~ previous : Node
|
|
||||||
~ userAccount : UserAccount
|
|
||||||
~ userId : String
|
|
||||||
+ Node(this$0 : String, userId : UserAccount)
|
|
||||||
}
|
|
||||||
class UserAccount {
|
|
||||||
- additionalInfo : String
|
|
||||||
- userId : String
|
|
||||||
- userName : String
|
|
||||||
+ UserAccount(userId : String, userName : String, additionalInfo : String)
|
|
||||||
+ getAdditionalInfo() : String
|
|
||||||
+ getUserId() : String
|
|
||||||
+ getUserName() : String
|
|
||||||
+ setAdditionalInfo(additionalInfo : String)
|
|
||||||
+ setUserId(userId : String)
|
|
||||||
+ setUserName(userName : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LruCache --> "-head" Node
|
|
||||||
Node --+ LruCache
|
|
||||||
Node --> "-previous" Node
|
|
||||||
AppManager --> "-cachingPolicy" CachingPolicy
|
|
||||||
Node --> "-userAccount" UserAccount
|
|
||||||
CacheStore --> "-cache" LruCache
|
|
||||||
@enduml
|
|
@ -1,28 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.callback {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
interface Callback {
|
|
||||||
+ call() {abstract}
|
|
||||||
}
|
|
||||||
class LambdasApp {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ LambdasApp()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class SimpleTask {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ SimpleTask()
|
|
||||||
+ execute()
|
|
||||||
}
|
|
||||||
abstract class Task {
|
|
||||||
+ Task()
|
|
||||||
+ execute() {abstract}
|
|
||||||
+ executeWith(callback : Callback)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SimpleTask --|> Task
|
|
||||||
@enduml
|
|
@ -1,86 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.command {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
abstract class Command {
|
|
||||||
+ Command()
|
|
||||||
+ execute(Target) {abstract}
|
|
||||||
+ redo() {abstract}
|
|
||||||
+ toString() : String {abstract}
|
|
||||||
+ undo() {abstract}
|
|
||||||
}
|
|
||||||
class Goblin {
|
|
||||||
+ Goblin()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class InvisibilitySpell {
|
|
||||||
- target : Target
|
|
||||||
+ InvisibilitySpell()
|
|
||||||
+ execute(target : Target)
|
|
||||||
+ redo()
|
|
||||||
+ toString() : String
|
|
||||||
+ undo()
|
|
||||||
}
|
|
||||||
class ShrinkSpell {
|
|
||||||
- oldSize : Size
|
|
||||||
- target : Target
|
|
||||||
+ ShrinkSpell()
|
|
||||||
+ execute(target : Target)
|
|
||||||
+ redo()
|
|
||||||
+ toString() : String
|
|
||||||
+ undo()
|
|
||||||
}
|
|
||||||
enum Size {
|
|
||||||
+ LARGE {static}
|
|
||||||
+ NORMAL {static}
|
|
||||||
+ SMALL {static}
|
|
||||||
+ UNDEFINED {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Size {static}
|
|
||||||
+ values() : Size[] {static}
|
|
||||||
}
|
|
||||||
abstract class Target {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- size : Size
|
|
||||||
- visibility : Visibility
|
|
||||||
+ Target()
|
|
||||||
+ getSize() : Size
|
|
||||||
+ getVisibility() : Visibility
|
|
||||||
+ printStatus()
|
|
||||||
+ setSize(size : Size)
|
|
||||||
+ setVisibility(visibility : Visibility)
|
|
||||||
+ toString() : String {abstract}
|
|
||||||
}
|
|
||||||
enum Visibility {
|
|
||||||
+ INVISIBLE {static}
|
|
||||||
+ UNDEFINED {static}
|
|
||||||
+ VISIBLE {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Visibility {static}
|
|
||||||
+ values() : Visibility[] {static}
|
|
||||||
}
|
|
||||||
class Wizard {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- redoStack : Deque<Command>
|
|
||||||
- undoStack : Deque<Command>
|
|
||||||
+ Wizard()
|
|
||||||
+ castSpell(command : Command, target : Target)
|
|
||||||
+ redoLastSpell()
|
|
||||||
+ toString() : String
|
|
||||||
+ undoLastSpell()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Target --> "-size" Size
|
|
||||||
Wizard --> "-undoStack" Command
|
|
||||||
ShrinkSpell --> "-oldSize" Size
|
|
||||||
InvisibilitySpell --> "-target" Target
|
|
||||||
ShrinkSpell --> "-target" Target
|
|
||||||
Target --> "-visibility" Visibility
|
|
||||||
Goblin --|> Target
|
|
||||||
InvisibilitySpell --|> Command
|
|
||||||
ShrinkSpell --|> Command
|
|
||||||
@enduml
|
|
@ -1,49 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.converter {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Converter<T, U> {
|
|
||||||
- fromDto : Function<T, U>
|
|
||||||
- fromEntity : Function<U, T>
|
|
||||||
+ Converter<T, U>(fromDto : Function<T, U>, fromEntity : Function<U, T>)
|
|
||||||
+ convertFromDto(userDto : T) : U
|
|
||||||
+ convertFromEntity(user : U) : T
|
|
||||||
+ createFromDtos(dtoUsers : Collection<T>) : List<U>
|
|
||||||
+ createFromEntities(users : Collection<U>) : List<T>
|
|
||||||
}
|
|
||||||
class User {
|
|
||||||
- firstName : String
|
|
||||||
- isActive : boolean
|
|
||||||
- lastName : String
|
|
||||||
- userId : String
|
|
||||||
+ User(firstName : String, lastName : String, isActive : boolean, userId : String)
|
|
||||||
+ equals(o : Object) : boolean
|
|
||||||
+ getFirstName() : String
|
|
||||||
+ getLastName() : String
|
|
||||||
+ getUserId() : String
|
|
||||||
+ hashCode() : int
|
|
||||||
+ isActive() : boolean
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class UserConverter {
|
|
||||||
+ UserConverter()
|
|
||||||
}
|
|
||||||
class UserDto {
|
|
||||||
- email : String
|
|
||||||
- firstName : String
|
|
||||||
- isActive : boolean
|
|
||||||
- lastName : String
|
|
||||||
+ UserDto(firstName : String, lastName : String, isActive : boolean, email : String)
|
|
||||||
+ equals(o : Object) : boolean
|
|
||||||
+ getEmail() : String
|
|
||||||
+ getFirstName() : String
|
|
||||||
+ getLastName() : String
|
|
||||||
+ hashCode() : int
|
|
||||||
+ isActive() : boolean
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UserConverter --|> Converter
|
|
||||||
@enduml
|
|
@ -1,124 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.cqrs.util {
|
|
||||||
class HibernateUtil {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- SESSIONFACTORY : SessionFactory {static}
|
|
||||||
+ HibernateUtil()
|
|
||||||
- buildSessionFactory() : SessionFactory {static}
|
|
||||||
+ getSessionFactory() : SessionFactory {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.cqrs.app {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.cqrs.dto {
|
|
||||||
class Author {
|
|
||||||
- email : String
|
|
||||||
- name : String
|
|
||||||
- username : String
|
|
||||||
+ Author()
|
|
||||||
+ Author(name : String, email : String, username : String)
|
|
||||||
+ equals(obj : Object) : boolean
|
|
||||||
+ getEmail() : String
|
|
||||||
+ getName() : String
|
|
||||||
+ getUsername() : String
|
|
||||||
+ hashCode() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class Book {
|
|
||||||
- price : double
|
|
||||||
- title : String
|
|
||||||
+ Book()
|
|
||||||
+ Book(title : String, price : double)
|
|
||||||
+ equals(obj : Object) : boolean
|
|
||||||
+ getPrice() : double
|
|
||||||
+ getTitle() : String
|
|
||||||
+ hashCode() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.cqrs.commandes {
|
|
||||||
class CommandServiceImpl {
|
|
||||||
- sessionFactory : SessionFactory
|
|
||||||
+ CommandServiceImpl()
|
|
||||||
+ authorCreated(username : String, name : String, email : String)
|
|
||||||
+ authorEmailUpdated(username : String, email : String)
|
|
||||||
+ authorNameUpdated(username : String, name : String)
|
|
||||||
+ authorUsernameUpdated(oldUsername : String, newUsername : String)
|
|
||||||
+ bookAddedToAuthor(title : String, price : double, username : String)
|
|
||||||
+ bookPriceUpdated(title : String, price : double)
|
|
||||||
+ bookTitleUpdated(oldTitle : String, newTitle : String)
|
|
||||||
- getAuthorByUsername(username : String) : Author
|
|
||||||
- getBookByTitle(title : String) : Book
|
|
||||||
}
|
|
||||||
interface ICommandService {
|
|
||||||
+ authorCreated(String, String, String) {abstract}
|
|
||||||
+ authorEmailUpdated(String, String) {abstract}
|
|
||||||
+ authorNameUpdated(String, String) {abstract}
|
|
||||||
+ authorUsernameUpdated(String, String) {abstract}
|
|
||||||
+ bookAddedToAuthor(String, double, String) {abstract}
|
|
||||||
+ bookPriceUpdated(String, double) {abstract}
|
|
||||||
+ bookTitleUpdated(String, String) {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.cqrs.queries {
|
|
||||||
interface IQueryService {
|
|
||||||
+ getAuthorBooks(String) : List<Book> {abstract}
|
|
||||||
+ getAuthorBooksCount(String) : BigInteger {abstract}
|
|
||||||
+ getAuthorByUsername(String) : Author {abstract}
|
|
||||||
+ getAuthorsCount() : BigInteger {abstract}
|
|
||||||
+ getBook(String) : Book {abstract}
|
|
||||||
}
|
|
||||||
class QueryServiceImpl {
|
|
||||||
- sessionFactory : SessionFactory
|
|
||||||
+ QueryServiceImpl()
|
|
||||||
+ getAuthorBooks(username : String) : List<Book>
|
|
||||||
+ getAuthorBooksCount(username : String) : BigInteger
|
|
||||||
+ getAuthorByUsername(username : String) : Author
|
|
||||||
+ getAuthorsCount() : BigInteger
|
|
||||||
+ getBook(title : String) : Book
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.cqrs.domain.model {
|
|
||||||
class Author {
|
|
||||||
- email : String
|
|
||||||
- id : long
|
|
||||||
- name : String
|
|
||||||
- username : String
|
|
||||||
# Author()
|
|
||||||
+ Author(username : String, name : String, email : String)
|
|
||||||
+ getEmail() : String
|
|
||||||
+ getId() : long
|
|
||||||
+ getName() : String
|
|
||||||
+ getUsername() : String
|
|
||||||
+ setEmail(email : String)
|
|
||||||
+ setId(id : long)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ setUsername(username : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class Book {
|
|
||||||
- author : Author
|
|
||||||
- id : long
|
|
||||||
- price : double
|
|
||||||
- title : String
|
|
||||||
# Book()
|
|
||||||
+ Book(title : String, price : double, author : Author)
|
|
||||||
+ getAuthor() : Author
|
|
||||||
+ getId() : long
|
|
||||||
+ getPrice() : double
|
|
||||||
+ getTitle() : String
|
|
||||||
+ setAuthor(author : Author)
|
|
||||||
+ setId(id : long)
|
|
||||||
+ setPrice(price : double)
|
|
||||||
+ setTitle(title : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Book --> "-author" Author
|
|
||||||
CommandServiceImpl ..|> ICommandService
|
|
||||||
QueryServiceImpl ..|> IQueryService
|
|
||||||
@enduml
|
|
@ -1,66 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.dao {
|
|
||||||
class App {
|
|
||||||
- DB_URL : String {static}
|
|
||||||
- log : Logger {static}
|
|
||||||
+ App()
|
|
||||||
- addCustomers(customerDao : CustomerDao) {static}
|
|
||||||
- createDataSource() : DataSource {static}
|
|
||||||
- createSchema(dataSource : DataSource) {static}
|
|
||||||
- deleteSchema(dataSource : DataSource) {static}
|
|
||||||
+ generateSampleCustomers() : List<Customer> {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- performOperationsUsing(customerDao : CustomerDao) {static}
|
|
||||||
}
|
|
||||||
class Customer {
|
|
||||||
- firstName : String
|
|
||||||
- id : int
|
|
||||||
- lastName : String
|
|
||||||
+ Customer(id : int, firstName : String, lastName : String)
|
|
||||||
+ equals(that : Object) : boolean
|
|
||||||
+ getFirstName() : String
|
|
||||||
+ getId() : int
|
|
||||||
+ getLastName() : String
|
|
||||||
+ hashCode() : int
|
|
||||||
+ setFirstName(firstName : String)
|
|
||||||
+ setId(id : int)
|
|
||||||
+ setLastName(lastName : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface CustomerDao {
|
|
||||||
+ add(Customer) : boolean {abstract}
|
|
||||||
+ delete(Customer) : boolean {abstract}
|
|
||||||
+ getAll() : Stream<Customer> {abstract}
|
|
||||||
+ getById(int) : Optional<Customer> {abstract}
|
|
||||||
+ update(Customer) : boolean {abstract}
|
|
||||||
}
|
|
||||||
class CustomerSchemaSql {
|
|
||||||
+ CREATE_SCHEMA_SQL : String {static}
|
|
||||||
+ DELETE_SCHEMA_SQL : String {static}
|
|
||||||
- CustomerSchemaSql()
|
|
||||||
}
|
|
||||||
class DbCustomerDao {
|
|
||||||
- dataSource : DataSource
|
|
||||||
+ DbCustomerDao(dataSource : DataSource)
|
|
||||||
+ add(customer : Customer) : boolean
|
|
||||||
- createCustomer(resultSet : ResultSet) : Customer
|
|
||||||
+ delete(customer : Customer) : boolean
|
|
||||||
+ getAll() : Stream<Customer>
|
|
||||||
+ getById(id : int) : Optional<Customer>
|
|
||||||
- getConnection() : Connection
|
|
||||||
- mutedClose(connection : Connection)
|
|
||||||
+ update(customer : Customer) : boolean
|
|
||||||
}
|
|
||||||
class InMemoryCustomerDao {
|
|
||||||
- idToCustomer : Map<Integer, Customer>
|
|
||||||
+ InMemoryCustomerDao()
|
|
||||||
+ add(customer : Customer) : boolean
|
|
||||||
+ delete(customer : Customer) : boolean
|
|
||||||
+ getAll() : Stream<Customer>
|
|
||||||
+ getById(id : int) : Optional<Customer>
|
|
||||||
+ update(customer : Customer) : boolean
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DbCustomerDao ..|> CustomerDao
|
|
||||||
InMemoryCustomerDao ..|> CustomerDao
|
|
||||||
@enduml
|
|
@ -1,77 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.databus {
|
|
||||||
class AbstractDataType {
|
|
||||||
- dataBus : DataBus
|
|
||||||
+ AbstractDataType()
|
|
||||||
+ getDataBus() : DataBus
|
|
||||||
+ setDataBus(dataBus : DataBus)
|
|
||||||
}
|
|
||||||
~class App {
|
|
||||||
- log : Logger {static}
|
|
||||||
~ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class DataBus {
|
|
||||||
- INSTANCE : DataBus {static}
|
|
||||||
- listeners : Set<Member>
|
|
||||||
+ DataBus()
|
|
||||||
+ getInstance() : DataBus {static}
|
|
||||||
+ publish(event : DataType)
|
|
||||||
+ subscribe(member : Member)
|
|
||||||
+ unsubscribe(member : Member)
|
|
||||||
}
|
|
||||||
interface DataType {
|
|
||||||
+ getDataBus() : DataBus {abstract}
|
|
||||||
+ setDataBus(DataBus) {abstract}
|
|
||||||
}
|
|
||||||
interface Member {
|
|
||||||
+ accept(DataType) {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.databus.data {
|
|
||||||
class MessageData {
|
|
||||||
- message : String
|
|
||||||
+ MessageData(message : String)
|
|
||||||
+ getMessage() : String
|
|
||||||
+ of(message : String) : DataType {static}
|
|
||||||
}
|
|
||||||
class StartingData {
|
|
||||||
- when : LocalDateTime
|
|
||||||
+ StartingData(when : LocalDateTime)
|
|
||||||
+ getWhen() : LocalDateTime
|
|
||||||
+ of(when : LocalDateTime) : DataType {static}
|
|
||||||
}
|
|
||||||
class StoppingData {
|
|
||||||
- when : LocalDateTime
|
|
||||||
+ StoppingData(when : LocalDateTime)
|
|
||||||
+ getWhen() : LocalDateTime
|
|
||||||
+ of(when : LocalDateTime) : DataType {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.databus.members {
|
|
||||||
class CounterMember {
|
|
||||||
- log : Logger {static}
|
|
||||||
- name : String
|
|
||||||
+ CounterMember(name : String)
|
|
||||||
+ accept(data : DataType)
|
|
||||||
- handleEvent(data : MessageData)
|
|
||||||
}
|
|
||||||
class StatusMember {
|
|
||||||
- id : int
|
|
||||||
- log : Logger {static}
|
|
||||||
+ StatusMember(id : int)
|
|
||||||
+ accept(data : DataType)
|
|
||||||
- handleEvent(data : StartingData)
|
|
||||||
- handleEvent(data : StoppingData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AbstractDataType --> "-dataBus" DataBus
|
|
||||||
DataBus --> "-INSTANCE" DataBus
|
|
||||||
DataBus --> "-listeners" Member
|
|
||||||
AbstractDataType ..|> DataType
|
|
||||||
MessageData --|> AbstractDataType
|
|
||||||
StartingData --|> AbstractDataType
|
|
||||||
StoppingData --|> AbstractDataType
|
|
||||||
CounterMember ..|> Member
|
|
||||||
StatusMember ..|> Member
|
|
||||||
@enduml
|
|
@ -1,42 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.datamapper {
|
|
||||||
class App {
|
|
||||||
- log : Logger {static}
|
|
||||||
- App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Student {
|
|
||||||
- grade : char
|
|
||||||
- name : String
|
|
||||||
- serialVersionUID : long {static}
|
|
||||||
- studentId : int
|
|
||||||
+ Student(studentId : int, name : String, grade : char)
|
|
||||||
+ equals(inputObject : Object) : boolean
|
|
||||||
+ getGrade() : char
|
|
||||||
+ getName() : String
|
|
||||||
+ getStudentId() : int
|
|
||||||
+ hashCode() : int
|
|
||||||
+ setGrade(grade : char)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ setStudentId(studentId : int)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface StudentDataMapper {
|
|
||||||
+ delete(Student) {abstract}
|
|
||||||
+ find(int) : Optional<Student> {abstract}
|
|
||||||
+ insert(Student) {abstract}
|
|
||||||
+ update(Student) {abstract}
|
|
||||||
}
|
|
||||||
class StudentDataMapperImpl {
|
|
||||||
- students : List<Student>
|
|
||||||
+ StudentDataMapperImpl()
|
|
||||||
+ delete(studentToBeDeleted : Student)
|
|
||||||
+ find(studentId : int) : Optional<Student>
|
|
||||||
+ getStudents() : List<Student>
|
|
||||||
+ insert(studentToBeInserted : Student)
|
|
||||||
+ update(studentToBeUpdated : Student)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
StudentDataMapperImpl --> "-students" Student
|
|
||||||
StudentDataMapperImpl ..|> StudentDataMapper
|
|
||||||
@enduml
|
|
@ -1,26 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.datatransfer {
|
|
||||||
class CustomerClientApp {
|
|
||||||
+ CustomerClientApp()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- printCustomerDetails(allCustomers : List<CustomerDto>) {static}
|
|
||||||
}
|
|
||||||
class CustomerDto {
|
|
||||||
- firstName : String
|
|
||||||
- id : String
|
|
||||||
- lastName : String
|
|
||||||
+ CustomerDto(id : String, firstName : String, lastName : String)
|
|
||||||
+ getFirstName() : String
|
|
||||||
+ getId() : String
|
|
||||||
+ getLastName() : String
|
|
||||||
}
|
|
||||||
class CustomerResource {
|
|
||||||
- customers : List<CustomerDto>
|
|
||||||
+ CustomerResource(customers : List<CustomerDto>)
|
|
||||||
+ delete(customerId : String)
|
|
||||||
+ getAllCustomers() : List<CustomerDto>
|
|
||||||
+ save(customer : CustomerDto)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CustomerResource --> "-customers" CustomerDto
|
|
||||||
@enduml
|
|
@ -1,39 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.delegation.simple.printers {
|
|
||||||
class CanonPrinter {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ CanonPrinter()
|
|
||||||
+ print(message : String)
|
|
||||||
}
|
|
||||||
class EpsonPrinter {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ EpsonPrinter()
|
|
||||||
+ print(message : String)
|
|
||||||
}
|
|
||||||
class HpPrinter {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ HpPrinter()
|
|
||||||
+ print(message : String)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.delegation.simple {
|
|
||||||
class App {
|
|
||||||
+ MESSAGE_TO_PRINT : String {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
interface Printer {
|
|
||||||
+ print(String) {abstract}
|
|
||||||
}
|
|
||||||
class PrinterController {
|
|
||||||
- printer : Printer
|
|
||||||
+ PrinterController(printer : Printer)
|
|
||||||
+ print(message : String)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PrinterController --> "-printer" Printer
|
|
||||||
PrinterController ..|> Printer
|
|
||||||
CanonPrinter ..|> Printer
|
|
||||||
EpsonPrinter ..|> Printer
|
|
||||||
HpPrinter ..|> Printer
|
|
||||||
@enduml
|
|
@ -1,49 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.dependency.injection {
|
|
||||||
class AdvancedWizard {
|
|
||||||
- tobacco : Tobacco
|
|
||||||
+ AdvancedWizard(tobacco : Tobacco)
|
|
||||||
+ smoke()
|
|
||||||
}
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class GuiceWizard {
|
|
||||||
- tobacco : Tobacco
|
|
||||||
+ GuiceWizard(tobacco : Tobacco)
|
|
||||||
+ smoke()
|
|
||||||
}
|
|
||||||
class OldTobyTobacco {
|
|
||||||
+ OldTobyTobacco()
|
|
||||||
}
|
|
||||||
class RivendellTobacco {
|
|
||||||
+ RivendellTobacco()
|
|
||||||
}
|
|
||||||
class SecondBreakfastTobacco {
|
|
||||||
+ SecondBreakfastTobacco()
|
|
||||||
}
|
|
||||||
class SimpleWizard {
|
|
||||||
- tobacco : OldTobyTobacco
|
|
||||||
+ SimpleWizard()
|
|
||||||
+ smoke()
|
|
||||||
}
|
|
||||||
abstract class Tobacco {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ Tobacco()
|
|
||||||
+ smoke(wizard : Wizard)
|
|
||||||
}
|
|
||||||
interface Wizard {
|
|
||||||
+ smoke() {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SimpleWizard --> "-tobacco" OldTobyTobacco
|
|
||||||
AdvancedWizard --> "-tobacco" Tobacco
|
|
||||||
GuiceWizard --> "-tobacco" Tobacco
|
|
||||||
AdvancedWizard ..|> Wizard
|
|
||||||
GuiceWizard ..|> Wizard
|
|
||||||
OldTobyTobacco --|> Tobacco
|
|
||||||
RivendellTobacco --|> Tobacco
|
|
||||||
SecondBreakfastTobacco --|> Tobacco
|
|
||||||
SimpleWizard ..|> Wizard
|
|
||||||
@enduml
|
|
@ -1,22 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.doublechecked.locking {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Inventory {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- inventorySize : int
|
|
||||||
- items : List<Item>
|
|
||||||
- lock : Lock
|
|
||||||
+ Inventory(inventorySize : int)
|
|
||||||
+ addItem(item : Item) : boolean
|
|
||||||
+ getItems() : List<Item>
|
|
||||||
}
|
|
||||||
class Item {
|
|
||||||
+ Item()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Inventory --> "-items" Item
|
|
||||||
@enduml
|
|
@ -1,68 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.doubledispatch {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class FlamingAsteroid {
|
|
||||||
+ FlamingAsteroid(left : int, top : int, right : int, bottom : int)
|
|
||||||
+ collision(gameObject : GameObject)
|
|
||||||
}
|
|
||||||
abstract class GameObject {
|
|
||||||
- damaged : boolean
|
|
||||||
- onFire : boolean
|
|
||||||
+ GameObject(left : int, top : int, right : int, bottom : int)
|
|
||||||
+ collision(GameObject) {abstract}
|
|
||||||
+ collisionResolve(FlamingAsteroid) {abstract}
|
|
||||||
+ collisionResolve(Meteoroid) {abstract}
|
|
||||||
+ collisionResolve(SpaceStationIss) {abstract}
|
|
||||||
+ collisionResolve(SpaceStationMir) {abstract}
|
|
||||||
+ isDamaged() : boolean
|
|
||||||
+ isOnFire() : boolean
|
|
||||||
+ setDamaged(damaged : boolean)
|
|
||||||
+ setOnFire(onFire : boolean)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class Meteoroid {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ Meteoroid(left : int, top : int, right : int, bottom : int)
|
|
||||||
+ collision(gameObject : GameObject)
|
|
||||||
+ collisionResolve(asteroid : FlamingAsteroid)
|
|
||||||
+ collisionResolve(iss : SpaceStationIss)
|
|
||||||
+ collisionResolve(meteoroid : Meteoroid)
|
|
||||||
+ collisionResolve(mir : SpaceStationMir)
|
|
||||||
}
|
|
||||||
class Rectangle {
|
|
||||||
- bottom : int
|
|
||||||
- left : int
|
|
||||||
- right : int
|
|
||||||
- top : int
|
|
||||||
+ Rectangle(left : int, top : int, right : int, bottom : int)
|
|
||||||
+ getBottom() : int
|
|
||||||
+ getLeft() : int
|
|
||||||
+ getRight() : int
|
|
||||||
+ getTop() : int
|
|
||||||
~ intersectsWith(r : Rectangle) : boolean
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class SpaceStationIss {
|
|
||||||
+ SpaceStationIss(left : int, top : int, right : int, bottom : int)
|
|
||||||
+ collision(gameObject : GameObject)
|
|
||||||
}
|
|
||||||
class SpaceStationMir {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ SpaceStationMir(left : int, top : int, right : int, bottom : int)
|
|
||||||
+ collision(gameObject : GameObject)
|
|
||||||
+ collisionResolve(asteroid : FlamingAsteroid)
|
|
||||||
+ collisionResolve(iss : SpaceStationIss)
|
|
||||||
+ collisionResolve(meteoroid : Meteoroid)
|
|
||||||
+ collisionResolve(mir : SpaceStationMir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FlamingAsteroid --|> Meteoroid
|
|
||||||
GameObject --|> Rectangle
|
|
||||||
Meteoroid --|> GameObject
|
|
||||||
SpaceStationIss --|> SpaceStationMir
|
|
||||||
SpaceStationMir --|> GameObject
|
|
||||||
@enduml
|
|
@ -1,14 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.eip.aggregator {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.eip.aggregator.routes {
|
|
||||||
class MessageAggregationStrategy {
|
|
||||||
+ MessageAggregationStrategy()
|
|
||||||
+ aggregate(oldExchange : Exchange, newExchange : Exchange) : Exchange
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,8 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.eip.splitter {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,8 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.eip.wiretap {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,74 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.event.aggregator {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
enum Event {
|
|
||||||
+ STARK_SIGHTED {static}
|
|
||||||
+ TRAITOR_DETECTED {static}
|
|
||||||
+ WARSHIPS_APPROACHING {static}
|
|
||||||
- description : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Event {static}
|
|
||||||
+ values() : Event[] {static}
|
|
||||||
}
|
|
||||||
abstract class EventEmitter {
|
|
||||||
- observers : List<EventObserver>
|
|
||||||
+ EventEmitter()
|
|
||||||
+ EventEmitter(obs : EventObserver)
|
|
||||||
# notifyObservers(e : Event)
|
|
||||||
+ registerObserver(obs : EventObserver)
|
|
||||||
+ timePasses(Weekday) {abstract}
|
|
||||||
}
|
|
||||||
interface EventObserver {
|
|
||||||
+ onEvent(Event) {abstract}
|
|
||||||
}
|
|
||||||
class KingJoffrey {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ KingJoffrey()
|
|
||||||
+ onEvent(e : Event)
|
|
||||||
}
|
|
||||||
class KingsHand {
|
|
||||||
+ KingsHand()
|
|
||||||
+ KingsHand(obs : EventObserver)
|
|
||||||
+ onEvent(e : Event)
|
|
||||||
+ timePasses(day : Weekday)
|
|
||||||
}
|
|
||||||
class LordBaelish {
|
|
||||||
+ LordBaelish()
|
|
||||||
+ LordBaelish(obs : EventObserver)
|
|
||||||
+ timePasses(day : Weekday)
|
|
||||||
}
|
|
||||||
class LordVarys {
|
|
||||||
+ LordVarys()
|
|
||||||
+ LordVarys(obs : EventObserver)
|
|
||||||
+ timePasses(day : Weekday)
|
|
||||||
}
|
|
||||||
class Scout {
|
|
||||||
+ Scout()
|
|
||||||
+ Scout(obs : EventObserver)
|
|
||||||
+ timePasses(day : Weekday)
|
|
||||||
}
|
|
||||||
enum Weekday {
|
|
||||||
+ FRIDAY {static}
|
|
||||||
+ MONDAY {static}
|
|
||||||
+ SATURDAY {static}
|
|
||||||
+ SUNDAY {static}
|
|
||||||
+ THURSDAY {static}
|
|
||||||
+ TUESDAY {static}
|
|
||||||
+ WEDNESDAY {static}
|
|
||||||
- description : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Weekday {static}
|
|
||||||
+ values() : Weekday[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EventEmitter --> "-observers" EventObserver
|
|
||||||
KingJoffrey ..|> EventObserver
|
|
||||||
KingsHand ..|> EventObserver
|
|
||||||
KingsHand --|> EventEmitter
|
|
||||||
LordBaelish --|> EventEmitter
|
|
||||||
LordVarys --|> EventEmitter
|
|
||||||
Scout --|> EventEmitter
|
|
||||||
@enduml
|
|
@ -1,66 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.event.asynchronous {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ PROP_FILE_NAME : String {static}
|
|
||||||
~ interactiveMode : boolean
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
+ quickRun()
|
|
||||||
+ run()
|
|
||||||
+ runInteractiveMode()
|
|
||||||
+ setUp()
|
|
||||||
}
|
|
||||||
class Event {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- eventId : int
|
|
||||||
- eventListener : ThreadCompleteListener
|
|
||||||
- eventTime : int
|
|
||||||
- isComplete : boolean
|
|
||||||
- isSynchronous : boolean
|
|
||||||
- thread : Thread
|
|
||||||
+ Event(eventId : int, eventTime : int, isSynchronous : boolean)
|
|
||||||
+ addListener(listener : ThreadCompleteListener)
|
|
||||||
- completed()
|
|
||||||
+ isSynchronous() : boolean
|
|
||||||
+ removeListener(listener : ThreadCompleteListener)
|
|
||||||
+ run()
|
|
||||||
+ start()
|
|
||||||
+ status()
|
|
||||||
+ stop()
|
|
||||||
}
|
|
||||||
class EventManager {
|
|
||||||
+ MAX_EVENT_TIME : int {static}
|
|
||||||
+ MAX_ID : int {static}
|
|
||||||
+ MAX_RUNNING_EVENTS : int {static}
|
|
||||||
+ MIN_ID : int {static}
|
|
||||||
- currentlyRunningSyncEvent : int
|
|
||||||
- eventPool : Map<Integer, Event>
|
|
||||||
- rand : Random
|
|
||||||
+ EventManager()
|
|
||||||
+ cancel(eventId : int)
|
|
||||||
+ completedEventHandler(eventId : int)
|
|
||||||
+ create(eventTime : int) : int
|
|
||||||
+ createAsync(eventTime : int) : int
|
|
||||||
- createEvent(eventTime : int, isSynchronous : boolean) : int
|
|
||||||
- generateId() : int
|
|
||||||
+ getEventPool() : Map<Integer, Event>
|
|
||||||
+ numOfCurrentlyRunningSyncEvent() : int
|
|
||||||
+ shutdown()
|
|
||||||
+ start(eventId : int)
|
|
||||||
+ status(eventId : int)
|
|
||||||
+ statusOfAllEvents()
|
|
||||||
}
|
|
||||||
interface IEvent {
|
|
||||||
+ start() {abstract}
|
|
||||||
+ status() {abstract}
|
|
||||||
+ stop() {abstract}
|
|
||||||
}
|
|
||||||
interface ThreadCompleteListener {
|
|
||||||
+ completedEventHandler(int) {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Event --> "-eventListener" ThreadCompleteListener
|
|
||||||
Event ..|> IEvent
|
|
||||||
EventManager ..|> ThreadCompleteListener
|
|
||||||
@enduml
|
|
@ -1,64 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.eda.handler {
|
|
||||||
class UserCreatedEventHandler {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ UserCreatedEventHandler()
|
|
||||||
+ onEvent(event : UserCreatedEvent)
|
|
||||||
}
|
|
||||||
class UserUpdatedEventHandler {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ UserUpdatedEventHandler()
|
|
||||||
+ onEvent(event : UserUpdatedEvent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.eda.event {
|
|
||||||
abstract class AbstractEvent {
|
|
||||||
+ AbstractEvent()
|
|
||||||
+ getType() : Class<? extends Event>
|
|
||||||
}
|
|
||||||
class UserCreatedEvent {
|
|
||||||
- user : User
|
|
||||||
+ UserCreatedEvent(user : User)
|
|
||||||
+ getUser() : User
|
|
||||||
}
|
|
||||||
class UserUpdatedEvent {
|
|
||||||
- user : User
|
|
||||||
+ UserUpdatedEvent(user : User)
|
|
||||||
+ getUser() : User
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.eda.framework {
|
|
||||||
interface Event {
|
|
||||||
+ getType() : Class<? extends Event> {abstract}
|
|
||||||
}
|
|
||||||
class EventDispatcher {
|
|
||||||
- handlers : Map<Class<? extends Event>, Handler<? extends Event>>
|
|
||||||
+ EventDispatcher()
|
|
||||||
+ dispatch(event : E extends Event)
|
|
||||||
+ registerHandler(eventType : Class<E extends Event>, handler : Handler<E extends Event>)
|
|
||||||
}
|
|
||||||
interface Handler<E extends Event> {
|
|
||||||
+ onEvent(E extends Event) {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.eda.model {
|
|
||||||
class User {
|
|
||||||
- username : String
|
|
||||||
+ User(username : String)
|
|
||||||
+ getUsername() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.eda {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UserUpdatedEvent --> "-user" User
|
|
||||||
UserCreatedEvent --> "-user" User
|
|
||||||
AbstractEvent ..|> Event
|
|
||||||
UserCreatedEvent --|> AbstractEvent
|
|
||||||
UserUpdatedEvent --|> AbstractEvent
|
|
||||||
UserCreatedEventHandler ..|> Handler
|
|
||||||
UserUpdatedEventHandler ..|> Handler
|
|
||||||
@enduml
|
|
@ -1,26 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.event.queue {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ getAudioStream(filePath : String) : AudioInputStream {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Audio {
|
|
||||||
- MAX_PENDING : int {static}
|
|
||||||
- headIndex : int {static}
|
|
||||||
- pendingAudio : PlayMessage[] {static}
|
|
||||||
- tailIndex : int {static}
|
|
||||||
- updateThread : Thread {static}
|
|
||||||
+ Audio()
|
|
||||||
+ init() {static}
|
|
||||||
+ playSound(stream : AudioInputStream, volume : float) {static}
|
|
||||||
+ stopService() {static}
|
|
||||||
+ update() {static}
|
|
||||||
}
|
|
||||||
class PlayMessage {
|
|
||||||
~ stream : AudioInputStream
|
|
||||||
~ volume : float
|
|
||||||
+ PlayMessage()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,184 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.event.sourcing.journal {
|
|
||||||
class JsonFileJournal {
|
|
||||||
- aFile : File
|
|
||||||
- events : List<String>
|
|
||||||
- index : int
|
|
||||||
+ JsonFileJournal()
|
|
||||||
+ readNext() : DomainEvent
|
|
||||||
+ reset()
|
|
||||||
+ write(domainEvent : DomainEvent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.event.sourcing.processor {
|
|
||||||
class DomainEventProcessor {
|
|
||||||
- precessorJournal : ProcessorJournal
|
|
||||||
+ DomainEventProcessor()
|
|
||||||
+ process(domainEvent : DomainEvent)
|
|
||||||
+ recover()
|
|
||||||
+ setPrecessorJournal(precessorJournal : ProcessorJournal)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.event.sourcing.service {
|
|
||||||
class AccountService {
|
|
||||||
- eventProcessor : EventProcessor
|
|
||||||
+ AccountService(eventProcessor : EventProcessor)
|
|
||||||
+ createAccount(accountNo : int, owner : String)
|
|
||||||
}
|
|
||||||
class MoneyTransactionService {
|
|
||||||
- eventProcessor : EventProcessor
|
|
||||||
+ MoneyTransactionService(eventProcessor : EventProcessor)
|
|
||||||
+ depositMoney(accountNo : int, money : BigDecimal)
|
|
||||||
+ transferMoney(accountNoFrom : int, accountNoTo : int, money : BigDecimal)
|
|
||||||
+ withdrawalMoney(accountNo : int, money : BigDecimal)
|
|
||||||
}
|
|
||||||
class SequenceIdGenerator {
|
|
||||||
- sequenceId : long {static}
|
|
||||||
+ SequenceIdGenerator()
|
|
||||||
+ nextSequenceId() : long {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.event.sourcing.event {
|
|
||||||
class AccountCreateEvent {
|
|
||||||
- accountNo : int
|
|
||||||
- owner : String
|
|
||||||
+ AccountCreateEvent(sequenceId : long, createdTime : long, accountNo : int, owner : String)
|
|
||||||
+ getAccountNo() : int
|
|
||||||
+ getOwner() : String
|
|
||||||
+ process()
|
|
||||||
}
|
|
||||||
class MoneyDepositEvent {
|
|
||||||
- accountNo : int
|
|
||||||
- money : BigDecimal
|
|
||||||
+ MoneyDepositEvent(sequenceId : long, createdTime : long, accountNo : int, money : BigDecimal)
|
|
||||||
+ getAccountNo() : int
|
|
||||||
+ getMoney() : BigDecimal
|
|
||||||
+ process()
|
|
||||||
}
|
|
||||||
class MoneyTransferEvent {
|
|
||||||
- accountNoFrom : int
|
|
||||||
- accountNoTo : int
|
|
||||||
- money : BigDecimal
|
|
||||||
+ MoneyTransferEvent(sequenceId : long, createdTime : long, money : BigDecimal, accountNoFrom : int, accountNoTo : int)
|
|
||||||
+ getAccountNoFrom() : int
|
|
||||||
+ getAccountNoTo() : int
|
|
||||||
+ getMoney() : BigDecimal
|
|
||||||
+ process()
|
|
||||||
}
|
|
||||||
class MoneyWithdrawalEvent {
|
|
||||||
- accountNo : int
|
|
||||||
- money : BigDecimal
|
|
||||||
+ MoneyWithdrawalEvent(sequenceId : long, createdTime : long, accountNo : int, money : BigDecimal)
|
|
||||||
+ getAccountNo() : int
|
|
||||||
+ getMoney() : BigDecimal
|
|
||||||
+ process()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.event.sourcing.gateway {
|
|
||||||
class AccountCreateContractSender {
|
|
||||||
+ AccountCreateContractSender()
|
|
||||||
+ sendContractInfo(account : Account)
|
|
||||||
}
|
|
||||||
class Gateways {
|
|
||||||
- accountCreateContractSender : AccountCreateContractSender {static}
|
|
||||||
- transactionLogger : TransactionLogger {static}
|
|
||||||
+ Gateways()
|
|
||||||
+ getAccountCreateContractSender() : AccountCreateContractSender {static}
|
|
||||||
+ getTransactionLogger() : TransactionLogger {static}
|
|
||||||
}
|
|
||||||
class TransactionLogger {
|
|
||||||
+ TransactionLogger()
|
|
||||||
+ log(transaction : Transaction)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.event.sourcing.app {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.event.sourcing.state {
|
|
||||||
class AccountAggregate {
|
|
||||||
- accounts : Map<Integer, Account> {static}
|
|
||||||
+ AccountAggregate()
|
|
||||||
+ getAccount(accountNo : int) : Account {static}
|
|
||||||
+ putAccount(account : Account) {static}
|
|
||||||
+ resetState() {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.event.sourcing.domain {
|
|
||||||
class Account {
|
|
||||||
- accountNo : int
|
|
||||||
- money : BigDecimal
|
|
||||||
- owner : String
|
|
||||||
- transactions : List<Transaction>
|
|
||||||
+ Account(accountNo : int, owner : String)
|
|
||||||
+ copy() : Account
|
|
||||||
- depositMoney(money : BigDecimal) : Transaction
|
|
||||||
+ getAccountNo() : int
|
|
||||||
+ getMoney() : BigDecimal
|
|
||||||
+ getOwner() : String
|
|
||||||
+ getTransactions() : List<Transaction>
|
|
||||||
- handleDeposit(money : BigDecimal, realTime : boolean)
|
|
||||||
+ handleEvent(accountCreateEvent : AccountCreateEvent)
|
|
||||||
+ handleEvent(moneyDepositEvent : MoneyDepositEvent)
|
|
||||||
+ handleEvent(moneyWithdrawalEvent : MoneyWithdrawalEvent)
|
|
||||||
+ handleTransferFromEvent(moneyTransferEvent : MoneyTransferEvent)
|
|
||||||
+ handleTransferToEvent(moneyTransferEvent : MoneyTransferEvent)
|
|
||||||
- handleWithdrawal(money : BigDecimal, realTime : boolean)
|
|
||||||
+ setMoney(money : BigDecimal)
|
|
||||||
+ setTransactions(transactions : List<Transaction>)
|
|
||||||
+ toString() : String
|
|
||||||
- withdrawMoney(money : BigDecimal) : Transaction
|
|
||||||
}
|
|
||||||
class Transaction {
|
|
||||||
- accountNo : int
|
|
||||||
- lastBalance : BigDecimal
|
|
||||||
- moneyIn : BigDecimal
|
|
||||||
- moneyOut : BigDecimal
|
|
||||||
+ Transaction(accountNo : int, moneyIn : BigDecimal, moneyOut : BigDecimal, lastBalance : BigDecimal)
|
|
||||||
+ getAccountNo() : int
|
|
||||||
+ getLastBalance() : BigDecimal
|
|
||||||
+ getMoneyIn() : BigDecimal
|
|
||||||
+ getMoneyOut() : BigDecimal
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.event.sourcing.api {
|
|
||||||
abstract class DomainEvent {
|
|
||||||
- createdTime : long
|
|
||||||
- eventClassName : String
|
|
||||||
- realTime : boolean
|
|
||||||
- sequenceId : long
|
|
||||||
+ DomainEvent(sequenceId : long, createdTime : long, eventClassName : String)
|
|
||||||
+ getCreatedTime() : long
|
|
||||||
+ getEventClassName() : String
|
|
||||||
+ getSequenceId() : long
|
|
||||||
+ isRealTime() : boolean
|
|
||||||
+ process() {abstract}
|
|
||||||
+ setRealTime(realTime : boolean)
|
|
||||||
}
|
|
||||||
interface EventProcessor {
|
|
||||||
+ process(DomainEvent) {abstract}
|
|
||||||
+ recover() {abstract}
|
|
||||||
+ setPrecessorJournal(ProcessorJournal) {abstract}
|
|
||||||
}
|
|
||||||
interface ProcessorJournal {
|
|
||||||
+ readNext() : DomainEvent {abstract}
|
|
||||||
+ reset() {abstract}
|
|
||||||
+ write(DomainEvent) {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Gateways --> "-accountCreateContractSender" AccountCreateContractSender
|
|
||||||
DomainEventProcessor --> "-precessorJournal" ProcessorJournal
|
|
||||||
Account --> "-transactions" Transaction
|
|
||||||
Gateways --> "-transactionLogger" TransactionLogger
|
|
||||||
AccountService --> "-eventProcessor" EventProcessor
|
|
||||||
MoneyTransactionService --> "-eventProcessor" EventProcessor
|
|
||||||
AccountCreateEvent --|> DomainEvent
|
|
||||||
MoneyDepositEvent --|> DomainEvent
|
|
||||||
MoneyTransferEvent --|> DomainEvent
|
|
||||||
MoneyWithdrawalEvent --|> DomainEvent
|
|
||||||
JsonFileJournal ..|> ProcessorJournal
|
|
||||||
DomainEventProcessor ..|> EventProcessor
|
|
||||||
@enduml
|
|
@ -1,14 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.execute.around {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
interface FileWriterAction {
|
|
||||||
+ writeFile(FileWriter) {abstract}
|
|
||||||
}
|
|
||||||
class SimpleFileWriter {
|
|
||||||
+ SimpleFileWriter(filename : String, action : FileWriterAction)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,2 +0,0 @@
|
|||||||
@startuml
|
|
||||||
@enduml
|
|
@ -1,46 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.factorykit {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Axe {
|
|
||||||
+ Axe()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class Bow {
|
|
||||||
+ Bow()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface Builder {
|
|
||||||
+ add(WeaponType, Supplier<Weapon>) {abstract}
|
|
||||||
}
|
|
||||||
class Spear {
|
|
||||||
+ Spear()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class Sword {
|
|
||||||
+ Sword()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface Weapon {
|
|
||||||
}
|
|
||||||
interface WeaponFactory {
|
|
||||||
+ create(WeaponType) : Weapon {abstract}
|
|
||||||
+ factory(consumer : Consumer<Builder>) : WeaponFactory {static}
|
|
||||||
}
|
|
||||||
enum WeaponType {
|
|
||||||
+ AXE {static}
|
|
||||||
+ BOW {static}
|
|
||||||
+ SPEAR {static}
|
|
||||||
+ SWORD {static}
|
|
||||||
+ valueOf(name : String) : WeaponType {static}
|
|
||||||
+ values() : WeaponType[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Axe ..|> Weapon
|
|
||||||
Bow ..|> Weapon
|
|
||||||
Spear ..|> Weapon
|
|
||||||
Sword ..|> Weapon
|
|
||||||
@enduml
|
|
@ -1,48 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.featuretoggle.pattern {
|
|
||||||
interface Service {
|
|
||||||
+ getWelcomeMessage(User) : String {abstract}
|
|
||||||
+ isEnhanced() : boolean {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.featuretoggle.user {
|
|
||||||
class User {
|
|
||||||
- name : String
|
|
||||||
+ User(name : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class UserGroup {
|
|
||||||
- freeGroup : List<User> {static}
|
|
||||||
- paidGroup : List<User> {static}
|
|
||||||
+ UserGroup()
|
|
||||||
+ addUserToFreeGroup(user : User) {static}
|
|
||||||
+ addUserToPaidGroup(user : User) {static}
|
|
||||||
+ isPaid(user : User) : boolean {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.featuretoggle.pattern.tieredversion {
|
|
||||||
class TieredFeatureToggleVersion {
|
|
||||||
+ TieredFeatureToggleVersion()
|
|
||||||
+ getWelcomeMessage(user : User) : String
|
|
||||||
+ isEnhanced() : boolean
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.featuretoggle.pattern.propertiesversion {
|
|
||||||
class PropertiesFeatureToggleVersion {
|
|
||||||
- isEnhanced : boolean
|
|
||||||
+ PropertiesFeatureToggleVersion(properties : Properties)
|
|
||||||
+ getWelcomeMessage(user : User) : String
|
|
||||||
+ isEnhanced() : boolean
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.featuretoggle {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UserGroup --> "-freeGroup" User
|
|
||||||
PropertiesFeatureToggleVersion ..|> Service
|
|
||||||
TieredFeatureToggleVersion ..|> Service
|
|
||||||
@enduml
|
|
@ -1,72 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.fluentinterface.fluentiterable.simple {
|
|
||||||
class SimpleFluentIterable<E> {
|
|
||||||
- iterable : Iterable<E>
|
|
||||||
# SimpleFluentIterable<E>(iterable : Iterable<E>)
|
|
||||||
+ asList() : List<E>
|
|
||||||
+ filter(predicate : Predicate<? super E>) : FluentIterable<E>
|
|
||||||
+ first() : Optional<E>
|
|
||||||
+ first(count : int) : FluentIterable<E>
|
|
||||||
+ forEach(action : Consumer<? super E>)
|
|
||||||
+ from(iterable : Iterable<E>) : FluentIterable<E> {static}
|
|
||||||
+ fromCopyOf(iterable : Iterable<E>) : FluentIterable<E> {static}
|
|
||||||
+ getRemainingElementsCount() : int
|
|
||||||
+ iterator() : Iterator<E>
|
|
||||||
+ last() : Optional<E>
|
|
||||||
+ last(count : int) : FluentIterable<E>
|
|
||||||
+ map(function : Function<? super E, T>) : FluentIterable<T>
|
|
||||||
+ spliterator() : Spliterator<E>
|
|
||||||
+ toList(iterator : Iterator<E>) : List<E> {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.fluentinterface.app {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- negatives() : Predicate<? super Integer> {static}
|
|
||||||
- positives() : Predicate<? super Integer> {static}
|
|
||||||
- prettyPrint(delimiter : String, prefix : String, iterable : Iterable<E>) {static}
|
|
||||||
- prettyPrint(prefix : String, iterable : Iterable<E>) {static}
|
|
||||||
- transformToString() : Function<Integer, String> {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.fluentinterface.fluentiterable.lazy {
|
|
||||||
abstract class DecoratingIterator<E> {
|
|
||||||
# fromIterator : Iterator<E>
|
|
||||||
- next : E
|
|
||||||
+ DecoratingIterator<E>(fromIterator : Iterator<E>)
|
|
||||||
+ computeNext() : E {abstract}
|
|
||||||
+ hasNext() : boolean
|
|
||||||
+ next() : E
|
|
||||||
}
|
|
||||||
class LazyFluentIterable<E> {
|
|
||||||
- iterable : Iterable<E>
|
|
||||||
# LazyFluentIterable<E>()
|
|
||||||
# LazyFluentIterable<E>(iterable : Iterable<E>)
|
|
||||||
+ asList() : List<E>
|
|
||||||
+ filter(predicate : Predicate<? super E>) : FluentIterable<E>
|
|
||||||
+ first() : Optional<E>
|
|
||||||
+ first(count : int) : FluentIterable<E>
|
|
||||||
+ from(iterable : Iterable<E>) : FluentIterable<E> {static}
|
|
||||||
+ iterator() : Iterator<E>
|
|
||||||
+ last() : Optional<E>
|
|
||||||
+ last(count : int) : FluentIterable<E>
|
|
||||||
+ map(function : Function<? super E, T>) : FluentIterable<T>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.fluentinterface.fluentiterable {
|
|
||||||
interface FluentIterable<E> {
|
|
||||||
+ asList() : List<E> {abstract}
|
|
||||||
+ copyToList(iterable : Iterable<E>) : List<E> {static}
|
|
||||||
+ filter(Predicate<? super E>) : FluentIterable<E> {abstract}
|
|
||||||
+ first() : Optional<E> {abstract}
|
|
||||||
+ first(int) : FluentIterable<E> {abstract}
|
|
||||||
+ last() : Optional<E> {abstract}
|
|
||||||
+ last(int) : FluentIterable<E> {abstract}
|
|
||||||
+ map(Function<? super E, T>) : FluentIterable<T> {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LazyFluentIterable ..|> FluentIterable
|
|
||||||
SimpleFluentIterable ..|> FluentIterable
|
|
||||||
@enduml
|
|
@ -1,117 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.flux.view {
|
|
||||||
class ContentView {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- content : Content
|
|
||||||
+ ContentView()
|
|
||||||
+ render()
|
|
||||||
+ storeChanged(store : Store)
|
|
||||||
}
|
|
||||||
class MenuView {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- selected : MenuItem
|
|
||||||
+ MenuView()
|
|
||||||
+ itemClicked(item : MenuItem)
|
|
||||||
+ render()
|
|
||||||
+ storeChanged(store : Store)
|
|
||||||
}
|
|
||||||
interface View {
|
|
||||||
+ render() {abstract}
|
|
||||||
+ storeChanged(Store) {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.flux.action {
|
|
||||||
abstract class Action {
|
|
||||||
- type : ActionType
|
|
||||||
+ Action(type : ActionType)
|
|
||||||
+ getType() : ActionType
|
|
||||||
}
|
|
||||||
enum ActionType {
|
|
||||||
+ CONTENT_CHANGED {static}
|
|
||||||
+ MENU_ITEM_SELECTED {static}
|
|
||||||
+ valueOf(name : String) : ActionType {static}
|
|
||||||
+ values() : ActionType[] {static}
|
|
||||||
}
|
|
||||||
enum Content {
|
|
||||||
+ COMPANY {static}
|
|
||||||
+ PRODUCTS {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Content {static}
|
|
||||||
+ values() : Content[] {static}
|
|
||||||
}
|
|
||||||
class ContentAction {
|
|
||||||
- content : Content
|
|
||||||
+ ContentAction(content : Content)
|
|
||||||
+ getContent() : Content
|
|
||||||
}
|
|
||||||
class MenuAction {
|
|
||||||
- menuItem : MenuItem
|
|
||||||
+ MenuAction(menuItem : MenuItem)
|
|
||||||
+ getMenuItem() : MenuItem
|
|
||||||
}
|
|
||||||
enum MenuItem {
|
|
||||||
+ COMPANY {static}
|
|
||||||
+ HOME {static}
|
|
||||||
+ PRODUCTS {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : MenuItem {static}
|
|
||||||
+ values() : MenuItem[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.flux.app {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.flux.store {
|
|
||||||
class ContentStore {
|
|
||||||
- content : Content
|
|
||||||
+ ContentStore()
|
|
||||||
+ getContent() : Content
|
|
||||||
+ onAction(action : Action)
|
|
||||||
}
|
|
||||||
class MenuStore {
|
|
||||||
- selected : MenuItem
|
|
||||||
+ MenuStore()
|
|
||||||
+ getSelected() : MenuItem
|
|
||||||
+ onAction(action : Action)
|
|
||||||
}
|
|
||||||
abstract class Store {
|
|
||||||
- views : List<View>
|
|
||||||
+ Store()
|
|
||||||
# notifyChange()
|
|
||||||
+ onAction(Action) {abstract}
|
|
||||||
+ registerView(view : View)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.flux.dispatcher {
|
|
||||||
class Dispatcher {
|
|
||||||
- instance : Dispatcher {static}
|
|
||||||
- stores : List<Store>
|
|
||||||
- Dispatcher()
|
|
||||||
- dispatchAction(action : Action)
|
|
||||||
+ getInstance() : Dispatcher {static}
|
|
||||||
+ menuItemSelected(menuItem : MenuItem)
|
|
||||||
+ registerStore(store : Store)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MenuAction --> "-menuItem" MenuItem
|
|
||||||
Action --> "-type" ActionType
|
|
||||||
Dispatcher --> "-instance" Dispatcher
|
|
||||||
MenuStore --> "-selected" MenuItem
|
|
||||||
ContentView --> "-content" Content
|
|
||||||
Dispatcher --> "-stores" Store
|
|
||||||
MenuView --> "-selected" MenuItem
|
|
||||||
Store --> "-views" View
|
|
||||||
ContentAction --> "-content" Content
|
|
||||||
ContentStore --> "-content" Content
|
|
||||||
ContentAction --|> Action
|
|
||||||
MenuAction --|> Action
|
|
||||||
ContentStore --|> Store
|
|
||||||
MenuStore --|> Store
|
|
||||||
ContentView ..|> View
|
|
||||||
MenuView ..|> View
|
|
||||||
@enduml
|
|
@ -1,53 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.front.controller {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class ArcherCommand {
|
|
||||||
+ ArcherCommand()
|
|
||||||
+ process()
|
|
||||||
}
|
|
||||||
class ArcherView {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ ArcherView()
|
|
||||||
+ display()
|
|
||||||
}
|
|
||||||
class CatapultCommand {
|
|
||||||
+ CatapultCommand()
|
|
||||||
+ process()
|
|
||||||
}
|
|
||||||
class CatapultView {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ CatapultView()
|
|
||||||
+ display()
|
|
||||||
}
|
|
||||||
interface Command {
|
|
||||||
+ process() {abstract}
|
|
||||||
}
|
|
||||||
class ErrorView {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ ErrorView()
|
|
||||||
+ display()
|
|
||||||
}
|
|
||||||
class FrontController {
|
|
||||||
+ FrontController()
|
|
||||||
- getCommand(request : String) : Command
|
|
||||||
- getCommandClass(request : String) : Class<T> {static}
|
|
||||||
+ handleRequest(request : String)
|
|
||||||
}
|
|
||||||
class UnknownCommand {
|
|
||||||
+ UnknownCommand()
|
|
||||||
+ process()
|
|
||||||
}
|
|
||||||
interface View {
|
|
||||||
+ display() {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ArcherCommand ..|> Command
|
|
||||||
ArcherView ..|> View
|
|
||||||
CatapultCommand ..|> Command
|
|
||||||
CatapultView ..|> View
|
|
||||||
ErrorView ..|> View
|
|
||||||
UnknownCommand ..|> Command
|
|
||||||
@enduml
|
|
@ -1,15 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.guarded.suspension {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class GuardedQueue {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- sourceList : Queue<Integer>
|
|
||||||
+ GuardedQueue()
|
|
||||||
+ get() : Integer
|
|
||||||
+ put(e : Integer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,31 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.halfsynchalfasync {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
- ap(i : long) : long {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
~class ArithmeticSumTask {
|
|
||||||
- n : long
|
|
||||||
+ ArithmeticSumTask(n : long)
|
|
||||||
+ call() : Long
|
|
||||||
+ onError(throwable : Throwable)
|
|
||||||
+ onPostCall(result : Long)
|
|
||||||
+ onPreCall()
|
|
||||||
}
|
|
||||||
interface AsyncTask<O> {
|
|
||||||
+ call() : O {abstract}
|
|
||||||
+ onError(Throwable) {abstract}
|
|
||||||
+ onPostCall(O) {abstract}
|
|
||||||
+ onPreCall() {abstract}
|
|
||||||
}
|
|
||||||
class AsynchronousService {
|
|
||||||
- service : ExecutorService
|
|
||||||
+ AsynchronousService(workQueue : BlockingQueue<Runnable>)
|
|
||||||
+ execute(task : AsyncTask<T>)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ArithmeticSumTask ..+ App
|
|
||||||
ArithmeticSumTask ..|> AsyncTask
|
|
||||||
@enduml
|
|
@ -1,279 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.hexagonal.sampledata {
|
|
||||||
class SampleData {
|
|
||||||
- PLAYERS : List<PlayerDetails> {static}
|
|
||||||
+ SampleData()
|
|
||||||
- getRandomPlayerDetails() : PlayerDetails {static}
|
|
||||||
+ submitTickets(lotteryService : LotteryService, numTickets : int) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.hexagonal.service {
|
|
||||||
class ConsoleLottery {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ ConsoleLottery()
|
|
||||||
- addFundsToLotteryAccount(bank : WireTransfers, scanner : Scanner) {static}
|
|
||||||
- checkTicket(service : LotteryService, scanner : Scanner) {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- printMainMenu() {static}
|
|
||||||
- queryLotteryAccountFunds(bank : WireTransfers, scanner : Scanner) {static}
|
|
||||||
- readString(scanner : Scanner) : String {static}
|
|
||||||
- submitTicket(service : LotteryService, scanner : Scanner) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.hexagonal.mongo {
|
|
||||||
class MongoConnectionPropertiesLoader {
|
|
||||||
- DEFAULT_HOST : String {static}
|
|
||||||
- DEFAULT_PORT : int {static}
|
|
||||||
+ MongoConnectionPropertiesLoader()
|
|
||||||
+ load() {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.hexagonal.domain {
|
|
||||||
class LotteryAdministration {
|
|
||||||
- notifications : LotteryEventLog
|
|
||||||
- repository : LotteryTicketRepository
|
|
||||||
- wireTransfers : WireTransfers
|
|
||||||
+ LotteryAdministration(repository : LotteryTicketRepository, notifications : LotteryEventLog, wireTransfers : WireTransfers)
|
|
||||||
+ getAllSubmittedTickets() : Map<LotteryTicketId, LotteryTicket>
|
|
||||||
+ performLottery() : LotteryNumbers
|
|
||||||
+ resetLottery()
|
|
||||||
}
|
|
||||||
class LotteryConstants {
|
|
||||||
+ PLAYER_MAX_SALDO : int {static}
|
|
||||||
+ PRIZE_AMOUNT : int {static}
|
|
||||||
+ SERVICE_BANK_ACCOUNT : String {static}
|
|
||||||
+ SERVICE_BANK_ACCOUNT_SALDO : int {static}
|
|
||||||
+ TICKET_PRIZE : int {static}
|
|
||||||
- LotteryConstants()
|
|
||||||
}
|
|
||||||
class LotteryNumbers {
|
|
||||||
+ MAX_NUMBER : int {static}
|
|
||||||
+ MIN_NUMBER : int {static}
|
|
||||||
+ NUM_NUMBERS : int {static}
|
|
||||||
- numbers : Set<Integer>
|
|
||||||
- LotteryNumbers()
|
|
||||||
- LotteryNumbers(givenNumbers : Set<Integer>)
|
|
||||||
+ create(givenNumbers : Set<Integer>) : LotteryNumbers {static}
|
|
||||||
+ createRandom() : LotteryNumbers {static}
|
|
||||||
+ equals(obj : Object) : boolean
|
|
||||||
- generateRandomNumbers()
|
|
||||||
+ getNumbers() : Set<Integer>
|
|
||||||
+ getNumbersAsString() : String
|
|
||||||
+ hashCode() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
-class RandomNumberGenerator {
|
|
||||||
- randomIterator : OfInt
|
|
||||||
+ RandomNumberGenerator(min : int, max : int)
|
|
||||||
+ nextInt() : int
|
|
||||||
}
|
|
||||||
class LotteryService {
|
|
||||||
- notifications : LotteryEventLog
|
|
||||||
- repository : LotteryTicketRepository
|
|
||||||
- wireTransfers : WireTransfers
|
|
||||||
+ LotteryService(repository : LotteryTicketRepository, notifications : LotteryEventLog, wireTransfers : WireTransfers)
|
|
||||||
+ checkTicketForPrize(id : LotteryTicketId, winningNumbers : LotteryNumbers) : LotteryTicketCheckResult
|
|
||||||
+ submitTicket(ticket : LotteryTicket) : Optional<LotteryTicketId>
|
|
||||||
}
|
|
||||||
class LotteryTicket {
|
|
||||||
- id : LotteryTicketId
|
|
||||||
- lotteryNumbers : LotteryNumbers
|
|
||||||
- playerDetails : PlayerDetails
|
|
||||||
+ LotteryTicket(id : LotteryTicketId, details : PlayerDetails, numbers : LotteryNumbers)
|
|
||||||
+ equals(obj : Object) : boolean
|
|
||||||
+ getId() : LotteryTicketId
|
|
||||||
+ getNumbers() : LotteryNumbers
|
|
||||||
+ getPlayerDetails() : PlayerDetails
|
|
||||||
+ hashCode() : int
|
|
||||||
+ setId(id : LotteryTicketId)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class LotteryTicketCheckResult {
|
|
||||||
- checkResult : CheckResult
|
|
||||||
- prizeAmount : int
|
|
||||||
+ LotteryTicketCheckResult(result : CheckResult)
|
|
||||||
+ LotteryTicketCheckResult(result : CheckResult, amount : int)
|
|
||||||
+ equals(obj : Object) : boolean
|
|
||||||
+ getPrizeAmount() : int
|
|
||||||
+ getResult() : CheckResult
|
|
||||||
+ hashCode() : int
|
|
||||||
}
|
|
||||||
enum CheckResult {
|
|
||||||
+ NO_PRIZE {static}
|
|
||||||
+ TICKET_NOT_SUBMITTED {static}
|
|
||||||
+ WIN_PRIZE {static}
|
|
||||||
+ valueOf(name : String) : CheckResult {static}
|
|
||||||
+ values() : CheckResult[] {static}
|
|
||||||
}
|
|
||||||
class LotteryTicketId {
|
|
||||||
- id : int
|
|
||||||
- numAllocated : int {static}
|
|
||||||
+ LotteryTicketId()
|
|
||||||
+ LotteryTicketId(id : int)
|
|
||||||
+ equals(o : Object) : boolean
|
|
||||||
+ getId() : int
|
|
||||||
+ hashCode() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class LotteryUtils {
|
|
||||||
- LotteryUtils()
|
|
||||||
+ checkTicketForPrize(repository : LotteryTicketRepository, id : LotteryTicketId, winningNumbers : LotteryNumbers) : LotteryTicketCheckResult {static}
|
|
||||||
}
|
|
||||||
class PlayerDetails {
|
|
||||||
- bankAccountNumber : String
|
|
||||||
- emailAddress : String
|
|
||||||
- phoneNumber : String
|
|
||||||
+ PlayerDetails(email : String, bankAccount : String, phone : String)
|
|
||||||
+ equals(obj : Object) : boolean
|
|
||||||
+ getBankAccount() : String
|
|
||||||
+ getEmail() : String
|
|
||||||
+ getPhoneNumber() : String
|
|
||||||
+ hashCode() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.hexagonal.banking {
|
|
||||||
class InMemoryBank {
|
|
||||||
- accounts : Map<String, Integer> {static}
|
|
||||||
+ InMemoryBank()
|
|
||||||
+ getFunds(bankAccount : String) : int
|
|
||||||
+ setFunds(bankAccount : String, amount : int)
|
|
||||||
+ transferFunds(amount : int, sourceBackAccount : String, destinationBankAccount : String) : boolean
|
|
||||||
}
|
|
||||||
class MongoBank {
|
|
||||||
- DEFAULT_ACCOUNTS_COLLECTION : String {static}
|
|
||||||
- DEFAULT_DB : String {static}
|
|
||||||
- accountsCollection : MongoCollection<Document>
|
|
||||||
- database : MongoDatabase
|
|
||||||
- mongoClient : MongoClient
|
|
||||||
+ MongoBank()
|
|
||||||
+ MongoBank(dbName : String, accountsCollectionName : String)
|
|
||||||
+ connect()
|
|
||||||
+ connect(dbName : String, accountsCollectionName : String)
|
|
||||||
+ getAccountsCollection() : MongoCollection<Document>
|
|
||||||
+ getFunds(bankAccount : String) : int
|
|
||||||
+ getMongoClient() : MongoClient
|
|
||||||
+ getMongoDatabase() : MongoDatabase
|
|
||||||
+ setFunds(bankAccount : String, amount : int)
|
|
||||||
+ transferFunds(amount : int, sourceBackAccount : String, destinationBankAccount : String) : boolean
|
|
||||||
}
|
|
||||||
interface WireTransfers {
|
|
||||||
+ getFunds(String) : int {abstract}
|
|
||||||
+ setFunds(String, int) {abstract}
|
|
||||||
+ transferFunds(int, String, String) : boolean {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.hexagonal.database {
|
|
||||||
class InMemoryTicketRepository {
|
|
||||||
- tickets : Map<LotteryTicketId, LotteryTicket> {static}
|
|
||||||
+ InMemoryTicketRepository()
|
|
||||||
+ deleteAll()
|
|
||||||
+ findAll() : Map<LotteryTicketId, LotteryTicket>
|
|
||||||
+ findById(id : LotteryTicketId) : Optional<LotteryTicket>
|
|
||||||
+ save(ticket : LotteryTicket) : Optional<LotteryTicketId>
|
|
||||||
}
|
|
||||||
interface LotteryTicketRepository {
|
|
||||||
+ deleteAll() {abstract}
|
|
||||||
+ findAll() : Map<LotteryTicketId, LotteryTicket> {abstract}
|
|
||||||
+ findById(LotteryTicketId) : Optional<LotteryTicket> {abstract}
|
|
||||||
+ save(LotteryTicket) : Optional<LotteryTicketId> {abstract}
|
|
||||||
}
|
|
||||||
class MongoTicketRepository {
|
|
||||||
- DEFAULT_COUNTERS_COLLECTION : String {static}
|
|
||||||
- DEFAULT_DB : String {static}
|
|
||||||
- DEFAULT_TICKETS_COLLECTION : String {static}
|
|
||||||
- countersCollection : MongoCollection<Document>
|
|
||||||
- database : MongoDatabase
|
|
||||||
- mongoClient : MongoClient
|
|
||||||
- ticketsCollection : MongoCollection<Document>
|
|
||||||
+ MongoTicketRepository()
|
|
||||||
+ MongoTicketRepository(dbName : String, ticketsCollectionName : String, countersCollectionName : String)
|
|
||||||
+ connect()
|
|
||||||
+ connect(dbName : String, ticketsCollectionName : String, countersCollectionName : String)
|
|
||||||
+ deleteAll()
|
|
||||||
- docToTicket(doc : Document) : LotteryTicket
|
|
||||||
+ findAll() : Map<LotteryTicketId, LotteryTicket>
|
|
||||||
+ findById(id : LotteryTicketId) : Optional<LotteryTicket>
|
|
||||||
+ getCountersCollection() : MongoCollection<Document>
|
|
||||||
+ getMongoClient() : MongoClient
|
|
||||||
+ getMongoDatabase() : MongoDatabase
|
|
||||||
+ getNextId() : int
|
|
||||||
+ getTicketsCollection() : MongoCollection<Document>
|
|
||||||
- initCounters()
|
|
||||||
+ save(ticket : LotteryTicket) : Optional<LotteryTicketId>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.hexagonal {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.hexagonal.administration {
|
|
||||||
class ConsoleAdministration {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ ConsoleAdministration()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- printMainMenu() {static}
|
|
||||||
- readString(scanner : Scanner) : String {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.hexagonal.eventlog {
|
|
||||||
interface LotteryEventLog {
|
|
||||||
+ prizeError(PlayerDetails, int) {abstract}
|
|
||||||
+ ticketDidNotWin(PlayerDetails) {abstract}
|
|
||||||
+ ticketSubmitError(PlayerDetails) {abstract}
|
|
||||||
+ ticketSubmitted(PlayerDetails) {abstract}
|
|
||||||
+ ticketWon(PlayerDetails, int) {abstract}
|
|
||||||
}
|
|
||||||
class MongoEventLog {
|
|
||||||
- DEFAULT_DB : String {static}
|
|
||||||
- DEFAULT_EVENTS_COLLECTION : String {static}
|
|
||||||
- database : MongoDatabase
|
|
||||||
- eventsCollection : MongoCollection<Document>
|
|
||||||
- mongoClient : MongoClient
|
|
||||||
- stdOutEventLog : StdOutEventLog
|
|
||||||
+ MongoEventLog()
|
|
||||||
+ MongoEventLog(dbName : String, eventsCollectionName : String)
|
|
||||||
+ connect()
|
|
||||||
+ connect(dbName : String, eventsCollectionName : String)
|
|
||||||
+ getEventsCollection() : MongoCollection<Document>
|
|
||||||
+ getMongoClient() : MongoClient
|
|
||||||
+ getMongoDatabase() : MongoDatabase
|
|
||||||
+ prizeError(details : PlayerDetails, prizeAmount : int)
|
|
||||||
+ ticketDidNotWin(details : PlayerDetails)
|
|
||||||
+ ticketSubmitError(details : PlayerDetails)
|
|
||||||
+ ticketSubmitted(details : PlayerDetails)
|
|
||||||
+ ticketWon(details : PlayerDetails, prizeAmount : int)
|
|
||||||
}
|
|
||||||
class StdOutEventLog {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ StdOutEventLog()
|
|
||||||
+ prizeError(details : PlayerDetails, prizeAmount : int)
|
|
||||||
+ ticketDidNotWin(details : PlayerDetails)
|
|
||||||
+ ticketSubmitError(details : PlayerDetails)
|
|
||||||
+ ticketSubmitted(details : PlayerDetails)
|
|
||||||
+ ticketWon(details : PlayerDetails, prizeAmount : int)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LotteryTicket --> "-playerDetails" PlayerDetails
|
|
||||||
MongoEventLog --> "-stdOutEventLog" StdOutEventLog
|
|
||||||
LotteryService --> "-wireTransfers" WireTransfers
|
|
||||||
LotteryAdministration --> "-notifications" LotteryEventLog
|
|
||||||
LotteryAdministration --> "-wireTransfers" WireTransfers
|
|
||||||
LotteryService --> "-notifications" LotteryEventLog
|
|
||||||
LotteryTicket --> "-id" LotteryTicketId
|
|
||||||
LotteryAdministration --> "-repository" LotteryTicketRepository
|
|
||||||
LotteryTicket --> "-lotteryNumbers" LotteryNumbers
|
|
||||||
SampleData --> "-PLAYERS" PlayerDetails
|
|
||||||
RandomNumberGenerator ..+ LotteryNumbers
|
|
||||||
LotteryService --> "-repository" LotteryTicketRepository
|
|
||||||
CheckResult ..+ LotteryTicketCheckResult
|
|
||||||
LotteryTicketCheckResult --> "-checkResult" CheckResult
|
|
||||||
InMemoryBank ..|> WireTransfers
|
|
||||||
MongoBank ..|> WireTransfers
|
|
||||||
InMemoryTicketRepository ..|> LotteryTicketRepository
|
|
||||||
MongoTicketRepository ..|> LotteryTicketRepository
|
|
||||||
MongoEventLog ..|> LotteryEventLog
|
|
||||||
StdOutEventLog ..|> LotteryEventLog
|
|
||||||
@enduml
|
|
@ -1,89 +0,0 @@
|
|||||||
@startuml
|
|
||||||
left to right direction
|
|
||||||
package com.iluwatar.intercepting.filter {
|
|
||||||
abstract class AbstractFilter {
|
|
||||||
- next : Filter
|
|
||||||
+ AbstractFilter()
|
|
||||||
+ AbstractFilter(next : Filter)
|
|
||||||
+ execute(order : Order) : String
|
|
||||||
+ getLast() : Filter
|
|
||||||
+ getNext() : Filter
|
|
||||||
+ setNext(filter : Filter)
|
|
||||||
}
|
|
||||||
class AddressFilter {
|
|
||||||
+ AddressFilter()
|
|
||||||
+ execute(order : Order) : String
|
|
||||||
}
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class ContactFilter {
|
|
||||||
+ ContactFilter()
|
|
||||||
+ execute(order : Order) : String
|
|
||||||
}
|
|
||||||
class DepositFilter {
|
|
||||||
+ DepositFilter()
|
|
||||||
+ execute(order : Order) : String
|
|
||||||
}
|
|
||||||
interface Filter {
|
|
||||||
+ execute(Order) : String {abstract}
|
|
||||||
+ getLast() : Filter {abstract}
|
|
||||||
+ getNext() : Filter {abstract}
|
|
||||||
+ setNext(Filter) {abstract}
|
|
||||||
}
|
|
||||||
class FilterChain {
|
|
||||||
- chain : Filter
|
|
||||||
+ FilterChain()
|
|
||||||
+ addFilter(filter : Filter)
|
|
||||||
+ execute(order : Order) : String
|
|
||||||
}
|
|
||||||
class FilterManager {
|
|
||||||
- filterChain : FilterChain
|
|
||||||
+ FilterManager()
|
|
||||||
+ addFilter(filter : Filter)
|
|
||||||
+ filterRequest(order : Order) : String
|
|
||||||
}
|
|
||||||
class NameFilter {
|
|
||||||
+ NameFilter()
|
|
||||||
+ execute(order : Order) : String
|
|
||||||
}
|
|
||||||
class Order {
|
|
||||||
- address : String
|
|
||||||
- contactNumber : String
|
|
||||||
- depositNumber : String
|
|
||||||
- name : String
|
|
||||||
- order : String
|
|
||||||
+ Order()
|
|
||||||
+ Order(name : String, contactNumber : String, address : String, depositNumber : String, order : String)
|
|
||||||
+ getAddress() : String
|
|
||||||
+ getContactNumber() : String
|
|
||||||
+ getDepositNumber() : String
|
|
||||||
+ getName() : String
|
|
||||||
+ getOrder() : String
|
|
||||||
+ setAddress(address : String)
|
|
||||||
+ setContactNumber(contactNumber : String)
|
|
||||||
+ setDepositNumber(depositNumber : String)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ setOrder(order : String)
|
|
||||||
}
|
|
||||||
class OrderFilter {
|
|
||||||
+ OrderFilter()
|
|
||||||
+ execute(order : Order) : String
|
|
||||||
}
|
|
||||||
~class DListener {
|
|
||||||
~ DListener()
|
|
||||||
+ actionPerformed(e : ActionEvent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AbstractFilter --> "-next" Filter
|
|
||||||
DListener --+ Target
|
|
||||||
FilterChain --> "-chain" Filter
|
|
||||||
FilterManager --> "-filterChain" FilterChain
|
|
||||||
AbstractFilter ..|> Filter
|
|
||||||
AddressFilter --|> AbstractFilter
|
|
||||||
ContactFilter --|> AbstractFilter
|
|
||||||
DepositFilter --|> AbstractFilter
|
|
||||||
NameFilter --|> AbstractFilter
|
|
||||||
OrderFilter --|> AbstractFilter
|
|
||||||
@enduml
|
|
@ -1,52 +0,0 @@
|
|||||||
@startuml
|
|
||||||
left to right direction
|
|
||||||
package com.iluwatar.interpreter {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ getOperatorInstance(s : String, left : Expression, right : Expression) : Expression {static}
|
|
||||||
+ isOperator(s : String) : boolean {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
abstract class Expression {
|
|
||||||
+ Expression()
|
|
||||||
+ interpret() : int {abstract}
|
|
||||||
+ toString() : String {abstract}
|
|
||||||
}
|
|
||||||
class MinusExpression {
|
|
||||||
- leftExpression : Expression
|
|
||||||
- rightExpression : Expression
|
|
||||||
+ MinusExpression(leftExpression : Expression, rightExpression : Expression)
|
|
||||||
+ interpret() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class MultiplyExpression {
|
|
||||||
- leftExpression : Expression
|
|
||||||
- rightExpression : Expression
|
|
||||||
+ MultiplyExpression(leftExpression : Expression, rightExpression : Expression)
|
|
||||||
+ interpret() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class NumberExpression {
|
|
||||||
- number : int
|
|
||||||
+ NumberExpression(number : int)
|
|
||||||
+ NumberExpression(s : String)
|
|
||||||
+ interpret() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class PlusExpression {
|
|
||||||
- leftExpression : Expression
|
|
||||||
- rightExpression : Expression
|
|
||||||
+ PlusExpression(leftExpression : Expression, rightExpression : Expression)
|
|
||||||
+ interpret() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MultiplyExpression --> "-leftExpression" Expression
|
|
||||||
MinusExpression --> "-leftExpression" Expression
|
|
||||||
PlusExpression --> "-leftExpression" Expression
|
|
||||||
MinusExpression --|> Expression
|
|
||||||
MultiplyExpression --|> Expression
|
|
||||||
NumberExpression --|> Expression
|
|
||||||
PlusExpression --|> Expression
|
|
||||||
@enduml
|
|
@ -1,49 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.iterator {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Item {
|
|
||||||
- name : String
|
|
||||||
- type : ItemType
|
|
||||||
+ Item(type : ItemType, name : String)
|
|
||||||
+ getType() : ItemType
|
|
||||||
+ setType(type : ItemType)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface ItemIterator {
|
|
||||||
+ hasNext() : boolean {abstract}
|
|
||||||
+ next() : Item {abstract}
|
|
||||||
}
|
|
||||||
enum ItemType {
|
|
||||||
+ ANY {static}
|
|
||||||
+ POTION {static}
|
|
||||||
+ RING {static}
|
|
||||||
+ WEAPON {static}
|
|
||||||
+ valueOf(name : String) : ItemType {static}
|
|
||||||
+ values() : ItemType[] {static}
|
|
||||||
}
|
|
||||||
class TreasureChest {
|
|
||||||
- items : List<Item>
|
|
||||||
+ TreasureChest()
|
|
||||||
+ getItems() : List<Item>
|
|
||||||
~ iterator(itemType : ItemType) : ItemIterator
|
|
||||||
}
|
|
||||||
class TreasureChestItemIterator {
|
|
||||||
- chest : TreasureChest
|
|
||||||
- idx : int
|
|
||||||
- type : ItemType
|
|
||||||
+ TreasureChestItemIterator(chest : TreasureChest, type : ItemType)
|
|
||||||
- findNextIdx() : int
|
|
||||||
+ hasNext() : boolean
|
|
||||||
+ next() : Item
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Item --> "-type" ItemType
|
|
||||||
TreasureChest --> "-items" Item
|
|
||||||
TreasureChestItemIterator --> "-type" ItemType
|
|
||||||
TreasureChestItemIterator --> "-chest" TreasureChest
|
|
||||||
TreasureChestItemIterator ..|> ItemIterator
|
|
||||||
@enduml
|
|
@ -1,126 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.layers {
|
|
||||||
class App {
|
|
||||||
- cakeBakingService : CakeBakingService {static}
|
|
||||||
+ App()
|
|
||||||
- initializeData(cakeBakingService : CakeBakingService) {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Cake {
|
|
||||||
- id : Long
|
|
||||||
- layers : Set<CakeLayer>
|
|
||||||
- topping : CakeTopping
|
|
||||||
+ Cake()
|
|
||||||
+ addLayer(layer : CakeLayer)
|
|
||||||
+ getId() : Long
|
|
||||||
+ getLayers() : Set<CakeLayer>
|
|
||||||
+ getTopping() : CakeTopping
|
|
||||||
+ setId(id : Long)
|
|
||||||
+ setLayers(layers : Set<CakeLayer>)
|
|
||||||
+ setTopping(topping : CakeTopping)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface CakeBakingService {
|
|
||||||
+ bakeNewCake(CakeInfo) {abstract}
|
|
||||||
+ getAllCakes() : List<CakeInfo> {abstract}
|
|
||||||
+ getAvailableLayers() : List<CakeLayerInfo> {abstract}
|
|
||||||
+ getAvailableToppings() : List<CakeToppingInfo> {abstract}
|
|
||||||
+ saveNewLayer(CakeLayerInfo) {abstract}
|
|
||||||
+ saveNewTopping(CakeToppingInfo) {abstract}
|
|
||||||
}
|
|
||||||
class CakeBakingServiceImpl {
|
|
||||||
- context : AbstractApplicationContext
|
|
||||||
+ CakeBakingServiceImpl()
|
|
||||||
+ bakeNewCake(cakeInfo : CakeInfo)
|
|
||||||
+ getAllCakes() : List<CakeInfo>
|
|
||||||
- getAvailableLayerEntities() : List<CakeLayer>
|
|
||||||
+ getAvailableLayers() : List<CakeLayerInfo>
|
|
||||||
- getAvailableToppingEntities() : List<CakeTopping>
|
|
||||||
+ getAvailableToppings() : List<CakeToppingInfo>
|
|
||||||
+ saveNewLayer(layerInfo : CakeLayerInfo)
|
|
||||||
+ saveNewTopping(toppingInfo : CakeToppingInfo)
|
|
||||||
}
|
|
||||||
interface CakeDao {
|
|
||||||
}
|
|
||||||
class CakeInfo {
|
|
||||||
+ cakeLayerInfos : List<CakeLayerInfo>
|
|
||||||
+ cakeToppingInfo : CakeToppingInfo
|
|
||||||
+ id : Optional<Long>
|
|
||||||
+ CakeInfo(cakeToppingInfo : CakeToppingInfo, cakeLayerInfos : List<CakeLayerInfo>)
|
|
||||||
+ CakeInfo(id : Long, cakeToppingInfo : CakeToppingInfo, cakeLayerInfos : List<CakeLayerInfo>)
|
|
||||||
+ calculateTotalCalories() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class CakeLayer {
|
|
||||||
- cake : Cake
|
|
||||||
- calories : int
|
|
||||||
- id : Long
|
|
||||||
- name : String
|
|
||||||
+ CakeLayer()
|
|
||||||
+ CakeLayer(name : String, calories : int)
|
|
||||||
+ getCake() : Cake
|
|
||||||
+ getCalories() : int
|
|
||||||
+ getId() : Long
|
|
||||||
+ getName() : String
|
|
||||||
+ setCake(cake : Cake)
|
|
||||||
+ setCalories(calories : int)
|
|
||||||
+ setId(id : Long)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface CakeLayerDao {
|
|
||||||
}
|
|
||||||
class CakeLayerInfo {
|
|
||||||
+ calories : int
|
|
||||||
+ id : Optional<Long>
|
|
||||||
+ name : String
|
|
||||||
+ CakeLayerInfo(id : Long, name : String, calories : int)
|
|
||||||
+ CakeLayerInfo(name : String, calories : int)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class CakeTopping {
|
|
||||||
- cake : Cake
|
|
||||||
- calories : int
|
|
||||||
- id : Long
|
|
||||||
- name : String
|
|
||||||
+ CakeTopping()
|
|
||||||
+ CakeTopping(name : String, calories : int)
|
|
||||||
+ getCake() : Cake
|
|
||||||
+ getCalories() : int
|
|
||||||
+ getId() : Long
|
|
||||||
+ getName() : String
|
|
||||||
+ setCake(cake : Cake)
|
|
||||||
+ setCalories(calories : int)
|
|
||||||
+ setId(id : Long)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface CakeToppingDao {
|
|
||||||
}
|
|
||||||
class CakeToppingInfo {
|
|
||||||
+ calories : int
|
|
||||||
+ id : Optional<Long>
|
|
||||||
+ name : String
|
|
||||||
+ CakeToppingInfo(id : Long, name : String, calories : int)
|
|
||||||
+ CakeToppingInfo(name : String, calories : int)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class CakeViewImpl {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- cakeBakingService : CakeBakingService
|
|
||||||
+ CakeViewImpl(cakeBakingService : CakeBakingService)
|
|
||||||
+ render()
|
|
||||||
}
|
|
||||||
interface View {
|
|
||||||
+ render() {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CakeViewImpl --> "-cakeBakingService" CakeBakingService
|
|
||||||
CakeInfo --> "-cakeToppingInfo" CakeToppingInfo
|
|
||||||
CakeInfo --> "-cakeLayerInfos" CakeLayerInfo
|
|
||||||
App --> "-cakeBakingService" CakeBakingService
|
|
||||||
CakeLayer --> "-cake" Cake
|
|
||||||
Cake --> "-topping" CakeTopping
|
|
||||||
CakeBakingServiceImpl ..|> CakeBakingService
|
|
||||||
CakeViewImpl ..|> View
|
|
||||||
@enduml
|
|
@ -1,40 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.lazy.loading {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Heavy {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ Heavy()
|
|
||||||
}
|
|
||||||
class HolderNaive {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- heavy : Heavy
|
|
||||||
+ HolderNaive()
|
|
||||||
+ getHeavy() : Heavy
|
|
||||||
}
|
|
||||||
class HolderThreadSafe {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- heavy : Heavy
|
|
||||||
+ HolderThreadSafe()
|
|
||||||
+ getHeavy() : Heavy
|
|
||||||
}
|
|
||||||
class Java8Holder {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- heavy : Supplier<Heavy>
|
|
||||||
+ Java8Holder()
|
|
||||||
- createAndCacheHeavy() : Heavy
|
|
||||||
+ getHeavy() : Heavy
|
|
||||||
}
|
|
||||||
~class HeavyFactory {
|
|
||||||
- heavyInstance : Heavy
|
|
||||||
~ HeavyFactory()
|
|
||||||
+ get() : Heavy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HolderThreadSafe --> "-heavy" Heavy
|
|
||||||
HolderNaive --> "-heavy" Heavy
|
|
||||||
HeavyFactory --> "-heavyInstance" Heavy
|
|
||||||
@enduml
|
|
@ -1,2 +0,0 @@
|
|||||||
@startuml
|
|
||||||
@enduml
|
|
@ -1,69 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.mediator {
|
|
||||||
enum Action {
|
|
||||||
+ ENEMY {static}
|
|
||||||
+ GOLD {static}
|
|
||||||
+ HUNT {static}
|
|
||||||
+ NONE {static}
|
|
||||||
+ TALE {static}
|
|
||||||
- description : String
|
|
||||||
- title : String
|
|
||||||
+ getDescription() : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Action {static}
|
|
||||||
+ values() : Action[] {static}
|
|
||||||
}
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Hobbit {
|
|
||||||
+ Hobbit()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class Hunter {
|
|
||||||
+ Hunter()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface Party {
|
|
||||||
+ act(PartyMember, Action) {abstract}
|
|
||||||
+ addMember(PartyMember) {abstract}
|
|
||||||
}
|
|
||||||
class PartyImpl {
|
|
||||||
- members : List<PartyMember>
|
|
||||||
+ PartyImpl()
|
|
||||||
+ act(actor : PartyMember, action : Action)
|
|
||||||
+ addMember(member : PartyMember)
|
|
||||||
}
|
|
||||||
interface PartyMember {
|
|
||||||
+ act(Action) {abstract}
|
|
||||||
+ joinedParty(Party) {abstract}
|
|
||||||
+ partyAction(Action) {abstract}
|
|
||||||
}
|
|
||||||
abstract class PartyMemberBase {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
# party : Party
|
|
||||||
+ PartyMemberBase()
|
|
||||||
+ act(action : Action)
|
|
||||||
+ joinedParty(party : Party)
|
|
||||||
+ partyAction(action : Action)
|
|
||||||
+ toString() : String {abstract}
|
|
||||||
}
|
|
||||||
class Rogue {
|
|
||||||
+ Rogue()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class Wizard {
|
|
||||||
+ Wizard()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PartyImpl --> "-members" PartyMember
|
|
||||||
PartyMemberBase --> "-party" Party
|
|
||||||
Hobbit --|> PartyMemberBase
|
|
||||||
Hunter --|> PartyMemberBase
|
|
||||||
PartyImpl ..|> Party
|
|
||||||
PartyMemberBase ..|> PartyMember
|
|
||||||
Rogue --|> PartyMemberBase
|
|
||||||
Wizard --|> PartyMemberBase
|
|
||||||
@enduml
|
|
@ -1,49 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.memento {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Star {
|
|
||||||
- ageYears : int
|
|
||||||
- massTons : int
|
|
||||||
- type : StarType
|
|
||||||
+ Star(startType : StarType, startAge : int, startMass : int)
|
|
||||||
~ getMemento() : StarMemento
|
|
||||||
~ setMemento(memento : StarMemento)
|
|
||||||
+ timePasses()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
-class StarMementoInternal {
|
|
||||||
- ageYears : int
|
|
||||||
- massTons : int
|
|
||||||
- type : StarType
|
|
||||||
- StarMementoInternal()
|
|
||||||
+ getAgeYears() : int
|
|
||||||
+ getMassTons() : int
|
|
||||||
+ getType() : StarType
|
|
||||||
+ setAgeYears(ageYears : int)
|
|
||||||
+ setMassTons(massTons : int)
|
|
||||||
+ setType(type : StarType)
|
|
||||||
}
|
|
||||||
interface StarMemento {
|
|
||||||
}
|
|
||||||
enum StarType {
|
|
||||||
+ DEAD {static}
|
|
||||||
+ RED_GIANT {static}
|
|
||||||
+ SUN {static}
|
|
||||||
+ SUPERNOVA {static}
|
|
||||||
+ UNDEFINED {static}
|
|
||||||
+ WHITE_DWARF {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : StarType {static}
|
|
||||||
+ values() : StarType[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
StarMementoInternal --> "-type" StarType
|
|
||||||
Star --> "-type" StarType
|
|
||||||
StarMementoInternal ..+ Star
|
|
||||||
StarMementoInternal ..|> StarMemento
|
|
||||||
@enduml
|
|
@ -1,9 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.message.channel {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,70 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.model.view.controller {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
enum Fatigue {
|
|
||||||
+ ALERT {static}
|
|
||||||
+ SLEEPING {static}
|
|
||||||
+ TIRED {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Fatigue {static}
|
|
||||||
+ values() : Fatigue[] {static}
|
|
||||||
}
|
|
||||||
class GiantController {
|
|
||||||
- giant : GiantModel
|
|
||||||
- view : GiantView
|
|
||||||
+ GiantController(giant : GiantModel, view : GiantView)
|
|
||||||
+ getFatigue() : Fatigue
|
|
||||||
+ getHealth() : Health
|
|
||||||
+ getNourishment() : Nourishment
|
|
||||||
+ setFatigue(fatigue : Fatigue)
|
|
||||||
+ setHealth(health : Health)
|
|
||||||
+ setNourishment(nourishment : Nourishment)
|
|
||||||
+ updateView()
|
|
||||||
}
|
|
||||||
class GiantModel {
|
|
||||||
- fatigue : Fatigue
|
|
||||||
- health : Health
|
|
||||||
- nourishment : Nourishment
|
|
||||||
~ GiantModel(health : Health, fatigue : Fatigue, nourishment : Nourishment)
|
|
||||||
+ getFatigue() : Fatigue
|
|
||||||
+ getHealth() : Health
|
|
||||||
+ getNourishment() : Nourishment
|
|
||||||
+ setFatigue(fatigue : Fatigue)
|
|
||||||
+ setHealth(health : Health)
|
|
||||||
+ setNourishment(nourishment : Nourishment)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class GiantView {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ GiantView()
|
|
||||||
+ displayGiant(giant : GiantModel)
|
|
||||||
}
|
|
||||||
enum Health {
|
|
||||||
+ DEAD {static}
|
|
||||||
+ HEALTHY {static}
|
|
||||||
+ WOUNDED {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Health {static}
|
|
||||||
+ values() : Health[] {static}
|
|
||||||
}
|
|
||||||
enum Nourishment {
|
|
||||||
+ HUNGRY {static}
|
|
||||||
+ SATURATED {static}
|
|
||||||
+ STARVING {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Nourishment {static}
|
|
||||||
+ values() : Nourishment[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GiantModel --> "-nourishment" Nourishment
|
|
||||||
GiantController --> "-giant" GiantModel
|
|
||||||
GiantModel --> "-fatigue" Fatigue
|
|
||||||
GiantModel --> "-health" Health
|
|
||||||
GiantController --> "-view" GiantView
|
|
||||||
@enduml
|
|
@ -1,87 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.model.view.presenter {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class FileLoader {
|
|
||||||
- fileName : String
|
|
||||||
- loaded : boolean
|
|
||||||
+ FileLoader()
|
|
||||||
+ fileExists() : boolean
|
|
||||||
+ getFileName() : String
|
|
||||||
+ isLoaded() : boolean
|
|
||||||
+ loadData() : String
|
|
||||||
+ setFileName(fileName : String)
|
|
||||||
}
|
|
||||||
class FileSelectorJFrame {
|
|
||||||
- area : JTextArea
|
|
||||||
- cancel : JButton
|
|
||||||
- contents : JLabel
|
|
||||||
- fileName : String
|
|
||||||
- info : JLabel
|
|
||||||
- input : JTextField
|
|
||||||
- ok : JButton
|
|
||||||
- panel : JPanel
|
|
||||||
- presenter : FileSelectorPresenter
|
|
||||||
- serialVersionUID : long {static}
|
|
||||||
+ FileSelectorJFrame()
|
|
||||||
+ actionPerformed(e : ActionEvent)
|
|
||||||
+ close()
|
|
||||||
+ displayData(data : String)
|
|
||||||
+ getFileName() : String
|
|
||||||
+ getPresenter() : FileSelectorPresenter
|
|
||||||
+ isOpened() : boolean
|
|
||||||
+ open()
|
|
||||||
+ setFileName(name : String)
|
|
||||||
+ setPresenter(presenter : FileSelectorPresenter)
|
|
||||||
+ showMessage(message : String)
|
|
||||||
}
|
|
||||||
class FileSelectorPresenter {
|
|
||||||
- loader : FileLoader
|
|
||||||
- view : FileSelectorView
|
|
||||||
+ FileSelectorPresenter(view : FileSelectorView)
|
|
||||||
+ cancelled()
|
|
||||||
+ confirmed()
|
|
||||||
+ fileNameChanged()
|
|
||||||
+ setLoader(loader : FileLoader)
|
|
||||||
+ start()
|
|
||||||
}
|
|
||||||
class FileSelectorStub {
|
|
||||||
- dataDisplayed : boolean
|
|
||||||
- name : String
|
|
||||||
- numOfMessageSent : int
|
|
||||||
- opened : boolean
|
|
||||||
- presenter : FileSelectorPresenter
|
|
||||||
+ FileSelectorStub()
|
|
||||||
+ close()
|
|
||||||
+ dataDisplayed() : boolean
|
|
||||||
+ displayData(data : String)
|
|
||||||
+ getFileName() : String
|
|
||||||
+ getMessagesSent() : int
|
|
||||||
+ getPresenter() : FileSelectorPresenter
|
|
||||||
+ isOpened() : boolean
|
|
||||||
+ open()
|
|
||||||
+ setFileName(name : String)
|
|
||||||
+ setPresenter(presenter : FileSelectorPresenter)
|
|
||||||
+ showMessage(message : String)
|
|
||||||
}
|
|
||||||
interface FileSelectorView {
|
|
||||||
+ close() {abstract}
|
|
||||||
+ displayData(String) {abstract}
|
|
||||||
+ getFileName() : String {abstract}
|
|
||||||
+ getPresenter() : FileSelectorPresenter {abstract}
|
|
||||||
+ isOpened() : boolean {abstract}
|
|
||||||
+ open() {abstract}
|
|
||||||
+ setFileName(String) {abstract}
|
|
||||||
+ setPresenter(FileSelectorPresenter) {abstract}
|
|
||||||
+ showMessage(String) {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FileSelectorStub --> "-presenter" FileSelectorPresenter
|
|
||||||
FileSelectorJFrame --> "-presenter" FileSelectorPresenter
|
|
||||||
FileSelectorPresenter --> "-loader" FileLoader
|
|
||||||
FileSelectorPresenter --> "-view" FileSelectorView
|
|
||||||
FileSelectorJFrame ..|> FileSelectorView
|
|
||||||
FileSelectorStub ..|> FileSelectorView
|
|
||||||
@enduml
|
|
@ -1,43 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.module {
|
|
||||||
class App {
|
|
||||||
+ consoleLoggerModule : ConsoleLoggerModule {static}
|
|
||||||
+ fileLoggerModule : FileLoggerModule {static}
|
|
||||||
- App()
|
|
||||||
+ execute(args : String[]) {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
+ prepare() {static}
|
|
||||||
+ unprepare() {static}
|
|
||||||
}
|
|
||||||
class ConsoleLoggerModule {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ error : PrintStream
|
|
||||||
+ output : PrintStream
|
|
||||||
- singleton : ConsoleLoggerModule {static}
|
|
||||||
- ConsoleLoggerModule()
|
|
||||||
+ getSingleton() : ConsoleLoggerModule {static}
|
|
||||||
+ prepare() : ConsoleLoggerModule
|
|
||||||
+ printErrorString(value : String)
|
|
||||||
+ printString(value : String)
|
|
||||||
+ unprepare()
|
|
||||||
}
|
|
||||||
class FileLoggerModule {
|
|
||||||
- ERROR_FILE : String {static}
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- OUTPUT_FILE : String {static}
|
|
||||||
+ error : PrintStream
|
|
||||||
+ output : PrintStream
|
|
||||||
- singleton : FileLoggerModule {static}
|
|
||||||
- FileLoggerModule()
|
|
||||||
+ getSingleton() : FileLoggerModule {static}
|
|
||||||
+ prepare() : FileLoggerModule
|
|
||||||
+ printErrorString(value : String)
|
|
||||||
+ printString(value : String)
|
|
||||||
+ unprepare()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FileLoggerModule --> "-singleton" FileLoggerModule
|
|
||||||
App --> "-consoleLoggerModule" ConsoleLoggerModule
|
|
||||||
ConsoleLoggerModule --> "-singleton" ConsoleLoggerModule
|
|
||||||
App --> "-fileLoggerModule" FileLoggerModule
|
|
||||||
@enduml
|
|
@ -1,36 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.monad {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
enum Sex {
|
|
||||||
+ FEMALE {static}
|
|
||||||
+ MALE {static}
|
|
||||||
+ valueOf(name : String) : Sex {static}
|
|
||||||
+ values() : Sex[] {static}
|
|
||||||
}
|
|
||||||
class User {
|
|
||||||
- age : int
|
|
||||||
- email : String
|
|
||||||
- name : String
|
|
||||||
- sex : Sex
|
|
||||||
+ User(name : String, age : int, sex : Sex, email : String)
|
|
||||||
+ getAge() : int
|
|
||||||
+ getEmail() : String
|
|
||||||
+ getName() : String
|
|
||||||
+ getSex() : Sex
|
|
||||||
}
|
|
||||||
class Validator<T> {
|
|
||||||
- exceptions : List<Throwable>
|
|
||||||
- t : T
|
|
||||||
- Validator<T>(t : T)
|
|
||||||
+ get() : T
|
|
||||||
+ of(t : T) : Validator<T> {static}
|
|
||||||
+ validate(projection : Function<T, U>, validation : Predicate<U>, message : String) : Validator<T>
|
|
||||||
+ validate(validation : Predicate<T>, message : String) : Validator<T>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
User --> "-sex" Sex
|
|
||||||
@enduml
|
|
@ -1,33 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.monostate {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class LoadBalancer {
|
|
||||||
- id : int {static}
|
|
||||||
- lastServedId : int {static}
|
|
||||||
- servers : List<Server> {static}
|
|
||||||
+ LoadBalancer()
|
|
||||||
+ addServer(server : Server)
|
|
||||||
+ getLastServedId() : int {static}
|
|
||||||
+ getNoOfServers() : int
|
|
||||||
+ serverRequest(request : Request)
|
|
||||||
}
|
|
||||||
class Request {
|
|
||||||
+ value : String
|
|
||||||
+ Request(value : String)
|
|
||||||
}
|
|
||||||
class Server {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ host : String
|
|
||||||
+ id : int
|
|
||||||
+ port : int
|
|
||||||
+ Server(host : String, port : int, id : int)
|
|
||||||
+ getHost() : String
|
|
||||||
+ getPort() : int
|
|
||||||
+ serve(request : Request)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LoadBalancer --> "-servers" Server
|
|
||||||
@enduml
|
|
@ -1,30 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.multiton {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Nazgul {
|
|
||||||
- name : NazgulName
|
|
||||||
- nazguls : Map<NazgulName, Nazgul> {static}
|
|
||||||
- Nazgul(name : NazgulName)
|
|
||||||
+ getInstance(name : NazgulName) : Nazgul {static}
|
|
||||||
+ getName() : NazgulName
|
|
||||||
}
|
|
||||||
enum NazgulName {
|
|
||||||
+ ADUNAPHEL {static}
|
|
||||||
+ AKHORAHIL {static}
|
|
||||||
+ DWAR {static}
|
|
||||||
+ HOARMURATH {static}
|
|
||||||
+ JI_INDUR {static}
|
|
||||||
+ KHAMUL {static}
|
|
||||||
+ MURAZOR {static}
|
|
||||||
+ REN {static}
|
|
||||||
+ UVATHA {static}
|
|
||||||
+ valueOf(name : String) : NazgulName {static}
|
|
||||||
+ values() : NazgulName[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Nazgul --> "-name" NazgulName
|
|
||||||
@enduml
|
|
@ -1,24 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.mute {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
- acquireResource() : Resource {static}
|
|
||||||
- closeResource(resource : Resource) {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- useOfLoggedMute() {static}
|
|
||||||
- useOfMute() {static}
|
|
||||||
- utilizeResource(resource : Resource) {static}
|
|
||||||
}
|
|
||||||
interface CheckedRunnable {
|
|
||||||
+ run() {abstract}
|
|
||||||
}
|
|
||||||
class Mute {
|
|
||||||
- Mute()
|
|
||||||
+ loggedMute(runnable : CheckedRunnable) {static}
|
|
||||||
+ mute(runnable : CheckedRunnable) {static}
|
|
||||||
}
|
|
||||||
interface Resource {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,27 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.mutex {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Jar {
|
|
||||||
- beans : int
|
|
||||||
- lock : Lock
|
|
||||||
+ Jar(beans : int, lock : Lock)
|
|
||||||
+ takeBean() : boolean
|
|
||||||
}
|
|
||||||
interface Lock {
|
|
||||||
+ acquire() {abstract}
|
|
||||||
+ release() {abstract}
|
|
||||||
}
|
|
||||||
class Mutex {
|
|
||||||
- owner : Object
|
|
||||||
+ Mutex()
|
|
||||||
+ acquire()
|
|
||||||
+ getOwner() : Object
|
|
||||||
+ release()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Jar --> "-lock" Lock
|
|
||||||
Mutex ..|> Lock
|
|
||||||
@enduml
|
|
@ -1,39 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package domainapp.dom.app.homepage {
|
|
||||||
class HomePageService {
|
|
||||||
~ container : DomainObjectContainer
|
|
||||||
+ HomePageService()
|
|
||||||
+ homePage() : HomePageViewModel
|
|
||||||
}
|
|
||||||
class HomePageViewModel {
|
|
||||||
~ simpleObjects : SimpleObjects
|
|
||||||
+ HomePageViewModel()
|
|
||||||
+ getObjects() : List<SimpleObject>
|
|
||||||
+ title() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package domainapp.dom.modules.simple {
|
|
||||||
class SimpleObject {
|
|
||||||
- container : DomainObjectContainer
|
|
||||||
- name : String
|
|
||||||
+ SimpleObject()
|
|
||||||
+ compareTo(other : SimpleObject) : int
|
|
||||||
+ default0UpdateName() : String
|
|
||||||
+ getName() : String
|
|
||||||
+ getVersionSequence() : Long
|
|
||||||
+ setName(name : String)
|
|
||||||
+ title() : TranslatableString
|
|
||||||
+ updateName(name : String) : SimpleObject
|
|
||||||
+ validateUpdateName(name : String) : TranslatableString
|
|
||||||
}
|
|
||||||
class SimpleObjects {
|
|
||||||
~ container : DomainObjectContainer
|
|
||||||
+ SimpleObjects()
|
|
||||||
+ create(name : String) : SimpleObject
|
|
||||||
+ findByName(name : String) : List<SimpleObject>
|
|
||||||
+ listAll() : List<SimpleObject>
|
|
||||||
+ title() : TranslatableString
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HomePageViewModel --> "-simpleObjects" SimpleObjects
|
|
||||||
@enduml
|
|
@ -1,93 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package domainapp.dom.app.homepage {
|
|
||||||
class HomePageService {
|
|
||||||
~ container : DomainObjectContainer
|
|
||||||
+ HomePageService()
|
|
||||||
+ homePage() : HomePageViewModel
|
|
||||||
}
|
|
||||||
class HomePageViewModel {
|
|
||||||
~ simpleObjects : SimpleObjects
|
|
||||||
+ HomePageViewModel()
|
|
||||||
+ getObjects() : List<SimpleObject>
|
|
||||||
+ title() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package domainapp.dom.modules.simple {
|
|
||||||
class SimpleObject {
|
|
||||||
- container : DomainObjectContainer
|
|
||||||
- dnFieldFlags : byte[] {static}
|
|
||||||
- dnFieldNames : String[] {static}
|
|
||||||
- dnFieldTypes : Class[] {static}
|
|
||||||
# dnFlags : byte
|
|
||||||
- dnInheritedFieldCount : int {static}
|
|
||||||
- dnPersistableSuperclass : Class<T> {static}
|
|
||||||
# dnStateManager : StateManager
|
|
||||||
- name : String
|
|
||||||
+ SimpleObject()
|
|
||||||
+ ___dn$loadClass(className : String) : Class<T> {static}
|
|
||||||
- __dnFieldFlagsInit() : byte[] {static}
|
|
||||||
- __dnFieldNamesInit() : String[] {static}
|
|
||||||
- __dnFieldTypesInit() : Class[] {static}
|
|
||||||
# __dnGetInheritedFieldCount() : int {static}
|
|
||||||
- __dnPersistableSuperclassInit() : Class<T> {static}
|
|
||||||
+ compareTo(other : SimpleObject) : int
|
|
||||||
+ default0UpdateName() : String
|
|
||||||
# dnCopyField(obj : SimpleObject, index : int)
|
|
||||||
+ dnCopyFields(obj : Object, indices : int[])
|
|
||||||
+ dnCopyKeyFieldsFromObjectId(fc : ObjectIdFieldConsumer, oid : Object)
|
|
||||||
# dnCopyKeyFieldsFromObjectId(oid : Object)
|
|
||||||
+ dnCopyKeyFieldsToObjectId(fs : ObjectIdFieldSupplier, oid : Object)
|
|
||||||
+ dnCopyKeyFieldsToObjectId(oid : Object)
|
|
||||||
+ dnGetExecutionContext() : ExecutionContextReference
|
|
||||||
# dnGetManagedFieldCount() : int {static}
|
|
||||||
+ dnGetObjectId() : Object
|
|
||||||
+ dnGetTransactionalObjectId() : Object
|
|
||||||
+ dnGetVersion() : Object
|
|
||||||
+ dnGetname() : String
|
|
||||||
+ dnIsDeleted() : boolean
|
|
||||||
+ dnIsDetached() : boolean
|
|
||||||
+ dnIsDirty() : boolean
|
|
||||||
+ dnIsNew() : boolean
|
|
||||||
+ dnIsPersistent() : boolean
|
|
||||||
+ dnIsTransactional() : boolean
|
|
||||||
+ dnMakeDirty(fieldName : String)
|
|
||||||
+ dnNewInstance(sm : StateManager) : Persistable
|
|
||||||
+ dnNewInstance(sm : StateManager, obj : Object) : Persistable
|
|
||||||
+ dnNewObjectIdInstance() : Object
|
|
||||||
+ dnNewObjectIdInstance(key : Object) : Object
|
|
||||||
# dnPreSerialize()
|
|
||||||
+ dnProvideField(index : int)
|
|
||||||
+ dnProvideFields(indices : int[])
|
|
||||||
+ dnReplaceField(index : int)
|
|
||||||
+ dnReplaceFields(indices : int[])
|
|
||||||
+ dnReplaceFlags()
|
|
||||||
+ dnReplaceStateManager(sm : StateManager)
|
|
||||||
+ dnSetname(name : String)
|
|
||||||
- dnSuperClone() : Object
|
|
||||||
+ getName() : String
|
|
||||||
+ getVersionSequence() : Long
|
|
||||||
+ setName(val : String)
|
|
||||||
+ title() : TranslatableString
|
|
||||||
+ updateName(name : String) : SimpleObject
|
|
||||||
+ validateUpdateName(name : String) : TranslatableString
|
|
||||||
}
|
|
||||||
class SimpleObjects {
|
|
||||||
~ container : DomainObjectContainer
|
|
||||||
+ SimpleObjects()
|
|
||||||
+ create(name : String) : SimpleObject
|
|
||||||
+ findByName(name : String) : List<SimpleObject>
|
|
||||||
+ listAll() : List<SimpleObject>
|
|
||||||
+ title() : TranslatableString
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package domainapp.fixture {
|
|
||||||
class DomainAppFixturesProvider {
|
|
||||||
+ DomainAppFixturesProvider()
|
|
||||||
+ getSpecification() : FixtureScriptsSpecification
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Builder ..+ FixtureScriptsSpecification
|
|
||||||
DropDownPolicy ..+ FixtureScriptsSpecification
|
|
||||||
MultipleExecutionStrategy ..+ FixtureScripts
|
|
||||||
HomePageViewModel --> "-simpleObjects" SimpleObjects
|
|
||||||
@enduml
|
|
@ -1,93 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package domainapp.dom.app.homepage {
|
|
||||||
class HomePageService {
|
|
||||||
~ container : DomainObjectContainer
|
|
||||||
+ HomePageService()
|
|
||||||
+ homePage() : HomePageViewModel
|
|
||||||
}
|
|
||||||
class HomePageViewModel {
|
|
||||||
~ simpleObjects : SimpleObjects
|
|
||||||
+ HomePageViewModel()
|
|
||||||
+ getObjects() : List<SimpleObject>
|
|
||||||
+ title() : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package domainapp.dom.modules.simple {
|
|
||||||
class SimpleObject {
|
|
||||||
- container : DomainObjectContainer
|
|
||||||
- dnFieldFlags : byte[] {static}
|
|
||||||
- dnFieldNames : String[] {static}
|
|
||||||
- dnFieldTypes : Class[] {static}
|
|
||||||
# dnFlags : byte
|
|
||||||
- dnInheritedFieldCount : int {static}
|
|
||||||
- dnPersistableSuperclass : Class<T> {static}
|
|
||||||
# dnStateManager : StateManager
|
|
||||||
- name : String
|
|
||||||
+ SimpleObject()
|
|
||||||
+ ___dn$loadClass(className : String) : Class<T> {static}
|
|
||||||
- __dnFieldFlagsInit() : byte[] {static}
|
|
||||||
- __dnFieldNamesInit() : String[] {static}
|
|
||||||
- __dnFieldTypesInit() : Class[] {static}
|
|
||||||
# __dnGetInheritedFieldCount() : int {static}
|
|
||||||
- __dnPersistableSuperclassInit() : Class<T> {static}
|
|
||||||
+ compareTo(other : SimpleObject) : int
|
|
||||||
+ default0UpdateName() : String
|
|
||||||
# dnCopyField(obj : SimpleObject, index : int)
|
|
||||||
+ dnCopyFields(obj : Object, indices : int[])
|
|
||||||
+ dnCopyKeyFieldsFromObjectId(fc : ObjectIdFieldConsumer, oid : Object)
|
|
||||||
# dnCopyKeyFieldsFromObjectId(oid : Object)
|
|
||||||
+ dnCopyKeyFieldsToObjectId(fs : ObjectIdFieldSupplier, oid : Object)
|
|
||||||
+ dnCopyKeyFieldsToObjectId(oid : Object)
|
|
||||||
+ dnGetExecutionContext() : ExecutionContextReference
|
|
||||||
# dnGetManagedFieldCount() : int {static}
|
|
||||||
+ dnGetObjectId() : Object
|
|
||||||
+ dnGetTransactionalObjectId() : Object
|
|
||||||
+ dnGetVersion() : Object
|
|
||||||
+ dnGetname() : String
|
|
||||||
+ dnIsDeleted() : boolean
|
|
||||||
+ dnIsDetached() : boolean
|
|
||||||
+ dnIsDirty() : boolean
|
|
||||||
+ dnIsNew() : boolean
|
|
||||||
+ dnIsPersistent() : boolean
|
|
||||||
+ dnIsTransactional() : boolean
|
|
||||||
+ dnMakeDirty(fieldName : String)
|
|
||||||
+ dnNewInstance(sm : StateManager) : Persistable
|
|
||||||
+ dnNewInstance(sm : StateManager, obj : Object) : Persistable
|
|
||||||
+ dnNewObjectIdInstance() : Object
|
|
||||||
+ dnNewObjectIdInstance(key : Object) : Object
|
|
||||||
# dnPreSerialize()
|
|
||||||
+ dnProvideField(index : int)
|
|
||||||
+ dnProvideFields(indices : int[])
|
|
||||||
+ dnReplaceField(index : int)
|
|
||||||
+ dnReplaceFields(indices : int[])
|
|
||||||
+ dnReplaceFlags()
|
|
||||||
+ dnReplaceStateManager(sm : StateManager)
|
|
||||||
+ dnSetname(name : String)
|
|
||||||
- dnSuperClone() : Object
|
|
||||||
+ getName() : String
|
|
||||||
+ getVersionSequence() : Long
|
|
||||||
+ setName(val : String)
|
|
||||||
+ title() : TranslatableString
|
|
||||||
+ updateName(name : String) : SimpleObject
|
|
||||||
+ validateUpdateName(name : String) : TranslatableString
|
|
||||||
}
|
|
||||||
class SimpleObjects {
|
|
||||||
~ container : DomainObjectContainer
|
|
||||||
+ SimpleObjects()
|
|
||||||
+ create(name : String) : SimpleObject
|
|
||||||
+ findByName(name : String) : List<SimpleObject>
|
|
||||||
+ listAll() : List<SimpleObject>
|
|
||||||
+ title() : TranslatableString
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package domainapp.fixture {
|
|
||||||
class DomainAppFixturesProvider {
|
|
||||||
+ DomainAppFixturesProvider()
|
|
||||||
+ getSpecification() : FixtureScriptsSpecification
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Builder ..+ FixtureScriptsSpecification
|
|
||||||
DropDownPolicy ..+ FixtureScriptsSpecification
|
|
||||||
MultipleExecutionStrategy ..+ FixtureScripts
|
|
||||||
HomePageViewModel --> "-simpleObjects" SimpleObjects
|
|
||||||
@enduml
|
|
@ -317,23 +317,6 @@
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>com.github.markusmo3.urm</groupId>
|
|
||||||
<artifactId>urm-maven-plugin</artifactId>
|
|
||||||
<version>${urm.version}</version>
|
|
||||||
<configuration combine.self="override">
|
|
||||||
<outputDirectory>${project.basedir}/../etc</outputDirectory>
|
|
||||||
<packages>
|
|
||||||
<param>com.iluwatar</param>
|
|
||||||
<param>domainapp</param>
|
|
||||||
</packages>
|
|
||||||
<skipForProjects>
|
|
||||||
<!-- skip for parent project -->
|
|
||||||
<param>naked-objects</param>
|
|
||||||
<param>naked-objects-webapp</param>
|
|
||||||
</skipForProjects>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.nullobject {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
interface Node {
|
|
||||||
+ getLeft() : Node {abstract}
|
|
||||||
+ getName() : String {abstract}
|
|
||||||
+ getRight() : Node {abstract}
|
|
||||||
+ getTreeSize() : int {abstract}
|
|
||||||
+ walk() {abstract}
|
|
||||||
}
|
|
||||||
class NodeImpl {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- left : Node
|
|
||||||
- name : String
|
|
||||||
- right : Node
|
|
||||||
+ NodeImpl(name : String, left : Node, right : Node)
|
|
||||||
+ getLeft() : Node
|
|
||||||
+ getName() : String
|
|
||||||
+ getRight() : Node
|
|
||||||
+ getTreeSize() : int
|
|
||||||
+ walk()
|
|
||||||
}
|
|
||||||
class NullNode {
|
|
||||||
- instance : NullNode {static}
|
|
||||||
- NullNode()
|
|
||||||
+ getInstance() : NullNode {static}
|
|
||||||
+ getLeft() : Node
|
|
||||||
+ getName() : String
|
|
||||||
+ getRight() : Node
|
|
||||||
+ getTreeSize() : int
|
|
||||||
+ walk()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
NullNode --> "-instance" NullNode
|
|
||||||
NodeImpl --> "-left" Node
|
|
||||||
NodeImpl ..|> Node
|
|
||||||
NullNode ..|> Node
|
|
||||||
@enduml
|
|
@ -1,45 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.objectmother {
|
|
||||||
class King {
|
|
||||||
~ isDrunk : boolean
|
|
||||||
~ isHappy : boolean
|
|
||||||
+ King()
|
|
||||||
+ flirt(queen : Queen)
|
|
||||||
+ isHappy() : boolean
|
|
||||||
+ makeDrunk()
|
|
||||||
+ makeHappy()
|
|
||||||
+ makeSober()
|
|
||||||
+ makeUnhappy()
|
|
||||||
}
|
|
||||||
class Queen {
|
|
||||||
- isDrunk : boolean
|
|
||||||
- isFlirty : boolean
|
|
||||||
- isHappy : boolean
|
|
||||||
+ Queen()
|
|
||||||
+ getFlirted(king : King) : boolean
|
|
||||||
+ isFlirty() : boolean
|
|
||||||
+ makeDrunk()
|
|
||||||
+ makeHappy()
|
|
||||||
+ makeSober()
|
|
||||||
+ makeUnhappy()
|
|
||||||
+ setFlirtiness(flirtiness : boolean)
|
|
||||||
}
|
|
||||||
interface Royalty {
|
|
||||||
+ makeDrunk() {abstract}
|
|
||||||
+ makeHappy() {abstract}
|
|
||||||
+ makeSober() {abstract}
|
|
||||||
+ makeUnhappy() {abstract}
|
|
||||||
}
|
|
||||||
class RoyaltyObjectMother {
|
|
||||||
+ RoyaltyObjectMother()
|
|
||||||
+ createDrunkKing() : King {static}
|
|
||||||
+ createFlirtyQueen() : Queen {static}
|
|
||||||
+ createHappyDrunkKing() : King {static}
|
|
||||||
+ createHappyKing() : King {static}
|
|
||||||
+ createNotFlirtyQueen() : Queen {static}
|
|
||||||
+ createSoberUnhappyKing() : King {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
King ..|> Royalty
|
|
||||||
Queen ..|> Royalty
|
|
||||||
@enduml
|
|
@ -1,30 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.object.pool {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
abstract class ObjectPool<T> {
|
|
||||||
- available : Set<T>
|
|
||||||
- inUse : Set<T>
|
|
||||||
+ ObjectPool<T>()
|
|
||||||
+ checkIn(instance : T)
|
|
||||||
+ checkOut() : T
|
|
||||||
# create() : T {abstract}
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class Oliphaunt {
|
|
||||||
- counter : int {static}
|
|
||||||
- id : int
|
|
||||||
+ Oliphaunt()
|
|
||||||
+ getId() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class OliphauntPool {
|
|
||||||
+ OliphauntPool()
|
|
||||||
# create() : Oliphaunt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
OliphauntPool --|> ObjectPool
|
|
||||||
@enduml
|
|
@ -1,81 +0,0 @@
|
|||||||
@startuml
|
|
||||||
left to right direction
|
|
||||||
package com.iluwatar.observer {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Hobbits {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ Hobbits()
|
|
||||||
+ update(currentWeather : WeatherType)
|
|
||||||
}
|
|
||||||
class Orcs {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ Orcs()
|
|
||||||
+ update(currentWeather : WeatherType)
|
|
||||||
}
|
|
||||||
class Weather {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- currentWeather : WeatherType
|
|
||||||
- observers : List<WeatherObserver>
|
|
||||||
+ Weather()
|
|
||||||
+ addObserver(obs : WeatherObserver)
|
|
||||||
- notifyObservers()
|
|
||||||
+ removeObserver(obs : WeatherObserver)
|
|
||||||
+ timePasses()
|
|
||||||
}
|
|
||||||
interface WeatherObserver {
|
|
||||||
+ update(WeatherType) {abstract}
|
|
||||||
}
|
|
||||||
enum WeatherType {
|
|
||||||
+ COLD {static}
|
|
||||||
+ RAINY {static}
|
|
||||||
+ SUNNY {static}
|
|
||||||
+ WINDY {static}
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : WeatherType {static}
|
|
||||||
+ values() : WeatherType[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.observer.generic {
|
|
||||||
class GHobbits {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ GHobbits()
|
|
||||||
+ update(weather : GWeather, weatherType : WeatherType)
|
|
||||||
}
|
|
||||||
class GOrcs {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ GOrcs()
|
|
||||||
+ update(weather : GWeather, weatherType : WeatherType)
|
|
||||||
}
|
|
||||||
class GWeather {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- currentWeather : WeatherType
|
|
||||||
+ GWeather()
|
|
||||||
+ timePasses()
|
|
||||||
}
|
|
||||||
abstract class Observable<S extends Observable, O extends Observer<S, O, A>, A> {
|
|
||||||
# observers : List<O extends Observer<S, O, A>>
|
|
||||||
+ Observable<S extends Observable, O extends Observer<S, O, A>, A>()
|
|
||||||
+ addObserver(observer : O extends Observer<S, O, A>)
|
|
||||||
+ notifyObservers(argument : A)
|
|
||||||
+ removeObserver(observer : O extends Observer<S, O, A>)
|
|
||||||
}
|
|
||||||
interface Observer<S extends Observable<S, O, A>, O extends Observer, A> {
|
|
||||||
+ update(S extends Observable<S, O, A>, A) {abstract}
|
|
||||||
}
|
|
||||||
interface Race {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Weather --> "-currentWeather" WeatherType
|
|
||||||
GWeather --> "-currentWeather" WeatherType
|
|
||||||
Weather --> "-observers" WeatherObserver
|
|
||||||
Hobbits ..|> WeatherObserver
|
|
||||||
Orcs ..|> WeatherObserver
|
|
||||||
GHobbits ..|> Race
|
|
||||||
GOrcs ..|> Race
|
|
||||||
GWeather --|> Observable
|
|
||||||
Race --|> Observer
|
|
||||||
@enduml
|
|
@ -1,8 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.pageobject {
|
|
||||||
class App {
|
|
||||||
- App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,31 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.partialresponse {
|
|
||||||
class FieldJsonMapper {
|
|
||||||
+ FieldJsonMapper()
|
|
||||||
- getString(video : Video, declaredField : Field) : String
|
|
||||||
+ toJson(video : Video, fields : String[]) : String
|
|
||||||
}
|
|
||||||
class Video {
|
|
||||||
- description : String
|
|
||||||
- director : String
|
|
||||||
- id : Integer
|
|
||||||
- language : String
|
|
||||||
- length : Integer
|
|
||||||
- title : String
|
|
||||||
+ Video(id : Integer, title : String, length : Integer, description : String, director : String, language : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class VideoClientApp {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ VideoClientApp()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class VideoResource {
|
|
||||||
- fieldJsonMapper : FieldJsonMapper
|
|
||||||
- videos : Map<Integer, Video>
|
|
||||||
+ VideoResource(fieldJsonMapper : FieldJsonMapper, videos : Map<Integer, Video>)
|
|
||||||
+ getDetails(id : Integer, fields : String[]) : String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
VideoResource --> "-fieldJsonMapper" FieldJsonMapper
|
|
||||||
@enduml
|
|
@ -1,71 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.poison.pill {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Consumer {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- name : String
|
|
||||||
- queue : MqSubscribePoint
|
|
||||||
+ Consumer(name : String, queue : MqSubscribePoint)
|
|
||||||
+ consume()
|
|
||||||
}
|
|
||||||
interface Message {
|
|
||||||
+ POISON_PILL : Message {static}
|
|
||||||
+ addHeader(Headers, String) {abstract}
|
|
||||||
+ getBody() : String {abstract}
|
|
||||||
+ getHeader(Headers) : String {abstract}
|
|
||||||
+ getHeaders() : Map<Headers, String> {abstract}
|
|
||||||
+ setBody(String) {abstract}
|
|
||||||
}
|
|
||||||
enum Headers {
|
|
||||||
+ DATE {static}
|
|
||||||
+ SENDER {static}
|
|
||||||
+ valueOf(name : String) : Headers {static}
|
|
||||||
+ values() : Headers[] {static}
|
|
||||||
}
|
|
||||||
interface MessageQueue {
|
|
||||||
}
|
|
||||||
interface MqPublishPoint {
|
|
||||||
+ put(Message) {abstract}
|
|
||||||
}
|
|
||||||
interface MqSubscribePoint {
|
|
||||||
+ take() : Message {abstract}
|
|
||||||
}
|
|
||||||
class Producer {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- isStopped : boolean
|
|
||||||
- name : String
|
|
||||||
- queue : MqPublishPoint
|
|
||||||
+ Producer(name : String, queue : MqPublishPoint)
|
|
||||||
+ send(body : String)
|
|
||||||
+ stop()
|
|
||||||
}
|
|
||||||
class SimpleMessage {
|
|
||||||
- body : String
|
|
||||||
- headers : Map<Headers, String>
|
|
||||||
+ SimpleMessage()
|
|
||||||
+ addHeader(header : Headers, value : String)
|
|
||||||
+ getBody() : String
|
|
||||||
+ getHeader(header : Headers) : String
|
|
||||||
+ getHeaders() : Map<Headers, String>
|
|
||||||
+ setBody(body : String)
|
|
||||||
}
|
|
||||||
class SimpleMessageQueue {
|
|
||||||
- queue : BlockingQueue<Message>
|
|
||||||
+ SimpleMessageQueue(bound : int)
|
|
||||||
+ put(msg : Message)
|
|
||||||
+ take() : Message
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SimpleMessageQueue --> "-queue" Message
|
|
||||||
Consumer --> "-queue" MqSubscribePoint
|
|
||||||
Headers ..+ Message
|
|
||||||
Producer --> "-queue" MqPublishPoint
|
|
||||||
Message --> "-POISON_PILL" Message
|
|
||||||
MessageQueue --|> MqPublishPoint
|
|
||||||
MessageQueue --|> MqSubscribePoint
|
|
||||||
SimpleMessage ..|> Message
|
|
||||||
SimpleMessageQueue ..|> MessageQueue
|
|
||||||
@enduml
|
|
57
pom.xml
57
pom.xml
@ -42,7 +42,6 @@
|
|||||||
<hierarchical-junit-runner-version>4.12.1</hierarchical-junit-runner-version>
|
<hierarchical-junit-runner-version>4.12.1</hierarchical-junit-runner-version>
|
||||||
<apache-httpcomponents.version>4.5.2</apache-httpcomponents.version>
|
<apache-httpcomponents.version>4.5.2</apache-httpcomponents.version>
|
||||||
<htmlunit.version>2.22</htmlunit.version>
|
<htmlunit.version>2.22</htmlunit.version>
|
||||||
<urm.version>1.4.4</urm.version>
|
|
||||||
<guice.version>4.0</guice.version>
|
<guice.version>4.0</guice.version>
|
||||||
<mongo-java-driver.version>3.3.0</mongo-java-driver.version>
|
<mongo-java-driver.version>3.3.0</mongo-java-driver.version>
|
||||||
<slf4j.version>1.7.21</slf4j.version>
|
<slf4j.version>1.7.21</slf4j.version>
|
||||||
@ -312,25 +311,6 @@
|
|||||||
<ignore/>
|
<ignore/>
|
||||||
</action>
|
</action>
|
||||||
</pluginExecution>
|
</pluginExecution>
|
||||||
<pluginExecution>
|
|
||||||
<pluginExecutionFilter>
|
|
||||||
<groupId>
|
|
||||||
com.github.markusmo3.urm
|
|
||||||
</groupId>
|
|
||||||
<artifactId>
|
|
||||||
urm-maven-plugin
|
|
||||||
</artifactId>
|
|
||||||
<versionRange>
|
|
||||||
[1.4.1,)
|
|
||||||
</versionRange>
|
|
||||||
<goals>
|
|
||||||
<goal>map</goal>
|
|
||||||
</goals>
|
|
||||||
</pluginExecutionFilter>
|
|
||||||
<action>
|
|
||||||
<ignore/>
|
|
||||||
</action>
|
|
||||||
</pluginExecution>
|
|
||||||
</pluginExecutions>
|
</pluginExecutions>
|
||||||
</lifecycleMappingMetadata>
|
</lifecycleMappingMetadata>
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -445,43 +425,6 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.github.markusmo3.urm</groupId>
|
|
||||||
<artifactId>urm-maven-plugin</artifactId>
|
|
||||||
<version>${urm.version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>process-classes</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>map</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>${project.basedir}/etc</outputDirectory>
|
|
||||||
<packages>
|
|
||||||
<param>com.iluwatar</param>
|
|
||||||
</packages>
|
|
||||||
<skipForProjects>
|
|
||||||
<!-- skip for parent project -->
|
|
||||||
<param>java-design-patterns</param>
|
|
||||||
<param>singleton</param>
|
|
||||||
<param>factory-method</param>
|
|
||||||
<param>abstract-factory</param>
|
|
||||||
<param>builder</param>
|
|
||||||
<param>prototype</param>
|
|
||||||
<param>adapter</param>
|
|
||||||
<param>bridge</param>
|
|
||||||
<param>composite</param>
|
|
||||||
<param>decorator</param>
|
|
||||||
<param>facade</param>
|
|
||||||
<param>flyweight</param>
|
|
||||||
<param>proxy</param>
|
|
||||||
<param>chain</param>
|
|
||||||
</skipForProjects>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.privateclassdata {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class ImmutableStew {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- data : StewData
|
|
||||||
+ ImmutableStew(numPotatoes : int, numCarrots : int, numMeat : int, numPeppers : int)
|
|
||||||
+ mix()
|
|
||||||
}
|
|
||||||
class Stew {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- numCarrots : int
|
|
||||||
- numMeat : int
|
|
||||||
- numPeppers : int
|
|
||||||
- numPotatoes : int
|
|
||||||
+ Stew(numPotatoes : int, numCarrots : int, numMeat : int, numPeppers : int)
|
|
||||||
+ mix()
|
|
||||||
+ taste()
|
|
||||||
}
|
|
||||||
class StewData {
|
|
||||||
- numCarrots : int
|
|
||||||
- numMeat : int
|
|
||||||
- numPeppers : int
|
|
||||||
- numPotatoes : int
|
|
||||||
+ StewData(numPotatoes : int, numCarrots : int, numMeat : int, numPeppers : int)
|
|
||||||
+ getNumCarrots() : int
|
|
||||||
+ getNumMeat() : int
|
|
||||||
+ getNumPeppers() : int
|
|
||||||
+ getNumPotatoes() : int
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ImmutableStew --> "-data" StewData
|
|
||||||
@enduml
|
|
@ -1,39 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.producer.consumer {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Consumer {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- name : String
|
|
||||||
- queue : ItemQueue
|
|
||||||
+ Consumer(name : String, queue : ItemQueue)
|
|
||||||
+ consume()
|
|
||||||
}
|
|
||||||
class Item {
|
|
||||||
- id : int
|
|
||||||
- producer : String
|
|
||||||
+ Item(producer : String, id : int)
|
|
||||||
+ getId() : int
|
|
||||||
+ getProducer() : String
|
|
||||||
}
|
|
||||||
class ItemQueue {
|
|
||||||
- queue : BlockingQueue<Item>
|
|
||||||
+ ItemQueue()
|
|
||||||
+ put(item : Item)
|
|
||||||
+ take() : Item
|
|
||||||
}
|
|
||||||
class Producer {
|
|
||||||
- itemId : int
|
|
||||||
- name : String
|
|
||||||
- queue : ItemQueue
|
|
||||||
+ Producer(name : String, queue : ItemQueue)
|
|
||||||
+ produce()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Consumer --> "-queue" ItemQueue
|
|
||||||
Producer --> "-queue" ItemQueue
|
|
||||||
ItemQueue --> "-queue" Item
|
|
||||||
@enduml
|
|
@ -1,79 +0,0 @@
|
|||||||
@startuml
|
|
||||||
left to right direction
|
|
||||||
package com.iluwatar.promise {
|
|
||||||
class App {
|
|
||||||
- DEFAULT_URL : String {static}
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- executor : ExecutorService
|
|
||||||
- stopLatch : CountDownLatch
|
|
||||||
- App()
|
|
||||||
- calculateLineCount()
|
|
||||||
- calculateLowestFrequencyChar()
|
|
||||||
- characterFrequency() : Promise<Map<Character, Integer>>
|
|
||||||
- countLines() : Promise<Integer>
|
|
||||||
- download(urlString : String) : Promise<String>
|
|
||||||
- lowestFrequencyChar() : Promise<Character>
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- promiseUsage()
|
|
||||||
- stop()
|
|
||||||
- taskCompleted()
|
|
||||||
}
|
|
||||||
class Promise<T> {
|
|
||||||
- exceptionHandler : Consumer<? super Throwable>
|
|
||||||
- fulfillmentAction : Runnable
|
|
||||||
+ Promise<T>()
|
|
||||||
+ fulfill(value : T)
|
|
||||||
+ fulfillExceptionally(exception : Exception)
|
|
||||||
+ fulfillInAsync(task : Callable<T>, executor : Executor) : Promise<T>
|
|
||||||
- handleException(exception : Exception)
|
|
||||||
+ onError(exceptionHandler : Consumer<? super Throwable>) : Promise<T>
|
|
||||||
- postFulfillment()
|
|
||||||
+ thenAccept(action : Consumer<? super T>) : Promise<Void>
|
|
||||||
+ thenApply(func : Function<? super T, V>) : Promise<V>
|
|
||||||
}
|
|
||||||
-class ConsumeAction {
|
|
||||||
- action : Consumer<? super T>
|
|
||||||
- dest : Promise<Void>
|
|
||||||
- src : Promise<T>
|
|
||||||
- ConsumeAction(src : Promise<T>, dest : Promise<T>, action : Consumer<T>)
|
|
||||||
+ run()
|
|
||||||
}
|
|
||||||
-class TransformAction<V> {
|
|
||||||
- dest : Promise<V>
|
|
||||||
- func : Function<? super T, V>
|
|
||||||
- src : Promise<T>
|
|
||||||
- TransformAction<V>(src : Promise<T>, dest : Promise<T>, func : Function<T, R>)
|
|
||||||
+ run()
|
|
||||||
}
|
|
||||||
~class PromiseSupport<T> {
|
|
||||||
- COMPLETED : int {static}
|
|
||||||
- FAILED : int {static}
|
|
||||||
- RUNNING : int {static}
|
|
||||||
- exception : Exception
|
|
||||||
- lock : Object
|
|
||||||
- state : int
|
|
||||||
- value : T
|
|
||||||
~ PromiseSupport<T>()
|
|
||||||
+ cancel(mayInterruptIfRunning : boolean) : boolean
|
|
||||||
~ fulfill(value : T)
|
|
||||||
~ fulfillExceptionally(exception : Exception)
|
|
||||||
+ get() : T
|
|
||||||
+ get(timeout : long, unit : TimeUnit) : T
|
|
||||||
+ isCancelled() : boolean
|
|
||||||
+ isDone() : boolean
|
|
||||||
}
|
|
||||||
class Utility {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ Utility()
|
|
||||||
+ characterFrequency(fileLocation : String) : Map<Character, Integer> {static}
|
|
||||||
+ countLines(fileLocation : String) : Integer {static}
|
|
||||||
+ downloadFile(urlString : String) : String {static}
|
|
||||||
+ lowestFrequencyChar(charFrequency : Map<Character, Integer>) : Character {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TransformAction --+ Promise
|
|
||||||
TransformAction --> "-src" Promise
|
|
||||||
ConsumeAction --+ Promise
|
|
||||||
ConsumeAction --> "-src" Promise
|
|
||||||
Promise --|> PromiseSupport
|
|
||||||
@enduml
|
|
@ -1,54 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.property {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Character {
|
|
||||||
- name : String
|
|
||||||
- properties : Map<Stats, Integer>
|
|
||||||
- prototype : Prototype
|
|
||||||
- type : Type
|
|
||||||
+ Character()
|
|
||||||
+ Character(name : String, prototype : Character)
|
|
||||||
+ Character(type : Type, prototype : Prototype)
|
|
||||||
+ get(stat : Stats) : Integer
|
|
||||||
+ has(stat : Stats) : boolean
|
|
||||||
+ name() : String
|
|
||||||
+ remove(stat : Stats)
|
|
||||||
+ set(stat : Stats, val : Integer)
|
|
||||||
+ toString() : String
|
|
||||||
+ type() : Type
|
|
||||||
}
|
|
||||||
enum Type {
|
|
||||||
+ MAGE {static}
|
|
||||||
+ ROGUE {static}
|
|
||||||
+ WARRIOR {static}
|
|
||||||
+ valueOf(name : String) : Type {static}
|
|
||||||
+ values() : Type[] {static}
|
|
||||||
}
|
|
||||||
interface Prototype {
|
|
||||||
+ get(Stats) : Integer {abstract}
|
|
||||||
+ has(Stats) : boolean {abstract}
|
|
||||||
+ remove(Stats) {abstract}
|
|
||||||
+ set(Stats, Integer) {abstract}
|
|
||||||
}
|
|
||||||
enum Stats {
|
|
||||||
+ AGILITY {static}
|
|
||||||
+ ARMOR {static}
|
|
||||||
+ ATTACK_POWER {static}
|
|
||||||
+ ENERGY {static}
|
|
||||||
+ INTELLECT {static}
|
|
||||||
+ RAGE {static}
|
|
||||||
+ SPIRIT {static}
|
|
||||||
+ STRENGTH {static}
|
|
||||||
+ valueOf(name : String) : Stats {static}
|
|
||||||
+ values() : Stats[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Character --> "-prototype" Prototype
|
|
||||||
Type ..+ Character
|
|
||||||
Character --> "-type" Type
|
|
||||||
Character ..|> Prototype
|
|
||||||
@enduml
|
|
@ -1,9 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.publish.subscribe {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,44 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.queue.load.leveling {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- SHUTDOWN_TIME : int {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Message {
|
|
||||||
- msg : String
|
|
||||||
+ Message(msg : String)
|
|
||||||
+ getMsg() : String
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class MessageQueue {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- blkQueue : BlockingQueue<Message>
|
|
||||||
+ MessageQueue()
|
|
||||||
+ retrieveMsg() : Message
|
|
||||||
+ submitMsg(msg : Message)
|
|
||||||
}
|
|
||||||
class ServiceExecutor {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- msgQueue : MessageQueue
|
|
||||||
+ ServiceExecutor(msgQueue : MessageQueue)
|
|
||||||
+ run()
|
|
||||||
}
|
|
||||||
interface Task {
|
|
||||||
+ submit(Message) {abstract}
|
|
||||||
}
|
|
||||||
class TaskGenerator {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- msgCount : int
|
|
||||||
- msgQueue : MessageQueue
|
|
||||||
+ TaskGenerator(msgQueue : MessageQueue, msgCount : int)
|
|
||||||
+ run()
|
|
||||||
+ submit(msg : Message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MessageQueue --> "-blkQueue" Message
|
|
||||||
ServiceExecutor --> "-msgQueue" MessageQueue
|
|
||||||
TaskGenerator --> "-msgQueue" MessageQueue
|
|
||||||
TaskGenerator ..|> Task
|
|
||||||
@enduml
|
|
@ -1,156 +0,0 @@
|
|||||||
@startuml
|
|
||||||
left to right direction
|
|
||||||
package com.iluwatar.reactor.framework {
|
|
||||||
abstract class AbstractNioChannel {
|
|
||||||
- channel : SelectableChannel
|
|
||||||
- channelToPendingWrites : Map<SelectableChannel, Queue<Object>>
|
|
||||||
- handler : ChannelHandler
|
|
||||||
- reactor : NioReactor
|
|
||||||
+ AbstractNioChannel(handler : ChannelHandler, channel : SelectableChannel)
|
|
||||||
+ bind() {abstract}
|
|
||||||
# doWrite(Object, SelectionKey) {abstract}
|
|
||||||
~ flush(key : SelectionKey)
|
|
||||||
+ getHandler() : ChannelHandler
|
|
||||||
+ getInterestedOps() : int {abstract}
|
|
||||||
+ getJavaChannel() : SelectableChannel
|
|
||||||
+ read(SelectionKey) : Object {abstract}
|
|
||||||
~ setReactor(reactor : NioReactor)
|
|
||||||
+ write(data : Object, key : SelectionKey)
|
|
||||||
}
|
|
||||||
interface ChannelHandler {
|
|
||||||
+ handleChannelRead(AbstractNioChannel, Object, SelectionKey) {abstract}
|
|
||||||
}
|
|
||||||
interface Dispatcher {
|
|
||||||
+ onChannelReadEvent(AbstractNioChannel, Object, SelectionKey) {abstract}
|
|
||||||
+ stop() {abstract}
|
|
||||||
}
|
|
||||||
class NioDatagramChannel {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- port : int
|
|
||||||
+ NioDatagramChannel(port : int, handler : ChannelHandler)
|
|
||||||
+ bind()
|
|
||||||
# doWrite(pendingWrite : Object, key : SelectionKey)
|
|
||||||
+ getInterestedOps() : int
|
|
||||||
+ getJavaChannel() : DatagramChannel
|
|
||||||
+ read(key : SelectionKey) : DatagramPacket
|
|
||||||
+ write(data : Object, key : SelectionKey)
|
|
||||||
}
|
|
||||||
class DatagramPacket {
|
|
||||||
- data : ByteBuffer
|
|
||||||
- receiver : SocketAddress
|
|
||||||
- sender : SocketAddress
|
|
||||||
+ DatagramPacket(data : ByteBuffer)
|
|
||||||
+ getData() : ByteBuffer
|
|
||||||
+ getReceiver() : SocketAddress
|
|
||||||
+ getSender() : SocketAddress
|
|
||||||
+ setReceiver(receiver : SocketAddress)
|
|
||||||
+ setSender(sender : SocketAddress)
|
|
||||||
}
|
|
||||||
class NioReactor {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- dispatcher : Dispatcher
|
|
||||||
- pendingCommands : Queue<Runnable>
|
|
||||||
- reactorMain : ExecutorService
|
|
||||||
- selector : Selector
|
|
||||||
+ NioReactor(dispatcher : Dispatcher)
|
|
||||||
+ changeOps(key : SelectionKey, interestedOps : int)
|
|
||||||
- dispatchReadEvent(key : SelectionKey, readObject : Object)
|
|
||||||
- eventLoop()
|
|
||||||
- onChannelAcceptable(key : SelectionKey)
|
|
||||||
- onChannelReadable(key : SelectionKey)
|
|
||||||
- onChannelWritable(key : SelectionKey) {static}
|
|
||||||
- processKey(key : SelectionKey)
|
|
||||||
- processPendingCommands()
|
|
||||||
+ registerChannel(channel : AbstractNioChannel) : NioReactor
|
|
||||||
+ start()
|
|
||||||
+ stop()
|
|
||||||
}
|
|
||||||
~class ChangeKeyOpsCommand {
|
|
||||||
- interestedOps : int
|
|
||||||
- key : SelectionKey
|
|
||||||
+ ChangeKeyOpsCommand(this$0 : SelectionKey, key : int)
|
|
||||||
+ run()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class NioServerSocketChannel {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- port : int
|
|
||||||
+ NioServerSocketChannel(port : int, handler : ChannelHandler)
|
|
||||||
+ bind()
|
|
||||||
# doWrite(pendingWrite : Object, key : SelectionKey)
|
|
||||||
+ getInterestedOps() : int
|
|
||||||
+ getJavaChannel() : ServerSocketChannel
|
|
||||||
+ read(key : SelectionKey) : ByteBuffer
|
|
||||||
}
|
|
||||||
class SameThreadDispatcher {
|
|
||||||
+ SameThreadDispatcher()
|
|
||||||
+ onChannelReadEvent(channel : AbstractNioChannel, readObject : Object, key : SelectionKey)
|
|
||||||
+ stop()
|
|
||||||
}
|
|
||||||
class ThreadPoolDispatcher {
|
|
||||||
- executorService : ExecutorService
|
|
||||||
+ ThreadPoolDispatcher(poolSize : int)
|
|
||||||
+ onChannelReadEvent(channel : AbstractNioChannel, readObject : Object, key : SelectionKey)
|
|
||||||
+ stop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.reactor.app {
|
|
||||||
class App {
|
|
||||||
- channels : List<AbstractNioChannel>
|
|
||||||
- dispatcher : Dispatcher
|
|
||||||
- reactor : NioReactor
|
|
||||||
+ App(dispatcher : Dispatcher)
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
+ start()
|
|
||||||
+ stop()
|
|
||||||
- tcpChannel(port : int, handler : ChannelHandler) : AbstractNioChannel
|
|
||||||
- udpChannel(port : int, handler : ChannelHandler) : AbstractNioChannel
|
|
||||||
}
|
|
||||||
class AppClient {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- service : ExecutorService
|
|
||||||
+ AppClient()
|
|
||||||
- artificialDelayOf(millis : long) {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
+ start()
|
|
||||||
+ stop()
|
|
||||||
}
|
|
||||||
~class TcpLoggingClient {
|
|
||||||
- clientName : String
|
|
||||||
- serverPort : int
|
|
||||||
+ TcpLoggingClient(clientName : String, serverPort : int)
|
|
||||||
+ run()
|
|
||||||
- sendLogRequests(writer : PrintWriter, inputStream : InputStream)
|
|
||||||
}
|
|
||||||
~class UdpLoggingClient {
|
|
||||||
- clientName : String
|
|
||||||
- remoteAddress : InetSocketAddress
|
|
||||||
+ UdpLoggingClient(clientName : String, port : int)
|
|
||||||
+ run()
|
|
||||||
}
|
|
||||||
class LoggingHandler {
|
|
||||||
- ACK : byte[] {static}
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ LoggingHandler()
|
|
||||||
- doLogging(data : ByteBuffer) {static}
|
|
||||||
+ handleChannelRead(channel : AbstractNioChannel, readObject : Object, key : SelectionKey)
|
|
||||||
- sendReply(channel : AbstractNioChannel, incomingPacket : DatagramPacket, key : SelectionKey) {static}
|
|
||||||
- sendReply(channel : AbstractNioChannel, key : SelectionKey) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AbstractNioChannel --> "-handler" ChannelHandler
|
|
||||||
UdpLoggingClient ..+ AppClient
|
|
||||||
TcpLoggingClient ..+ AppClient
|
|
||||||
AbstractNioChannel --> "-reactor" NioReactor
|
|
||||||
NioReactor --> "-dispatcher" Dispatcher
|
|
||||||
App --> "-reactor" NioReactor
|
|
||||||
App --> "-channels" AbstractNioChannel
|
|
||||||
DatagramPacket ..+ NioDatagramChannel
|
|
||||||
App --> "-dispatcher" Dispatcher
|
|
||||||
ChangeKeyOpsCommand --+ NioReactor
|
|
||||||
LoggingHandler ..|> ChannelHandler
|
|
||||||
NioDatagramChannel --|> AbstractNioChannel
|
|
||||||
NioServerSocketChannel --|> AbstractNioChannel
|
|
||||||
SameThreadDispatcher ..|> Dispatcher
|
|
||||||
ThreadPoolDispatcher ..|> Dispatcher
|
|
||||||
@enduml
|
|
@ -1,61 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.reader.writer.lock {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Reader {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- name : String
|
|
||||||
- readLock : Lock
|
|
||||||
+ Reader(name : String, readLock : Lock)
|
|
||||||
+ read()
|
|
||||||
+ run()
|
|
||||||
}
|
|
||||||
class ReaderWriterLock {
|
|
||||||
- currentReaderCount : int
|
|
||||||
- globalMutex : Set<Object>
|
|
||||||
- readerLock : ReadLock
|
|
||||||
- readerMutex : Object
|
|
||||||
- writerLock : WriteLock
|
|
||||||
+ ReaderWriterLock()
|
|
||||||
- doesReaderOwnThisLock() : boolean
|
|
||||||
- doesWriterOwnThisLock() : boolean
|
|
||||||
- isLockFree() : boolean
|
|
||||||
+ readLock() : Lock
|
|
||||||
- waitUninterruptibly(o : Object) {static}
|
|
||||||
+ writeLock() : Lock
|
|
||||||
}
|
|
||||||
-class ReadLock {
|
|
||||||
- ReadLock()
|
|
||||||
+ lock()
|
|
||||||
+ lockInterruptibly()
|
|
||||||
+ newCondition() : Condition
|
|
||||||
+ tryLock() : boolean
|
|
||||||
+ tryLock(time : long, unit : TimeUnit) : boolean
|
|
||||||
+ unlock()
|
|
||||||
}
|
|
||||||
-class WriteLock {
|
|
||||||
- WriteLock()
|
|
||||||
+ lock()
|
|
||||||
+ lockInterruptibly()
|
|
||||||
+ newCondition() : Condition
|
|
||||||
+ tryLock() : boolean
|
|
||||||
+ tryLock(time : long, unit : TimeUnit) : boolean
|
|
||||||
+ unlock()
|
|
||||||
}
|
|
||||||
class Writer {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- name : String
|
|
||||||
- writeLock : Lock
|
|
||||||
+ Writer(name : String, writeLock : Lock)
|
|
||||||
+ run()
|
|
||||||
+ write()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ReaderWriterLock --> "-readerLock" ReadLock
|
|
||||||
ReadLock --+ ReaderWriterLock
|
|
||||||
WriteLock --+ ReaderWriterLock
|
|
||||||
ReaderWriterLock --> "-writerLock" WriteLock
|
|
||||||
@enduml
|
|
@ -1,56 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.repository {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class AppConfig {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ AppConfig()
|
|
||||||
+ dataSource() : DataSource
|
|
||||||
+ entityManagerFactory() : LocalContainerEntityManagerFactoryBean
|
|
||||||
- jpaProperties() : Properties {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
+ transactionManager() : JpaTransactionManager
|
|
||||||
}
|
|
||||||
class Person {
|
|
||||||
- age : int
|
|
||||||
- id : Long
|
|
||||||
- name : String
|
|
||||||
- surname : String
|
|
||||||
+ Person()
|
|
||||||
+ Person(name : String, surname : String, age : int)
|
|
||||||
+ equals(obj : Object) : boolean
|
|
||||||
+ getAge() : int
|
|
||||||
+ getId() : Long
|
|
||||||
+ getName() : String
|
|
||||||
+ getSurname() : String
|
|
||||||
+ hashCode() : int
|
|
||||||
+ setAge(age : int)
|
|
||||||
+ setId(id : Long)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ setSurname(surname : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface PersonRepository {
|
|
||||||
+ findByName(String) : Person {abstract}
|
|
||||||
}
|
|
||||||
class PersonSpecifications {
|
|
||||||
+ PersonSpecifications()
|
|
||||||
}
|
|
||||||
class AgeBetweenSpec {
|
|
||||||
- from : int
|
|
||||||
- to : int
|
|
||||||
+ AgeBetweenSpec(from : int, to : int)
|
|
||||||
+ toPredicate(root : Root<Person>, query : CriteriaQuery<?>, cb : CriteriaBuilder) : Predicate
|
|
||||||
}
|
|
||||||
class NameEqualSpec {
|
|
||||||
+ name : String
|
|
||||||
+ NameEqualSpec(name : String)
|
|
||||||
+ toPredicate(root : Root<Person>, query : CriteriaQuery<?>, cb : CriteriaBuilder) : Predicate
|
|
||||||
}
|
|
||||||
}
|
|
||||||
NameEqualSpec ..+ PersonSpecifications
|
|
||||||
AgeBetweenSpec ..+ PersonSpecifications
|
|
||||||
@enduml
|
|
@ -1,19 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.resource.acquisition.is.initialization {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class SlidingDoor {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ SlidingDoor()
|
|
||||||
+ close()
|
|
||||||
}
|
|
||||||
class TreasureChest {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ TreasureChest()
|
|
||||||
+ close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,56 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.semaphore {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Fruit {
|
|
||||||
- type : FruitType
|
|
||||||
+ Fruit(type : FruitType)
|
|
||||||
+ getType() : FruitType
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
enum FruitType {
|
|
||||||
+ APPLE {static}
|
|
||||||
+ LEMON {static}
|
|
||||||
+ ORANGE {static}
|
|
||||||
+ valueOf(name : String) : FruitType {static}
|
|
||||||
+ values() : FruitType[] {static}
|
|
||||||
}
|
|
||||||
class FruitBowl {
|
|
||||||
- fruit : List<Fruit>
|
|
||||||
+ FruitBowl()
|
|
||||||
+ countFruit() : int
|
|
||||||
+ put(f : Fruit)
|
|
||||||
+ take() : Fruit
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class FruitShop {
|
|
||||||
- available : boolean[]
|
|
||||||
- bowls : FruitBowl[]
|
|
||||||
- semaphore : Semaphore
|
|
||||||
+ FruitShop()
|
|
||||||
+ countFruit() : int
|
|
||||||
+ returnBowl(bowl : FruitBowl)
|
|
||||||
+ takeBowl() : FruitBowl
|
|
||||||
}
|
|
||||||
interface Lock {
|
|
||||||
+ acquire() {abstract}
|
|
||||||
+ release() {abstract}
|
|
||||||
}
|
|
||||||
class Semaphore {
|
|
||||||
- counter : int
|
|
||||||
- licenses : int
|
|
||||||
+ Semaphore(licenses : int)
|
|
||||||
+ acquire()
|
|
||||||
+ getAvailableLicenses() : int
|
|
||||||
+ getNumLicenses() : int
|
|
||||||
+ release()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FruitType ..+ Fruit
|
|
||||||
Fruit --> "-type" FruitType
|
|
||||||
FruitShop --> "-semaphore" Semaphore
|
|
||||||
FruitBowl --> "-fruit" Fruit
|
|
||||||
Semaphore ..|> Lock
|
|
||||||
@enduml
|
|
@ -1,56 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.servant {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
~ jenkins : Servant {static}
|
|
||||||
~ travis : Servant {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
+ scenario(servant : Servant, compliment : int) {static}
|
|
||||||
}
|
|
||||||
class King {
|
|
||||||
- complimentReceived : boolean
|
|
||||||
- isDrunk : boolean
|
|
||||||
- isHappy : boolean
|
|
||||||
- isHungry : boolean
|
|
||||||
+ King()
|
|
||||||
+ changeMood()
|
|
||||||
+ getDrink()
|
|
||||||
+ getFed()
|
|
||||||
+ getMood() : boolean
|
|
||||||
+ receiveCompliments()
|
|
||||||
}
|
|
||||||
class Queen {
|
|
||||||
- complimentReceived : boolean
|
|
||||||
- isDrunk : boolean
|
|
||||||
- isFlirty : boolean
|
|
||||||
- isHappy : boolean
|
|
||||||
- isHungry : boolean
|
|
||||||
+ Queen()
|
|
||||||
+ changeMood()
|
|
||||||
+ getDrink()
|
|
||||||
+ getFed()
|
|
||||||
+ getMood() : boolean
|
|
||||||
+ receiveCompliments()
|
|
||||||
+ setFlirtiness(f : boolean)
|
|
||||||
}
|
|
||||||
~interface Royalty {
|
|
||||||
+ changeMood() {abstract}
|
|
||||||
+ getDrink() {abstract}
|
|
||||||
+ getFed() {abstract}
|
|
||||||
+ getMood() : boolean {abstract}
|
|
||||||
+ receiveCompliments() {abstract}
|
|
||||||
}
|
|
||||||
class Servant {
|
|
||||||
+ name : String
|
|
||||||
+ Servant(name : String)
|
|
||||||
+ checkIfYouWillBeHanged(tableGuests : List<Royalty>) : boolean
|
|
||||||
+ feed(r : Royalty)
|
|
||||||
+ giveCompliments(r : Royalty)
|
|
||||||
+ giveWine(r : Royalty)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
App --> "-jenkins" Servant
|
|
||||||
King ..|> Royalty
|
|
||||||
Queen ..|> Royalty
|
|
||||||
@enduml
|
|
@ -1,161 +0,0 @@
|
|||||||
@startuml
|
|
||||||
left to right direction
|
|
||||||
package com.iluwatar.servicelayer.hibernate {
|
|
||||||
class HibernateUtil {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- sessionFactory : SessionFactory {static}
|
|
||||||
- HibernateUtil()
|
|
||||||
+ dropSession() {static}
|
|
||||||
+ getSessionFactory() : SessionFactory {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.servicelayer.common {
|
|
||||||
abstract class BaseEntity {
|
|
||||||
- version : Long
|
|
||||||
+ BaseEntity()
|
|
||||||
+ getId() : Long {abstract}
|
|
||||||
+ getName() : String {abstract}
|
|
||||||
+ setId(Long) {abstract}
|
|
||||||
+ setName(String) {abstract}
|
|
||||||
}
|
|
||||||
interface Dao<E extends BaseEntity> {
|
|
||||||
+ delete(E extends BaseEntity) {abstract}
|
|
||||||
+ find(Long) : E extends BaseEntity {abstract}
|
|
||||||
+ findAll() : List<E extends BaseEntity> {abstract}
|
|
||||||
+ merge(E extends BaseEntity) : E extends BaseEntity {abstract}
|
|
||||||
+ persist(E extends BaseEntity) {abstract}
|
|
||||||
}
|
|
||||||
abstract class DaoBaseImpl<E extends BaseEntity> {
|
|
||||||
# persistentClass : Class<E extends BaseEntity>
|
|
||||||
+ DaoBaseImpl<E extends BaseEntity>()
|
|
||||||
+ delete(entity : E extends BaseEntity)
|
|
||||||
+ find(id : Long) : E extends BaseEntity
|
|
||||||
+ findAll() : List<E extends BaseEntity>
|
|
||||||
# getSession() : Session
|
|
||||||
+ merge(entity : E extends BaseEntity) : E extends BaseEntity
|
|
||||||
+ persist(entity : E extends BaseEntity)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.servicelayer.magic {
|
|
||||||
interface MagicService {
|
|
||||||
+ findAllSpellbooks() : List<Spellbook> {abstract}
|
|
||||||
+ findAllSpells() : List<Spell> {abstract}
|
|
||||||
+ findAllWizards() : List<Wizard> {abstract}
|
|
||||||
+ findWizardsWithSpell(String) : List<Wizard> {abstract}
|
|
||||||
+ findWizardsWithSpellbook(String) : List<Wizard> {abstract}
|
|
||||||
}
|
|
||||||
class MagicServiceImpl {
|
|
||||||
- spellDao : SpellDao
|
|
||||||
- spellbookDao : SpellbookDao
|
|
||||||
- wizardDao : WizardDao
|
|
||||||
+ MagicServiceImpl(wizardDao : WizardDao, spellbookDao : SpellbookDao, spellDao : SpellDao)
|
|
||||||
+ findAllSpellbooks() : List<Spellbook>
|
|
||||||
+ findAllSpells() : List<Spell>
|
|
||||||
+ findAllWizards() : List<Wizard>
|
|
||||||
+ findWizardsWithSpell(name : String) : List<Wizard>
|
|
||||||
+ findWizardsWithSpellbook(name : String) : List<Wizard>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.servicelayer.wizard {
|
|
||||||
class Wizard {
|
|
||||||
- id : Long
|
|
||||||
- name : String
|
|
||||||
- spellbooks : Set<Spellbook>
|
|
||||||
+ Wizard()
|
|
||||||
+ Wizard(name : String)
|
|
||||||
+ addSpellbook(spellbook : Spellbook)
|
|
||||||
+ getId() : Long
|
|
||||||
+ getName() : String
|
|
||||||
+ getSpellbooks() : Set<Spellbook>
|
|
||||||
+ setId(id : Long)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ setSpellbooks(spellbooks : Set<Spellbook>)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface WizardDao {
|
|
||||||
+ findByName(String) : Wizard {abstract}
|
|
||||||
}
|
|
||||||
class WizardDaoImpl {
|
|
||||||
+ WizardDaoImpl()
|
|
||||||
+ findByName(name : String) : Wizard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.servicelayer.spellbook {
|
|
||||||
class Spellbook {
|
|
||||||
- id : Long
|
|
||||||
- name : String
|
|
||||||
- spells : Set<Spell>
|
|
||||||
- wizards : Set<Wizard>
|
|
||||||
+ Spellbook()
|
|
||||||
+ Spellbook(name : String)
|
|
||||||
+ addSpell(spell : Spell)
|
|
||||||
+ getId() : Long
|
|
||||||
+ getName() : String
|
|
||||||
+ getSpells() : Set<Spell>
|
|
||||||
+ getWizards() : Set<Wizard>
|
|
||||||
+ setId(id : Long)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ setSpells(spells : Set<Spell>)
|
|
||||||
+ setWizards(wizards : Set<Wizard>)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface SpellbookDao {
|
|
||||||
+ findByName(String) : Spellbook {abstract}
|
|
||||||
}
|
|
||||||
class SpellbookDaoImpl {
|
|
||||||
+ SpellbookDaoImpl()
|
|
||||||
+ findByName(name : String) : Spellbook
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.servicelayer.spell {
|
|
||||||
class Spell {
|
|
||||||
- id : Long
|
|
||||||
- name : String
|
|
||||||
- spellbook : Spellbook
|
|
||||||
+ Spell()
|
|
||||||
+ Spell(name : String)
|
|
||||||
+ getId() : Long
|
|
||||||
+ getName() : String
|
|
||||||
+ getSpellbook() : Spellbook
|
|
||||||
+ setId(id : Long)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ setSpellbook(spellbook : Spellbook)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface SpellDao {
|
|
||||||
+ findByName(String) : Spell {abstract}
|
|
||||||
}
|
|
||||||
class SpellDaoImpl {
|
|
||||||
+ SpellDaoImpl()
|
|
||||||
+ findByName(name : String) : Spell
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.servicelayer.app {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ initData() {static}
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
+ queryData() {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MagicServiceImpl --> "-wizardDao" WizardDao
|
|
||||||
MagicServiceImpl --> "-spellbookDao" SpellbookDao
|
|
||||||
MagicServiceImpl --> "-spellDao" SpellDao
|
|
||||||
Spellbook --> "-spells" Spell
|
|
||||||
Spellbook --> "-wizards" Wizard
|
|
||||||
DaoBaseImpl ..|> Dao
|
|
||||||
MagicServiceImpl ..|> MagicService
|
|
||||||
Spell --|> BaseEntity
|
|
||||||
SpellDao --|> Dao
|
|
||||||
SpellDaoImpl ..|> SpellDao
|
|
||||||
SpellDaoImpl --|> DaoBaseImpl
|
|
||||||
Spellbook --|> BaseEntity
|
|
||||||
SpellbookDao --|> Dao
|
|
||||||
SpellbookDaoImpl ..|> SpellbookDao
|
|
||||||
SpellbookDaoImpl --|> DaoBaseImpl
|
|
||||||
Wizard --|> BaseEntity
|
|
||||||
WizardDao --|> Dao
|
|
||||||
WizardDaoImpl ..|> WizardDao
|
|
||||||
WizardDaoImpl --|> DaoBaseImpl
|
|
||||||
@enduml
|
|
@ -1,41 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.servicelocator {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class InitContext {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ InitContext()
|
|
||||||
+ lookup(serviceName : String) : Object
|
|
||||||
}
|
|
||||||
interface Service {
|
|
||||||
+ execute() {abstract}
|
|
||||||
+ getId() : int {abstract}
|
|
||||||
+ getName() : String {abstract}
|
|
||||||
}
|
|
||||||
class ServiceCache {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- serviceCache : Map<String, Service>
|
|
||||||
+ ServiceCache()
|
|
||||||
+ addService(newService : Service)
|
|
||||||
+ getService(serviceName : String) : Service
|
|
||||||
}
|
|
||||||
class ServiceImpl {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- id : int
|
|
||||||
- serviceName : String
|
|
||||||
+ ServiceImpl(serviceName : String)
|
|
||||||
+ execute()
|
|
||||||
+ getId() : int
|
|
||||||
+ getName() : String
|
|
||||||
}
|
|
||||||
class ServiceLocator {
|
|
||||||
- serviceCache : ServiceCache {static}
|
|
||||||
- ServiceLocator()
|
|
||||||
+ getService(serviceJndiName : String) : Service {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ServiceLocator --> "-serviceCache" ServiceCache
|
|
||||||
ServiceImpl ..|> Service
|
|
||||||
@enduml
|
|
@ -1,107 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.specification.creature {
|
|
||||||
abstract class AbstractCreature {
|
|
||||||
- color : Color
|
|
||||||
- movement : Movement
|
|
||||||
- name : String
|
|
||||||
- size : Size
|
|
||||||
+ AbstractCreature(name : String, size : Size, movement : Movement, color : Color)
|
|
||||||
+ getColor() : Color
|
|
||||||
+ getMovement() : Movement
|
|
||||||
+ getName() : String
|
|
||||||
+ getSize() : Size
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
interface Creature {
|
|
||||||
+ getColor() : Color {abstract}
|
|
||||||
+ getMovement() : Movement {abstract}
|
|
||||||
+ getName() : String {abstract}
|
|
||||||
+ getSize() : Size {abstract}
|
|
||||||
}
|
|
||||||
class Dragon {
|
|
||||||
+ Dragon()
|
|
||||||
}
|
|
||||||
class Goblin {
|
|
||||||
+ Goblin()
|
|
||||||
}
|
|
||||||
class KillerBee {
|
|
||||||
+ KillerBee()
|
|
||||||
}
|
|
||||||
class Octopus {
|
|
||||||
+ Octopus()
|
|
||||||
}
|
|
||||||
class Shark {
|
|
||||||
+ Shark()
|
|
||||||
}
|
|
||||||
class Troll {
|
|
||||||
+ Troll()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.specification.property {
|
|
||||||
enum Color {
|
|
||||||
+ DARK {static}
|
|
||||||
+ GREEN {static}
|
|
||||||
+ LIGHT {static}
|
|
||||||
+ RED {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Color {static}
|
|
||||||
+ values() : Color[] {static}
|
|
||||||
}
|
|
||||||
enum Movement {
|
|
||||||
+ FLYING {static}
|
|
||||||
+ SWIMMING {static}
|
|
||||||
+ WALKING {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Movement {static}
|
|
||||||
+ values() : Movement[] {static}
|
|
||||||
}
|
|
||||||
enum Size {
|
|
||||||
+ LARGE {static}
|
|
||||||
+ NORMAL {static}
|
|
||||||
+ SMALL {static}
|
|
||||||
- title : String
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(name : String) : Size {static}
|
|
||||||
+ values() : Size[] {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.specification.selector {
|
|
||||||
class ColorSelector {
|
|
||||||
- c : Color
|
|
||||||
+ ColorSelector(c : Color)
|
|
||||||
+ test(t : Creature) : boolean
|
|
||||||
}
|
|
||||||
class MovementSelector {
|
|
||||||
- m : Movement
|
|
||||||
+ MovementSelector(m : Movement)
|
|
||||||
+ test(t : Creature) : boolean
|
|
||||||
}
|
|
||||||
class SizeSelector {
|
|
||||||
- s : Size
|
|
||||||
+ SizeSelector(s : Size)
|
|
||||||
+ test(t : Creature) : boolean
|
|
||||||
}
|
|
||||||
}
|
|
||||||
package com.iluwatar.specification.app {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SizeSelector --> "-s" Size
|
|
||||||
AbstractCreature --> "-color" Color
|
|
||||||
MovementSelector --> "-m" Movement
|
|
||||||
AbstractCreature --> "-movement" Movement
|
|
||||||
AbstractCreature --> "-size" Size
|
|
||||||
ColorSelector --> "-c" Color
|
|
||||||
AbstractCreature ..|> Creature
|
|
||||||
Dragon --|> AbstractCreature
|
|
||||||
Goblin --|> AbstractCreature
|
|
||||||
KillerBee --|> AbstractCreature
|
|
||||||
Octopus --|> AbstractCreature
|
|
||||||
Shark --|> AbstractCreature
|
|
||||||
Troll --|> AbstractCreature
|
|
||||||
@enduml
|
|
@ -1,39 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.state {
|
|
||||||
class AngryState {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- mammoth : Mammoth
|
|
||||||
+ AngryState(mammoth : Mammoth)
|
|
||||||
+ observe()
|
|
||||||
+ onEnterState()
|
|
||||||
}
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Mammoth {
|
|
||||||
- state : State
|
|
||||||
+ Mammoth()
|
|
||||||
- changeStateTo(newState : State)
|
|
||||||
+ observe()
|
|
||||||
+ timePasses()
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class PeacefulState {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- mammoth : Mammoth
|
|
||||||
+ PeacefulState(mammoth : Mammoth)
|
|
||||||
+ observe()
|
|
||||||
+ onEnterState()
|
|
||||||
}
|
|
||||||
interface State {
|
|
||||||
+ observe() {abstract}
|
|
||||||
+ onEnterState() {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PeacefulState --> "-mammoth" Mammoth
|
|
||||||
AngryState --> "-mammoth" Mammoth
|
|
||||||
Mammoth --> "-state" State
|
|
||||||
AngryState ..|> State
|
|
||||||
PeacefulState ..|> State
|
|
||||||
@enduml
|
|
@ -1,91 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.stepbuilder {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Character {
|
|
||||||
- abilities : List<String>
|
|
||||||
- fighterClass : String
|
|
||||||
- name : String
|
|
||||||
- spell : String
|
|
||||||
- weapon : String
|
|
||||||
- wizardClass : String
|
|
||||||
+ Character(name : String)
|
|
||||||
+ getAbilities() : List<String>
|
|
||||||
+ getFighterClass() : String
|
|
||||||
+ getName() : String
|
|
||||||
+ getSpell() : String
|
|
||||||
+ getWeapon() : String
|
|
||||||
+ getWizardClass() : String
|
|
||||||
+ setAbilities(abilities : List<String>)
|
|
||||||
+ setFighterClass(fighterClass : String)
|
|
||||||
+ setName(name : String)
|
|
||||||
+ setSpell(spell : String)
|
|
||||||
+ setWeapon(weapon : String)
|
|
||||||
+ setWizardClass(wizardClass : String)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class CharacterStepBuilder {
|
|
||||||
- CharacterStepBuilder()
|
|
||||||
+ newBuilder() : NameStep {static}
|
|
||||||
}
|
|
||||||
interface AbilityStep {
|
|
||||||
+ noAbilities() : BuildStep {abstract}
|
|
||||||
+ noMoreAbilities() : BuildStep {abstract}
|
|
||||||
+ withAbility(String) : AbilityStep {abstract}
|
|
||||||
}
|
|
||||||
interface BuildStep {
|
|
||||||
+ build() : Character {abstract}
|
|
||||||
}
|
|
||||||
-class CharacterSteps {
|
|
||||||
- abilities : List<String>
|
|
||||||
- fighterClass : String
|
|
||||||
- name : String
|
|
||||||
- spell : String
|
|
||||||
- weapon : String
|
|
||||||
- wizardClass : String
|
|
||||||
- CharacterSteps()
|
|
||||||
+ build() : Character
|
|
||||||
+ fighterClass(fighterClass : String) : WeaponStep
|
|
||||||
+ name(name : String) : ClassStep
|
|
||||||
+ noAbilities() : BuildStep
|
|
||||||
+ noMoreAbilities() : BuildStep
|
|
||||||
+ noSpell() : BuildStep
|
|
||||||
+ noWeapon() : BuildStep
|
|
||||||
+ withAbility(ability : String) : AbilityStep
|
|
||||||
+ withSpell(spell : String) : AbilityStep
|
|
||||||
+ withWeapon(weapon : String) : AbilityStep
|
|
||||||
+ wizardClass(wizardClass : String) : SpellStep
|
|
||||||
}
|
|
||||||
interface ClassStep {
|
|
||||||
+ fighterClass(String) : WeaponStep {abstract}
|
|
||||||
+ wizardClass(String) : SpellStep {abstract}
|
|
||||||
}
|
|
||||||
interface NameStep {
|
|
||||||
+ name(String) : ClassStep {abstract}
|
|
||||||
}
|
|
||||||
interface SpellStep {
|
|
||||||
+ noSpell() : BuildStep {abstract}
|
|
||||||
+ withSpell(String) : AbilityStep {abstract}
|
|
||||||
}
|
|
||||||
interface WeaponStep {
|
|
||||||
+ noWeapon() : BuildStep {abstract}
|
|
||||||
+ withWeapon(String) : AbilityStep {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
WeaponStep ..+ CharacterStepBuilder
|
|
||||||
CharacterSteps ..+ CharacterStepBuilder
|
|
||||||
AbilityStep ..+ CharacterStepBuilder
|
|
||||||
SpellStep ..+ CharacterStepBuilder
|
|
||||||
ClassStep ..+ CharacterStepBuilder
|
|
||||||
NameStep ..+ CharacterStepBuilder
|
|
||||||
BuildStep ..+ CharacterStepBuilder
|
|
||||||
CharacterSteps ..|> NameStep
|
|
||||||
CharacterSteps ..|> ClassStep
|
|
||||||
CharacterSteps ..|> WeaponStep
|
|
||||||
CharacterSteps ..|> SpellStep
|
|
||||||
CharacterSteps ..|> AbilityStep
|
|
||||||
CharacterSteps ..|> BuildStep
|
|
||||||
@enduml
|
|
@ -1,37 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.strategy {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class DragonSlayer {
|
|
||||||
- strategy : DragonSlayingStrategy
|
|
||||||
+ DragonSlayer(strategy : DragonSlayingStrategy)
|
|
||||||
+ changeStrategy(strategy : DragonSlayingStrategy)
|
|
||||||
+ goToBattle()
|
|
||||||
}
|
|
||||||
interface DragonSlayingStrategy {
|
|
||||||
+ execute() {abstract}
|
|
||||||
}
|
|
||||||
class MeleeStrategy {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ MeleeStrategy()
|
|
||||||
+ execute()
|
|
||||||
}
|
|
||||||
class ProjectileStrategy {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ ProjectileStrategy()
|
|
||||||
+ execute()
|
|
||||||
}
|
|
||||||
class SpellStrategy {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ SpellStrategy()
|
|
||||||
+ execute()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DragonSlayer --> "-strategy" DragonSlayingStrategy
|
|
||||||
MeleeStrategy ..|> DragonSlayingStrategy
|
|
||||||
ProjectileStrategy ..|> DragonSlayingStrategy
|
|
||||||
SpellStrategy ..|> DragonSlayingStrategy
|
|
||||||
@enduml
|
|
@ -1,39 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.templatemethod {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class HalflingThief {
|
|
||||||
- method : StealingMethod
|
|
||||||
+ HalflingThief(method : StealingMethod)
|
|
||||||
+ changeMethod(method : StealingMethod)
|
|
||||||
+ steal()
|
|
||||||
}
|
|
||||||
class HitAndRunMethod {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ HitAndRunMethod()
|
|
||||||
# confuseTarget(target : String)
|
|
||||||
# pickTarget() : String
|
|
||||||
# stealTheItem(target : String)
|
|
||||||
}
|
|
||||||
abstract class StealingMethod {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ StealingMethod()
|
|
||||||
# confuseTarget(String) {abstract}
|
|
||||||
# pickTarget() : String {abstract}
|
|
||||||
+ steal()
|
|
||||||
# stealTheItem(String) {abstract}
|
|
||||||
}
|
|
||||||
class SubtleMethod {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ SubtleMethod()
|
|
||||||
# confuseTarget(target : String)
|
|
||||||
# pickTarget() : String
|
|
||||||
# stealTheItem(target : String)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HalflingThief --> "-method" StealingMethod
|
|
||||||
HitAndRunMethod --|> StealingMethod
|
|
||||||
SubtleMethod --|> StealingMethod
|
|
||||||
@enduml
|
|
@ -1,37 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.threadpool {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class CoffeeMakingTask {
|
|
||||||
- TIME_PER_CUP : int {static}
|
|
||||||
+ CoffeeMakingTask(numCups : int)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class PotatoPeelingTask {
|
|
||||||
- TIME_PER_POTATO : int {static}
|
|
||||||
+ PotatoPeelingTask(numPotatoes : int)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
abstract class Task {
|
|
||||||
- ID_GENERATOR : AtomicInteger {static}
|
|
||||||
- id : int
|
|
||||||
- timeMs : int
|
|
||||||
+ Task(timeMs : int)
|
|
||||||
+ getId() : int
|
|
||||||
+ getTimeMs() : int
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class Worker {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- task : Task
|
|
||||||
+ Worker(task : Task)
|
|
||||||
+ run()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Worker --> "-task" Task
|
|
||||||
CoffeeMakingTask --|> Task
|
|
||||||
PotatoPeelingTask --|> Task
|
|
||||||
@enduml
|
|
@ -1,29 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.tls {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- makeServiceCalls(service : B2BService) {static}
|
|
||||||
}
|
|
||||||
~class B2BService {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- callsCounter : int
|
|
||||||
- tenant : Tenant
|
|
||||||
+ B2BService(tenant : Tenant)
|
|
||||||
+ dummyCustomerApi() : int
|
|
||||||
+ getCurrentCallsCount() : int
|
|
||||||
- getRandomCustomerId() : int
|
|
||||||
}
|
|
||||||
class Tenant {
|
|
||||||
- allowedCallsPerSecond : int
|
|
||||||
- name : String
|
|
||||||
+ Tenant(name : String, allowedCallsPerSecond : int)
|
|
||||||
+ getAllowedCallsPerSecond() : int
|
|
||||||
+ getName() : String
|
|
||||||
+ setAllowedCallsPerSecond(allowedCallsPerSecond : int)
|
|
||||||
+ setName(name : String)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
B2BService --> "-tenant" Tenant
|
|
||||||
@enduml
|
|
@ -1,23 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.tls {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- printAndCountDates(res : Result) : int {static}
|
|
||||||
- printAndCountExceptions(res : Result) : int {static}
|
|
||||||
}
|
|
||||||
class DateFormatCallable {
|
|
||||||
- dateValue : String
|
|
||||||
- df : ThreadLocal<DateFormat>
|
|
||||||
+ DateFormatCallable(inDateFormat : String, inDateValue : String)
|
|
||||||
+ call() : Result
|
|
||||||
}
|
|
||||||
class Result {
|
|
||||||
- dateList : List<Date>
|
|
||||||
- exceptionList : List<String>
|
|
||||||
+ Result()
|
|
||||||
+ getDateList() : List<Date>
|
|
||||||
+ getExceptionList() : List<String>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,39 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.tolerantreader {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class RainbowFish {
|
|
||||||
- age : int
|
|
||||||
- lengthMeters : int
|
|
||||||
- name : String
|
|
||||||
- serialVersionUID : long {static}
|
|
||||||
- weightTons : int
|
|
||||||
+ RainbowFish(name : String, age : int, lengthMeters : int, weightTons : int)
|
|
||||||
+ getAge() : int
|
|
||||||
+ getLengthMeters() : int
|
|
||||||
+ getName() : String
|
|
||||||
+ getWeightTons() : int
|
|
||||||
}
|
|
||||||
class RainbowFishSerializer {
|
|
||||||
- RainbowFishSerializer()
|
|
||||||
+ readV1(filename : String) : RainbowFish {static}
|
|
||||||
+ writeV1(rainbowFish : RainbowFish, filename : String) {static}
|
|
||||||
+ writeV2(rainbowFish : RainbowFishV2, filename : String) {static}
|
|
||||||
}
|
|
||||||
class RainbowFishV2 {
|
|
||||||
- angry : boolean
|
|
||||||
- hungry : boolean
|
|
||||||
- serialVersionUID : long {static}
|
|
||||||
- sleeping : boolean
|
|
||||||
+ RainbowFishV2(name : String, age : int, lengthMeters : int, weightTons : int)
|
|
||||||
+ RainbowFishV2(name : String, age : int, lengthMeters : int, weightTons : int, sleeping : boolean, hungry : boolean, angry : boolean)
|
|
||||||
+ getAngry() : boolean
|
|
||||||
+ getHungry() : boolean
|
|
||||||
+ getSleeping() : boolean
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RainbowFishV2 --|> RainbowFish
|
|
||||||
@enduml
|
|
@ -1,27 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.twin {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
- waiting() {static}
|
|
||||||
}
|
|
||||||
class BallItem {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
- isSuspended : boolean
|
|
||||||
- twin : BallThread
|
|
||||||
+ BallItem()
|
|
||||||
+ click()
|
|
||||||
+ doDraw()
|
|
||||||
+ move()
|
|
||||||
+ setTwin(twin : BallThread)
|
|
||||||
}
|
|
||||||
abstract class GameItem {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ GameItem()
|
|
||||||
+ click() {abstract}
|
|
||||||
+ doDraw() {abstract}
|
|
||||||
+ draw()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BallItem --|> GameItem
|
|
||||||
@enduml
|
|
@ -1,22 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.value.object {
|
|
||||||
class App {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class HeroStat {
|
|
||||||
- intelligence : int
|
|
||||||
- luck : int
|
|
||||||
- strength : int
|
|
||||||
- HeroStat(strength : int, intelligence : int, luck : int)
|
|
||||||
+ equals(obj : Object) : boolean
|
|
||||||
+ getIntelligence() : int
|
|
||||||
+ getLuck() : int
|
|
||||||
+ getStrength() : int
|
|
||||||
+ hashCode() : int
|
|
||||||
+ toString() : String
|
|
||||||
+ valueOf(strength : int, intelligence : int, luck : int) : HeroStat {static}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@enduml
|
|
@ -1,60 +0,0 @@
|
|||||||
@startuml
|
|
||||||
package com.iluwatar.visitor {
|
|
||||||
class App {
|
|
||||||
+ App()
|
|
||||||
+ main(args : String[]) {static}
|
|
||||||
}
|
|
||||||
class Commander {
|
|
||||||
+ Commander(children : Unit[])
|
|
||||||
+ accept(visitor : UnitVisitor)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class CommanderVisitor {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ CommanderVisitor()
|
|
||||||
+ visitCommander(commander : Commander)
|
|
||||||
+ visitSergeant(sergeant : Sergeant)
|
|
||||||
+ visitSoldier(soldier : Soldier)
|
|
||||||
}
|
|
||||||
class Sergeant {
|
|
||||||
+ Sergeant(children : Unit[])
|
|
||||||
+ accept(visitor : UnitVisitor)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class SergeantVisitor {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ SergeantVisitor()
|
|
||||||
+ visitCommander(commander : Commander)
|
|
||||||
+ visitSergeant(sergeant : Sergeant)
|
|
||||||
+ visitSoldier(soldier : Soldier)
|
|
||||||
}
|
|
||||||
class Soldier {
|
|
||||||
+ Soldier(children : Unit[])
|
|
||||||
+ accept(visitor : UnitVisitor)
|
|
||||||
+ toString() : String
|
|
||||||
}
|
|
||||||
class SoldierVisitor {
|
|
||||||
- LOGGER : Logger {static}
|
|
||||||
+ SoldierVisitor()
|
|
||||||
+ visitCommander(commander : Commander)
|
|
||||||
+ visitSergeant(sergeant : Sergeant)
|
|
||||||
+ visitSoldier(soldier : Soldier)
|
|
||||||
}
|
|
||||||
abstract class Unit {
|
|
||||||
- children : Unit[]
|
|
||||||
+ Unit(children : Unit[])
|
|
||||||
+ accept(visitor : UnitVisitor)
|
|
||||||
}
|
|
||||||
interface UnitVisitor {
|
|
||||||
+ visitCommander(Commander) {abstract}
|
|
||||||
+ visitSergeant(Sergeant) {abstract}
|
|
||||||
+ visitSoldier(Soldier) {abstract}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Commander --|> Unit
|
|
||||||
CommanderVisitor ..|> UnitVisitor
|
|
||||||
Sergeant --|> Unit
|
|
||||||
SergeantVisitor ..|> UnitVisitor
|
|
||||||
Soldier --|> Unit
|
|
||||||
SoldierVisitor ..|> UnitVisitor
|
|
||||||
@enduml
|
|
Loading…
x
Reference in New Issue
Block a user