Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Translating business logic into Akka Actors

Received: by 10.180.93.68 with SMTP id cs4mr1041230wib.3.1335982690942;
        Wed, 02 May 2012 11:18:10 -0700 (PDT)
X-BeenThere: akka-user@googlegroups.com
Received: by 10.216.8.20 with SMTP id 20ls774322weq.2.gmail; Wed, 02 May 2012
 11:18:08 -0700 (PDT)
Received: by 10.180.94.38 with SMTP id cz6mr1050815wib.1.1335982688259;
        Wed, 02 May 2012 11:18:08 -0700 (PDT)
Received: by 10.180.94.38 with SMTP id cz6mr1050814wib.1.1335982688247;
        Wed, 02 May 2012 11:18:08 -0700 (PDT)
Return-Path: <goo...@rkuhn.info>
Received: from mailhost.rkuhn.info (rk.rkuhn.info. [188.40.99.246])
        by gmr-mx.google.com with ESMTP id dr4si7437253wib.3.2012.05.02.11.18.08;
        Wed, 02 May 2012 11:18:08 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of goo...@rkuhn.info designates 188.40.99.246 as permitted sender) client-ip=188.40.99.246;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of goo...@rkuhn.info designates 188.40.99.246 as permitted sender) smtp.mail=goo...@rkuhn.info
Received: from localhost (localhost [127.0.0.1])
	by mailhost.rkuhn.info (Postfix) with ESMTP id E01A93F829D;
	Wed,  2 May 2012 20:18:07 +0200 (CEST)
Received: from mailhost.rkuhn.info ([127.0.0.1])
	by localhost (rk.rkuhn.info [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id QKqnYphzEOCj; Wed,  2 May 2012 20:18:07 +0200 (CEST)
Received: from rk.lan (90-229-179-63-no217.tbcn.telia.com [90.229.179.63])
	by mailhost.rkuhn.info (Postfix) with ESMTPS id A98FD3F8295;
	Wed,  2 May 2012 20:18:07 +0200 (CEST)
Received: from [127.0.0.1] (unknown [127.0.0.1])
	by rk.lan (Postfix) with ESMTP id F18DC11F9984;
	Wed,  2 May 2012 20:18:06 +0200 (CEST)
Subject: Re: [akka-user] Translating business logic into Akka Actors
Mime-Version: 1.0 (Apple Message framework v1257)
Content-Type: multipart/alternative; boundary="Apple-Mail=_08585D16-02DA-4FFF-96DB-0F6472EBA7D6"
From: Roland Kuhn <goo...@rkuhn.info>
In-Reply-To: <33117062.2220.1335982372788.JavaMail.geo-discussion-forums@pbvd8>
Date: Wed, 2 May 2012 20:18:06 +0200
Message-Id: <92F9F238-6007-45D9-B58A-0476D7F61...@rkuhn.info>
References: <81983be6-2488-4f67-b673-3c5ec99e8...@n5g2000vbf.googlegroups.com> <5F13B78C9EC34E7DAA9BC4D13DB7F...@typesafe.com> <33117062.2220.1335982372788.JavaMail.geo-discussion-forums@pbvd8>
To: akka-user@googlegroups.com
X-Mailer: Apple Mail (2.1257)


--Apple-Mail=_08585D16-02DA-4FFF-96DB-0F6472EBA7D6
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

Hi Andy,

On May 2, 2012, at 20:12 , andy wrote:

> Just wanted to offer my two cents.=20
>=20
> If you're business logic is more than trivial I suggest writing your =
business objects as you would normally and then put that object in an =
actor. I find that for handling complex state code there are generally =
two types of states and transitions -- business and runtime. I think =
this works perfectly with the actor model. Put your business code in =
normal scala classes( even better if you use the GOF state pattern and =
keep those objects immutable ) and then put your runtime logic in the =
actor that contains the business object. I have used the FSM actor and I =
still use it for some simple use cases. I ended up doing a big refactor =
away from the FSM because the code became way too hard to maintain =
because of the mixing of the two types of state logic in one class.
>=20
I=92d be very much interested in seeing an example of where FSM fails =
you, if you can share (off-list, if you prefer). I=92m always looking =
for feedback and possible enhancements.

Regards,

Roland Kuhn
Typesafe =96 The software stack for applications that scale.
twitter: @rolandkuhn



--Apple-Mail=_08585D16-02DA-4FFF-96DB-0F6472EBA7D6
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=windows-1252

<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi =
Andy,<div><br><div><div>On May 2, 2012, at 20:12 , andy wrote:</div><br =
class=3D"Apple-interchange-newline"><blockquote type=3D"cite">Just =
wanted to offer my two cents.&nbsp;<div><br></div><div>If you're =
business logic is more than trivial I suggest writing your business =
objects as you would normally and then put that object in an actor. I =
find that for handling complex state code there are generally two types =
of states and transitions -- business and runtime. I think this works =
perfectly with the actor model. Put your business code in normal scala =
classes( even better if you use the GOF state pattern and keep those =
objects immutable ) and then put your runtime logic in the actor that =
contains the business object. I have used the FSM actor and I still use =
it for some simple use cases. I ended up doing a big refactor away from =
the FSM because the code became way too hard to maintain because of the =
mixing of the two types of state logic in one =
class.</div><div><br></div></blockquote><div>I=92d be very much =
interested in seeing an example of where FSM fails you, if you can share =
(off-list, if you prefer). I=92m always looking for feedback and =
possible =
enhancements.</div><div><br></div><div>Regards,</div></div><br><div>
<span class=3D"Apple-style-span" style=3D"border-collapse: separate; =
color: rgb(0, 0, 0); font-family: 'Garamond Premier Pro'; font-style: =
normal; font-variant: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; orphans: 2; text-align: -webkit-auto; =
text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; font-size: medium; =
"><div><p>Roland Kuhn<br><a =
href=3D"http://typesafe.com/">Typesafe</a><span =
class=3D"Apple-converted-space">&nbsp;</span>=96&nbsp;The software stack =
for applications that scale.<br>twitter:<span =
class=3D"Apple-converted-space">&nbsp;</span><a =
href=3D"http://twitter.com/#!/rolandkuhn">@rolandkuhn</a></p></div></span>=

</div>
<br></div></body></html>=

--Apple-Mail=_08585D16-02DA-4FFF-96DB-0F6472EBA7D6--