Switching to English... Using the Java API with Akka might result in somewhat ugly code, especially if using the UntypedActor classes. If an actor has many types of messages it can receive, it may result in long "if instanceof" chains. The situation can be improved by using AbstractActors or even TypedActors in some cases. There might be an alternative though. To make the code a bit prettier, one solution can be to loan the idea of traits from Scala. Java interfaces with default methods can be used to achieve similar behavior. Let's say we have an Actor A with some messages [ B, C, D ] it expects. Instead of writing a long handleMessage method with all kinds of if statements, we can set the A to implement interface CTrait . The CTrait has a default method handleC which then handles the C typed message. The CTrait may also force the A to expose some methods so it can do it's job. Finally we need such a setup that handleC is called from A , preferably without ...
Notes about what I do