Akka and Domain Driven Design

228 views
Skip to first unread message

Josh

unread,
Jan 2, 2012, 5:41:43 PM1/2/12
to Akka User List
I asked this question on the DDD list, but I'm not sure if that was
the appropriate place. I'm wondering, how does Akka fit into Domain
Driven Design (or not)?

A quick detour: In a "typical" DDD application, we might have
application, domain and infrastructure layers where the application
layer consists of services that are use case based and are responsible
for managing transactions and coordinating calls into the domain. In
the domain layer lives the domain model (entities and values) which
(ideally) holds the business logic, and perhaps some domain services
such as repositories that operate on entities. The infrastructure
layer consists of technology specific implementations for things such
as persistence and messaging.

Back to the question: where might Akka and actors fit in?

Cheers,
Josh

Josh

unread,
Jan 2, 2012, 6:26:15 PM1/2/12
to Akka User List
Another way to look at this question is to ask what types of objects
benefit from being modeled as actors? Stateless / stageful? Domain
entities? Application services? Domain services? Infrastructure
services?

Josh

Patrik Nordwall

unread,
Jan 3, 2012, 3:00:55 AM1/3/12
to akka...@googlegroups.com
On Tue, Jan 3, 2012 at 12:26 AM, Josh <paces...@gmail.com> wrote:
Another way to look at this question is to ask what types of objects
benefit from being modeled as actors? Stateless / stageful? Domain
entities? Application services? Domain services? Infrastructure
services?

Actors can be used for all of these, stateful entities and stateless services, but you could also use actors for only stateless services and then use "ordinary" domain model from there.

Stateful entities can be actors and in that case I would recommend using Event Sourcing for persisting the state.
DDD fits well together with event sourcing and CQRS.

Josh

On Jan 2, 2:41 pm, Josh <pacesysj...@gmail.com> wrote:
> I asked this question on the DDD list, but I'm not sure if that was
> the appropriate place. I'm wondering, how does Akka fit into Domain
> Driven Design (or not)?
>
> A quick detour: In a "typical" DDD application, we might have
> application, domain and infrastructure layers where the application
> layer consists of services that are use case based and are responsible
> for managing transactions and coordinating calls into the domain. In
> the domain layer lives the domain model (entities and values) which
> (ideally) holds the business logic, and perhaps some domain services
> such as repositories that operate on entities. The infrastructure
> layer consists of technology specific implementations for things such
> as persistence and messaging.
>
> Back to the question: where might Akka and actors fit in?
>
> Cheers,
> Josh

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.




--

Patrik Nordwall
Typesafe - Enterprise-Grade Scala from the Experts
Twitter: @patriknw


Josh

unread,
Jan 3, 2012, 7:17:36 PM1/3/12
to Akka User List
Good info. Thanks for the link.

On Jan 3, 12:00 am, Patrik Nordwall <patrik.nordw...@gmail.com> wrote:
> On Tue, Jan 3, 2012 at 12:26 AM, Josh <pacesysj...@gmail.com> wrote:
> > Another way to look at this question is to ask what types of objects
> > benefit from being modeled as actors? Stateless / stageful? Domain
> > entities? Application services? Domain services? Infrastructure
> > services?
>
> Actors can be used for all of these, stateful entities and stateless
> services, but you could also use actors for only stateless services and
> then use "ordinary" domain model from there.
>
> Stateful entities can be actors and in that case I would recommend using
> Event Sourcing for persisting the state.
> Inspiration:http://krasserm.blogspot.com/2011/11/building-event-sourced-web-appli...
> Typesafe <http://typesafe.com/> - Enterprise-Grade Scala from the Experts
> Twitter: @patriknw
Reply all
Reply to author
Forward
0 new messages