@startuml package com.iluwatar.retry { class App { - LOG : Logger {static} - op : BusinessOperation {static} + App() - errorNoRetry() {static} - errorWithRetry() {static} - errorWithRetryExponentialBackoff() {static} + main(args : String[]) {static} - noErrors() {static} } interface BusinessOperation { + perform() : T {abstract} } class FindCustomer { - customerId : String - errors : Deque + FindCustomer(customerId : String, errors : BusinessException[]) + perform() : String } class Retry { - attempts : AtomicInteger - delay : long - errors : List - maxAttempts : int - op : BusinessOperation - test : Predicate + Retry(op : BusinessOperation, maxAttempts : int, delay : long, ignoreTests : Predicate[]) + attempts() : int + errors() : List + perform() : T } class RetryExponentialBackoff { - RANDOM : Random {static} - attempts : AtomicInteger - errors : List - maxAttempts : int - maxDelay : long - op : BusinessOperation - test : Predicate + RetryExponentialBackoff(op : BusinessOperation, maxAttempts : int, maxDelay : long, ignoreTests : Predicate[]) + attempts() : int + errors() : List + perform() : T } } RetryExponentialBackoff --> "-op" BusinessOperation Retry --> "-op" BusinessOperation App --> "-op" BusinessOperation FindCustomer ..|> BusinessOperation Retry ..|> BusinessOperation RetryExponentialBackoff ..|> BusinessOperation @enduml