From 5c1c4627d4fc8b782886d57ce0d3bc89abf9c9ec Mon Sep 17 00:00:00 2001 From: fede Date: Tue, 28 May 2024 09:46:44 -0300 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20Ingenieria=20de=20Software/Decora?= =?UTF-8?q?tor.org?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ingenieria de Software/Decorator.org | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Ingenieria de Software/Decorator.org diff --git a/Ingenieria de Software/Decorator.org b/Ingenieria de Software/Decorator.org new file mode 100644 index 0000000..34ad0e1 --- /dev/null +++ b/Ingenieria de Software/Decorator.org @@ -0,0 +1,49 @@ +#+title: patron de diseƱo: decorator + +#+begin_src plantuml :file /tmp/algo.png +@startuml + +hide abstract circle +hide class circle + +abstract LibraryItem <> { ++ NumCopies: int +- numCopies: int ++ <> Display(): void +} + +class Book extends LibraryItem{ +- author: string +- title: string ++ Book(string author, string title, int numCopies) ++ <> Display(): void +} + +class Video extends LibraryItem { + - director: string + - title: string + - playTime: int + + Video(string director, string title, int numCopies, int playTime) + + <> Display(): void +} + +abstract class Decorator extends LibraryItem { + # libraryitem: LibraryItem; + + + Decorator(LibraryItem libraryItem) + + <> Display(): void +} + +class Borrowable extends Decorator { + # borrowers: List + + + Borrowable(LibraryItem libraryItem): base(libraryItem) + + BorrowItem(string name): void + + ReturnItem(string name): void + + <> Display(): void + +} + +Decorator o-d-> LibraryItem +@enduml +#+end_src \ No newline at end of file