1

Is there a design pattern that would be commonly applied to facilitate the separation of concerns between an Akka actor's message handling and the business logic that it implements?

1 Answers1

1

Not specific to Akka but I think one reasonable approach is to put the logic into traits a la the "cake" pattern:

http://www.cakesolutions.net/teamblogs/2011/12/19/cake-pattern-in-depth

Though it's more broadly a pattern for doing dependency injection, you can apply with actors as well. Your trait can contain re-usable functions you can mix in and Using the self-type annotation in your trait can theoretically allow your business logic code to access actor state (only if absolutely necessary).

simonl
  • 1,240
  • 7
  • 19