The rationale for this is that internal details of the actor (specifically its "this_object_context") are necessary to build a behavior to be used by the actor. So, I think it makes sense that the responsibility for this should rest with the Actor class. Plus, this makes the Actor API more logical and useful. Before, Actor#add_behavior was useless except as an implementation detail used by BehaviorFactory.
In practical terms, these commits shift all the work from the BehaviorFactory class into the Actor#add_behavior and Actor#build_behavior methods (build_behavior is a newly added method). As a result, the BehaviorFactory class is obsolete, but I have retained it for backward compatibility. BehaviorFactory#add_behavior now just calls Actor#add_behavior.
P.S. There are 3 pending Actor specs that I couldn't figure out how to make work, because of the unusual conjecting and mocking going on with actors in the specs.
The rationale for this is that internal details of the actor (specifically its "this_object_context") are necessary to build a behavior to be used by the actor. So, I think it makes sense that the responsibility for this should rest with the Actor class. Plus, this makes the Actor API more logical and useful. Before, Actor#add_behavior was useless except as an implementation detail used by BehaviorFactory.
In practical terms, these commits shift all the work from the BehaviorFactory class into the Actor#add_behavior and Actor#build_behavior methods (build_behavior is a newly added method). As a result, the BehaviorFactory class is obsolete, but I have retained it for backward compatibility. BehaviorFactory#add_behavior now just calls Actor#add_behavior.
P.S. There are 3 pending Actor specs that I couldn't figure out how to make work, because of the unusual conjecting and mocking going on with actors in the specs.