From 870d44b1271d489be02848ca06e5165d45c4e153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Tue, 11 Aug 2020 17:25:38 +0300 Subject: [PATCH] Fix layout --- transaction-script/README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/transaction-script/README.md b/transaction-script/README.md index d4e4795c6..3ae3cf4c1 100644 --- a/transaction-script/README.md +++ b/transaction-script/README.md @@ -16,10 +16,12 @@ request from the presentation. ## Explanation Real world example + > You need to create a hotel room booking system. Since the requirements are quite simple we intend > to use the Transaction Script pattern here. In plain words + > Transaction Script organizes business logic into transactions that the system needs to carry out. Programmatic example @@ -80,15 +82,9 @@ The `Hotel` class has two methods, one for booking and cancelling a room respect them handles a single transaction in the system, making `Hotel` implement the Transaction Script pattern. -``` -public void bookRoom(int roomNumber); -``` The `bookRoom` method consolidates all the needed steps like checking if the room is already booked or not, if not booked then books the room and updates the database by using the DAO. -``` -public void cancelRoomBooking(int roomNumber) -``` The `cancelRoom` method consolidates steps like checking if the room is booked or not, if booked then calculates the refund amount and updates the database using the DAO.