Because my first question was so long, I'm asking this as a separate question. It's another one about the architecture of an actor-based application.
Keeping track of message paths through an Application
Let's take a piece of Java code:
public void deleteTrades(User user, Date date) {
PermissionSet ps = permissionService.findPermissions(user)
if (ps.hasPermission("delete")) {
Set<Trade> ts = peristence.findTrades(date);
reportService.sendCancelReports(ts);
positionService.updateWithDeletedTrades(ts);
}
}
In this code I have 4 separate components and the interaction between them required for the procedure deleteTrades
is well-defined. It's completely contained in the method deleteTrades
.
Modelling this with Actor
s and replacing my 4 components with 4 separate actors, how do I keep track (in my mind) of what a procedure involves? Particularly if I'm avoiding using the !?
operator, then it's likely that I'll be sending a message ConditionalDelete
to my PermissionActor
, which will be sending a message GetTradesAndDelete
to my PersistenceActor
which will then send further messages etc etc. The code to process a delete will be strewn across my application.
It also means that pretty much every actor needs a handle on every other actor (in order to forward messages).
As in my previous question, how do people deal with this? Is there a good modelling tool which lets you keep track of all this? Do people use !?
Am I turning too many components into Actor
s?