There are of course downsides to using 3rd party libraries like doctrine's DBAL, and some good things too.Bad:* Tied to their API even when its less than exactly what we want. While we can mess around and add more layers on top, I think that's a leaky abstraction that will only cause problems down the road.
As of reading of this José's post:I think Cake's goal 3.0 can be achieved using Doctrine's DBAL without problem. Custom types, query builder, native and pdo driver supports, etc. You guys have to build ORM layer on top of the database layer, so please focus on that and use the doctrine for the layer below it. There may be almost no differences between doctrine's DBAL and your newly created database layer.
* Documentation becomes more tricky as we either end up duplicating documentation present in doctrine, or people now have 2 places to look up API methods and usage documentation.
My opinion is that beginners should not directly use the underneath functions not so casual. If you use database and you think you can't do with Cake's standard Model, maybe you are wrong. That's the way Cake will lead programmers do the right thing.For intermediate users, they already know documentations resides in many places, not only in Cake's site, but also on custom plugin sites, Smarty sites, or even on php.net.- Basuke
So one other gotcha with using dependencies like Doctrine DBAL is it becomes impossible to download a zip file and have a working application. The DBAL library would exist outside of the CakePHP repo, and require people to run composer before they can really do work.
Skype: grahamweldon
I do not think it is necessary to incorporate another ORM into the CakePHP framework, nor do I feel that any better result would be obtained. When confronted with a need to refactor, using an off-the-shelf alternative is essentially the same as starting from scratch: both are inherently bad ideas.
This is not to say that major changes are not necessary (they are) or that CakePHP has a remarkably good ORM layer (it does not). It does have the ultimate practical virtue of working near enough as it ought, and presents a relatively reasonable API to the classes that utilize it. The proper type of change, therefore, is not a fresh start, but an evolutionary approach.
I recently (re-)wrote a datasource for arbitrary OAuth-enabled APIs; the process involved coming up against some rather unpleasant limitations of CakePHP's model layer. The concept of relational, SQL-speaking databases is a fairly hard dependency.
At about the same time I noted a discussion here on the topic of whether the model layer should return objects or arrays, with many adherents of both. This struck me as essentially a need for some sort of presentational logic within the model layer. Why should we not, then, have a class to format the responses from the model layer? (answer: it may not be necessary) It seems logical enough to suppose that, if MVC represents a division of types of logic within an application, that same division can be applied to each layer of the application, and perhaps to each class individually.
Unsurprisingly, my revolutionary idea had already occurred to others, and been formalized as 'Hierarchical Model-View-Controller', or 'HMVC'. Moreover there seemed to be a good number of frameworks already using this idea! Upon further examination, however, I was dismayed to see that most of these seemed to only consider the (to me) trivial case of using more than one controller for a given view. The model layer was invariably some variation on ActiveRecord.
And so I've spent a great deal of time thinking, and writing, and a little bit of time coding. All other things being equal, I would rather test ideas by experimentation rather than collective opinion. Nevertheless, I present to you the sketch of my solution to the problem of what to do with the model layer.
https://github.com/tenebrousedge/cakephp/wiki/Ideas-for-3.0
Patrick Leahy
( ten1 on #cakephp )