Ͱ&WFOUൃߦ w !&WFOU4PVSDJOH)BOEMFS w &WFOUͷॲཧ w ϏδωεϩδοΫͷू w ݱ࣮ͷཁ݅Λهड़ w ޱ࠲ #BOL"DDPVOU w ޱ࠲ʹೖۚ͢Δ %FQPTJU.POFZ$PNNBOE w ޱ࠲ʹೖۚ͞Εͨ .POFZ%FQPTJUFE&WFOU w υϝΠϯʹෆཁͳॲཧ"YPOଆͰࣗಈ࣮ߦ w σʔλ &WFOU ͷอଘ w &WFOUཤྺ͔Βݱࡏঢ়ଶͷ෮ݩ SFQMBZ @Aggregate class BankAccount { @AggregateIdentifier String id; double balance; String owner; @CommandHandler void on(DepositMoneyCommand command) { double amount = command.getAmount(); Assert.isTrue(amount > 0.0, "Deposit must be a positive number."); apply(new MoneyDepositedEvent(id, amount)); } @EventSourcingHandler void on(MoneyDepositedEvent event) { this.balance += event.getAmount(); } }