Compare commits

...

11 Commits

Author SHA1 Message Date
allcontributors[bot]
d584404df6 docs: update .all-contributorsrc [skip ci] 2020-08-17 16:10:21 +00:00
allcontributors[bot]
353a2d9fcf docs: update README.md [skip ci] 2020-08-17 16:10:20 +00:00
allcontributors[bot]
a1c96ede13 docs: update .all-contributorsrc [skip ci] 2020-08-15 17:53:38 +00:00
allcontributors[bot]
0d2c4abe5a docs: update README.md [skip ci] 2020-08-15 17:53:37 +00:00
Ilkka Seppälä
e7e3ace01f Merge pull request #1489 from iluwatar/all-contributors/add-RayYH
docs: add RayYH as a contributor
2020-08-11 17:30:33 +03:00
allcontributors[bot]
41dacc2e2e docs: update .all-contributorsrc [skip ci] 2020-08-11 14:29:45 +00:00
allcontributors[bot]
dc7bf6190d docs: update README.md [skip ci] 2020-08-11 14:29:44 +00:00
Ilkka Seppälä
98d2dc0104 Merge pull request #1487 from RayYH/master
fix word typo
2020-08-11 17:29:06 +03:00
Ilkka Seppälä
870d44b127 Fix layout 2020-08-11 17:26:05 +03:00
Ilkka Seppälä
834f20911b Merge pull request #1488 from iluwatar/all-contributors/add-ashishtrivedi16
docs: add ashishtrivedi16 as a contributor
2020-08-11 17:23:22 +03:00
rayyh
b91bbc773d fix word typo 2020-08-11 14:19:39 +08:00
4 changed files with 25 additions and 8 deletions

View File

@@ -1102,6 +1102,25 @@
"contributions": [
"code"
]
},
{
"login": "RayYH",
"name": "洪月阳",
"avatar_url": "https://avatars1.githubusercontent.com/u/41055099?v=4",
"profile": "https://rayyounghong.com",
"contributions": [
"code"
]
},
{
"login": "xdvrx1",
"name": "xdvrx1",
"avatar_url": "https://avatars0.githubusercontent.com/u/47092464?v=4",
"profile": "https://xdvrx1.github.io/",
"contributions": [
"review",
"ideas"
]
}
],
"contributorsPerLine": 4,

View File

@@ -9,7 +9,7 @@
[![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=alert_status)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-121-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-123-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
# Introduction
@@ -250,6 +250,8 @@ This project is licensed under the terms of the MIT license.
</tr>
<tr>
<td align="center"><a href="https://www.linkedin.com/in/ashish-trivedi-218379135/"><img src="https://avatars3.githubusercontent.com/u/23194128?v=4" width="100px;" alt=""/><br /><sub><b>Ashish Trivedi</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ashishtrivedi16" title="Code">💻</a></td>
<td align="center"><a href="https://rayyounghong.com"><img src="https://avatars1.githubusercontent.com/u/41055099?v=4" width="100px;" alt=""/><br /><sub><b>洪月阳</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=RayYH" title="Code">💻</a></td>
<td align="center"><a href="https://xdvrx1.github.io/"><img src="https://avatars0.githubusercontent.com/u/47092464?v=4" width="100px;" alt=""/><br /><sub><b>xdvrx1</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/pulls?q=is%3Apr+reviewed-by%3Axdvrx1" title="Reviewed Pull Requests">👀</a> <a href="#ideas-xdvrx1" title="Ideas, Planning, & Feedback">🤔</a></td>
</tr>
</table>

View File

@@ -45,7 +45,7 @@ public final class InitializingOnDemandHolderIdiom {
}
/**
* Sigleton instance.
* Singleton instance.
*
* @return Singleton instance
*/

View File

@@ -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.