Created
September 27, 2023 18:52
-
-
Save devLukaDev/dfd1f6349bb04ebb019b580252c4fbb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| classDiagram | |
| Ticket "1"<|-- "0-1"DiscountedTicket | |
| Ticket "1"<|--"0-1" SingleTicket | |
| Ticket "1"<|--"0-1" ReturnTicket | |
| TicketProcess "1" *-- "1" Payment | |
| TicketProcess "1" *-- "*" Ticket | |
| TicketProcess "1" *-- "1" TicketPrinter | |
| Payment "1"<|-- "0-1" CoinPayment | |
| Payment "1" <|-- "0-1" CardPayment | |
| DiscountedTicket "1"*--"1" RailcardReader | |
| RailcardReader "1"<|.."?" IRailcardReader | |
| ICard "1"<|.."1" CardPayment | |
| CoinPayment "1"*--"1" CoinMachineFacade | |
| CoinMachineFacade "1"*--"1" IKEAMyntAtare2000 | |
| class TicketProcess{ | |
| +TicketsList[Ticket] : List | |
| +payment : Payment | |
| +ticketPrinter : TicketPrinter | |
| +addTicket() | |
| +removeTicket() | |
| +startPayment(Payment) | |
| +finalizePayment() | |
| } | |
| class TicketPrinter { | |
| +printTicket() | |
| } | |
| class Ticket{ | |
| <<abstract>> | |
| -fromLocation : Location | |
| -destination : Location | |
| -class : int | |
| -international : int | |
| +price : double | |
| +double calculatePrice()* | |
| +String toString()* | |
| } | |
| class DiscountedTicket { | |
| -discountPercentage : int | |
| -railcardReader : RailcardReader | |
| -double calculatePrice() | |
| +String toString() | |
| } | |
| class SingleTicket { | |
| -double calculatePrice() | |
| +String toString() | |
| } | |
| class ReturnTicket { | |
| -double calculatePrice() | |
| +String toString() | |
| } | |
| class Payment { | |
| <<abstract>> | |
| +price : double | |
| -setTotalPrice() | |
| } | |
| class CoinPayment { | |
| -coinMachine : CoinMachineFacade | |
| } | |
| class CoinMachineFacade { | |
| -ikeaMynt : IKEAMyntAtare2000 | |
| -totalPrice : double | |
| -status : int | |
| -start() | |
| -stop() | |
| -pay() | |
| } | |
| class IKEAMyntAtare2000 { | |
| -kottBullar : int | |
| +status : int | |
| +summa : int | |
| #sittaPoang : bool | |
| +bool ataMynt() | |
| +betala() | |
| +starta() | |
| +stoppa() | |
| } | |
| class CardPayment { | |
| %% Adapter | |
| } | |
| class RailcardReader { | |
| %% Adapter to Railcard (existing class somewhere else) | |
| +bool cardCheck() | |
| } | |
| class IRailcardReader { | |
| <<interface>> | |
| } | |
| class ICard { | |
| <<interface>> | |
| -string[] ListReaders() | |
| -Connect() | |
| -Disconnect() | |
| -ABDUResponse Transmit() | |
| -TransactionID BeginTransaction() | |
| -bool EndTransaction() | |
| -CancelTransaction() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment