Re: [akka-user] StateData mutability in AbstractFSM

2016-01-29 Thread James P
Haha, love it. Will print that out and stick a copy on the side of my monitor to keep me reminded :D On Friday, January 29, 2016 at 5:24:51 PM UTC-8, Konrad Malawski wrote: > > Yup, happy hakking! > > // related, a visualisation of the generalised form of the problem from a > talk I'm about to d

Re: [akka-user] StateData mutability in AbstractFSM

2016-01-29 Thread Konrad Malawski
Yup, happy hakking! // related, a visualisation of the generalised form of the problem from a talk I'm about to deliver: // https://www.evernote.com/l/AAkD5JPO-rVM3J5S7bnd1g_awyWstD8kCOIB/image.png ;-) --  Cheers, Konrad 'ktoso’ Malawski Akka @ Typesafe On 30 January 2016 at 09:51:41, James P (

Re: [akka-user] StateData mutability in AbstractFSM

2016-01-29 Thread James P
Hi Konrad, Thanks for the guidance, much appreciated! Good points, will try to stick to immutable data params for FSM. Have a great weekend :) On Friday, January 29, 2016 at 3:40:23 PM UTC-8, Konrad Malawski wrote: > > Technically it may be safe in that case, you're in an Actor after all. > How

Re: [akka-user] StateData mutability in AbstractFSM

2016-01-29 Thread Konrad Malawski
Technically it may be safe in that case, you're in an Actor after all. However I'd argue it's bad style as it mixes an API designed for immutable data passing (the data param of FSM), in a mutable way, which can/will lead to confusion when someone else reads your code. If you want to have (or ar

[akka-user] StateData mutability in AbstractFSM

2016-01-29 Thread James P
Hi folks, Good day. I'm just starting with Akka (Java with Lambda) and I have a question regarding AbstractFSM. When using "*akka.actor.FSM.State.using(Data)*" does "*Data*" need to be immutable? Example: *when(State.Idle,* * matchEvent(Event.class, StateData.class,* * (event, stateData) ->*