diff --git a/event-sourcing/README.md b/event-sourcing/README.md index 8bec3c52a..423f892cb 100644 --- a/event-sourcing/README.md +++ b/event-sourcing/README.md @@ -16,7 +16,7 @@ Instead of storing just the current state of the data in a domain, use an append ## Applicability Use the Event Sourcing pattern when -* You need very high performance on persisting your application state even your application state have a complex relational data structure +* You need very high performance on persisting your application state even your application state has a complex relational data structure * You need log of changes of your application state and ability to restore a state of any moment in time. * You need to debug production problems by replaying the past events. diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/app/App.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/app/App.java index ac11782cf..d356a8b99 100644 --- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/app/App.java +++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/app/App.java @@ -34,7 +34,7 @@ import java.util.Date; import lombok.extern.slf4j.Slf4j; /** - * Event Sourcing : Instead of storing just the current state of the data in a domain, use an + * Event Sourcing: Instead of storing just the current state of the data in a domain, use an * append-only store to record the full series of actions taken on that data. The store acts as the * system of record and can be used to materialize the domain objects. This can simplify tasks in * complex domains, by avoiding the need to synchronize the data model and the business domain, @@ -42,11 +42,11 @@ import lombok.extern.slf4j.Slf4j; * transactional data, and maintain full audit trails and history that can enable compensating * actions. * - *
This App class is an example usage of Event Sourcing pattern. As an example, two bank account - * is created, then some money deposit and transfer actions are taken so a new state of accounts is - * created. At that point, state is cleared in order to represent a system shot down. After the shot - * down, system state is recovered by re-creating the past events from event journal. Then state is - * printed so a user can view the last state is same with the state before system shot down. + *
This App class is an example usage of an Event Sourcing pattern. As an example, two bank accounts + * are created, then some money deposit and transfer actions are taken, so a new state of accounts is + * created. At that point, state is cleared in order to represent a system shut-down. After the shut-down, + * system state is recovered by re-creating the past events from event journals. Then state is + * printed so a user can view the last state is same with the state before a system shut-down. * *
Created by Serdar Hamzaogullari on 06.08.2017. */ diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/domain/Account.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/domain/Account.java index 429fd61d2..177348be8 100644 --- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/domain/Account.java +++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/domain/Account.java @@ -115,7 +115,7 @@ public class Account { /** * Handles the AccountCreateEvent. * - * @param accountCreateEvent the account create event + * @param accountCreateEvent the account created event */ public void handleEvent(AccountCreateEvent accountCreateEvent) { AccountAggregate.putAccount(this); diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/AccountCreateEvent.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/AccountCreateEvent.java index 71ea65ca3..9e6b40e62 100644 --- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/AccountCreateEvent.java +++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/AccountCreateEvent.java @@ -29,8 +29,9 @@ import com.iluwatar.event.sourcing.state.AccountAggregate; import lombok.Getter; /** - * This is the class that implements account create event. Holds the necessary info for an account - * create event. Implements the process function that finds the event related domain objects and + * This is the class that implements account created event. + * Holds the necessary info for an account created event. + * Implements the process function that finds the event-related domain objects and * calls the related domain object's handle event functions * *
Created by Serdar Hamzaogullari on 06.08.2017. @@ -42,7 +43,7 @@ public class AccountCreateEvent extends DomainEvent { private final String owner; /** - * Instantiates a new Account create event. + * Instantiates a new Account created event. * * @param sequenceId the sequence id * @param createdTime the created time diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyDepositEvent.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyDepositEvent.java index f094e8f6b..96afd4640 100644 --- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyDepositEvent.java +++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyDepositEvent.java @@ -31,7 +31,7 @@ import lombok.Getter; /** * This is the class that implements money deposit event. Holds the necessary info for a money - * deposit event. Implements the process function that finds the event related domain objects and + * deposit event. Implements the process function that finds the event-related domain objects and * calls the related domain object's handle event functions * *
Created by Serdar Hamzaogullari on 06.08.2017. diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyTransferEvent.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyTransferEvent.java index 2f0a0cb52..18d98cded 100644 --- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyTransferEvent.java +++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/event/MoneyTransferEvent.java @@ -31,7 +31,7 @@ import lombok.Getter; /** * This is the class that implements money transfer event. Holds the necessary info for a money - * transfer event. Implements the process function that finds the event related domain objects and + * transfer event. Implements the process function that finds the event-related domain objects and * calls the related domain object's handle event functions * *
Created by Serdar Hamzaogullari on 06.08.2017. diff --git a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/JsonFileJournal.java b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/JsonFileJournal.java index 42283c460..048e270e2 100644 --- a/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/JsonFileJournal.java +++ b/event-sourcing/src/main/java/com/iluwatar/event/sourcing/processor/JsonFileJournal.java @@ -91,7 +91,7 @@ public class JsonFileJournal { } else if (domainEvent instanceof MoneyTransferEvent) { jsonElement = gson.toJsonTree(domainEvent, MoneyTransferEvent.class); } else { - throw new RuntimeException("Journal Event not recegnized"); + throw new RuntimeException("Journal Event not recognized"); } try (var output = new BufferedWriter( @@ -113,7 +113,7 @@ public class JsonFileJournal { /** - * Read next domain event. + * Read the next domain event. * * @return the domain event */ diff --git a/event-sourcing/src/test/java/IntegrationTest.java b/event-sourcing/src/test/java/IntegrationTest.java index 6d30a89fc..9e15a2163 100644 --- a/event-sourcing/src/test/java/IntegrationTest.java +++ b/event-sourcing/src/test/java/IntegrationTest.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; /** - * Intergartion Test for Event Sourcing state recovery + * Integration Test for Event-Sourcing state recovery *
* Created by Serdar Hamzaogullari on 19.08.2017. */ @@ -95,4 +95,4 @@ class IntegrationTest { assertEquals(accountOfJonBeforeShotDown.getMoney(), accountOfJonAfterShotDown.getMoney()); } -} \ No newline at end of file +}