Spot is distributed with Alloy as a Plugin, and enabled by default in
the app/config/app.php 'plugins' config key. If you don't want to use
it, just disable the plugin by removing it from the plugins array, and
it won't load or be used at all.
There are no dependencies on Spot in Alloy - Alloy can run without any
ORM at all and you can just use custom classes with PDO or mysql_query
if you want to :). The calls you see from the Kernel like "$kernel-
>mapper()" are actually mixin methods added by the Spot plugin at
runtime (proxied through the Kernel's __call magic method):
https://github.com/alloyphp/alloy/blob/master/alloy/Plugin/Spot/Plugin.php#L27
And the Kernel methods that enable the callbacks:
https://github.com/alloyphp/alloy/blob/master/alloy/lib/Alloy/Kernel.php#L782
You can absolutely use Doctrine2 or any other ORM you want. It's just
a matter of creating a plugin and enabling it. I would be happy to
help you make a Doctrine2 plugin if you want to use it - it has been
requested a few times before by other people as well, and it would be
a great addition to Alloy as an optional plugin to download.
Spot is the PHP 5.3 version of phpDataMapper. The main advantage with
Spot is just that it's lighter, smaller, simpler, and easier to work
with than a more robust solution like Doctrine2. Like Alloy itself,
Spot just does the bare minimum stuff required for 80% of users to
make life simpler, while trying to not cross the complexity line most
developers are not comfortable going beyond. My personal beliefs
regarding ORMs is that they're great for simplifying all the CRUD
stuff and table relations (the 80%), but generally suck at joins and
more complex queries (the 20%). As a result, Spot doesn't have any
support for joins or subqueries at all in the query builder like most
other ORMs do. I believe that if these are required in your code, they
should be done using hand-written SQL for maximum efficiency and
readability. It's really just a matter of taste, preferences, and
personal programming style more than anything else.