rosstuck/tactician — pull request #2 by rosstuck (2014-12-30 11:06:52+00:00)
Title: Refactoring directory structure

Hi folks,

This PR reorganizes the directory structure for Tactician. There's a couple reasons to do this, mainly to get all of the core command bus libraries under a single "CommandBus" namespace so the top level Tactician namespace can accommodate more "plugin" packages and also to be more PSR-4-ish.

I also renamed a couple of things: the QueueingCommandBus is renamed to the LockingCommandBus so it's not as easily confused with any future worker queue integration.

There's 3 open questions for me before declaring this setup final.

- Do we like this?
- Is the top level directory for the Command Bus implementations okay? This can grow a bit more over time if we offer other default implementations.
- Should we add an empty Command interface to typehint all Command objects? PHP doesn't allow object as a typehint so we currently just docblock it as "object". However, a couple folks have shown me some rough looking code samples recently where folks pass in strings and arrays to represent commands which I don't think we should support. The only way to enforce that is to create an empty Command interface (which we don't actually need) and requires everyone to tag all commands with the Tactician Command interface. We could (alternately) add an is_object check to the ExecutesHandlerCommandBus, just to weed this out from early users but that's a leaky solution.