I have attached the file that explains the example: <https://lh3.googleusercontent.com/-QP8hUDfcCNM/VY36ukbUF4I/AAAAAAAABIA/7Ug6g2kTbsM/s1600/ES.png>
On Friday, June 26, 2015 at 8:01:50 AM UTC-5, wonderful world wrote: > I was going through this PersistentActor example > <http://www.typesafe.com/activator/template/akka-sample-persistence-java#code/src/main/java/sample/persistence/PersistentActorExample.java> > , > and was little confused by the *Evt *class. > > > > In the following example, I have an account and series of transactions. > > 1. If I design an *AccountActor* based on *PersistentActor*, what should > pass as *data*? Is it a string like "1/Jan/2000,Deposit from > 1372,+10,000.00"? > 2. Anytime when the customer access his account, he should see his *Current > Balance*. One way to handle this is to create another actor for the > account and update the *Current Balance* whenever event is stored. But > saving this Current Balance as a snapshot is good. This customer may be a > passive customer, so does not want to keep the account actor in memory all > the time. Should I calculate the *Current Balance* by reading all the > events manually and calculating it? Or should I tell the *snapshotactor* > what *persistentactor* I'm using and provide a handler to the > *snapshotactor* to calculate the Current Balance? > 3. If I don't use a *snapshotactor*, and events only how would I design > the *Evt *so the *Current Balance *is calculated every time when the > actor becomes active? Should I do that in the *Prestart* of the actor? > > > From Greg Young's Event Store > <http://docs.geteventstore.com/introduction/event-sourcing-basics/> > > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
