#+title: patron de diseño: decorator

#+begin_src plantuml :file /tmp/algo.png
@startuml
skinparam classAttributeIconSize 0
skinparam lineType ortho
hide abstract circle
hide class circle

abstract LibraryItem {
+ NumCopies: int
- numCopies: int
+ Display(): void {abstract}
}

class Book extends LibraryItem{
- author: string
- title: string
+ Book(string author, string title, int numCopies)
+ <<override>> Display(): void
}

class Video extends LibraryItem {
        - director: string
        - title: string
        - playTime: int
        + Video(string director, string title, int numCopies, int playTime)
        + <<override>> Display(): void
}

abstract class Decorator extends LibraryItem {
        # libraryitem: LibraryItem;

        + Decorator(LibraryItem libraryItem)
        + <<override>> Display(): void
}

class Borrowable extends Decorator {
        # borrowers: List<string>
        
        + Borrowable(LibraryItem libraryItem): base(libraryItem)
        + BorrowItem(string name): void
        + ReturnItem(string name): void
        + <<override>> Display(): void
        
}

note right of Decorator::"Display()"
component.Operation()
end note
Decorator o-> LibraryItem
@enduml
#+end_src