[TYPO3-mvc] Discussion: Storage Backend not compatible to DBAL
Jochen Rau
jochen.rau at typoplanet.de
Mon Nov 30 04:36:10 CET 2009
Hi Steffen,
sorry for being absent in this discussion started by me.
Steffen Ritter wrote:
>> There is an open issue "Typo3DBBackend.php not compatible to DBAL" on
>> forge.
>>
>> http://forge.typo3.org/issues/show/5374
[...]
> since the "fast Version" of rewriting did not get into 4.3 (sry i did
> not have the time for finishing patch due to an "clients emergency"
> (server break)) i would say for 4.4 we should provide a clean solution.
>
> BUT: providing backends for all instead of using DBAL is not a solution
> to me.
>
> Why?
> 1. mixed envirenments would not be supported (as of DBAL)
They could be easily supported, if we provide a solution to select the
Storage Backend for each class. Dependency Injection comes in mind.
> 2. table Mappings would not be supported (mapping feature of extbase
> works only within one database)
This is related to 1. and is only a matter of configuration.
> 3. reinvent the wheel? better join forces an optimize DBAL
No. I don't want to reinvent the wheel. There is a lot of knowledge
inside DBAL. I suggest to reuse this knowledge and build it upon a clean
architecture.
Currently DBAL is structured like this (very simplified)
function INSERT () {
switch(type) {
case 'native':
// some stuff
break;
case 'adodb':
// a lot of stuff
break;
case 'userdefined':
//some stuff
break;
}
}
function UPDATE () {
switch(type) {
case 'native':
// some stuff
break;
case 'adodb':
// a lot of stuff
break;
case 'userdefined':
//some stuff
break;
}
}
function SELECT () {
switch(type) {
case 'native':
// some stuff
break;
case 'adodb':
// a lot of stuff
break;
case 'userdefined':
//some stuff
break;
}
}
And I still propose to have
StorageBackendInterface
- AbstractStorageBackend <- some common functionality
- AbstractAnsiSqlBackend <- does most of the parsing
- MySqlBackend
- AdodbBackend
- PostgresBackend
- PdoBackend
- [userdefinded]
which is much cleaner IMO.
Is it worth the effort? I think it is. Why?
It's far more attractive for other developers to extend and improve the
system because they only have to dig into a small classes (like
PostgresBackend). It's clean and modular.
Regards
Jochen
--
Every nit picked is a bug fixed
More information about the TYPO3-project-typo3v4mvc
mailing list