Question: SDO is sweet, why aren’t developers using it?
Developers will eventually start using it, it will take some time to go from the PHP way to SDO way. It would be easier to jump into SDO once better, more easily interpreted and simple to understand tutorials, code samples, and support is available. IBM tutorials are a little bit technical, with words and complex pictures (UML). Just give me code and explain how it works and let me run with the SDO scissors in my hand.
I just hope IBM and Zend continue the development and not back out, because of the impression that not a lot of developers are using it. The initial investment will pay off once more developers take a look at the wild animal SDO is and say, “Yes, this is awesome!”
My interest was that, in theory, SDO would save a great deal of work. It isn’t a matter of just recoding the source input from database to XML and back again. The switch would require a lot of work, but at least there is a common API which allows for the reading to be handled with consistency.
XML and Databases, but where is Spreadsheet Support?
The reason for why SDO isn’t used as often as some would probably like is because the two things that it currently offers are well taken care of in PHP. You can never have to many choices for handling XML, but combinations of multiple XML extensions can take care of most tasks. For databases, most are going to use MySQL (or MySQLi) or PDO and do you need anything else?
SDO offers the promise of offering more features, but PHP developers will have to do the implementation. Perhaps the two are for basing other future SDO extensions, but it was most likely a lot of programming to offer both XML and Database connections. Two of which would be very difficult from userland. I would like to see access to spreadsheets offered and any number of things that SDO can access.
XML: To many choices
Is that even possible as difficult as XML can be? Many choices are pretty bitchin and even more would be even better.
You have DOM, SimpleXML, XMLReader, XMLWriter, SOAP and WDDX, and finally SDO. If you are really hardcore, you don’t need any of those and just write your own package (not recommended for the sane).
For my work, I use DOM to write XML pages and DOM along with SimpleXML to read XML pages. DOM is quite powerful, and is also very difficult for some tasks and for simple reading, SimpleXML is far better. It helps that DOM and SimpleXML have functions for switching between the two easier. All you’ll need until XMLReader and XMLWriter, which I haven’t used, but does look like I’ll just love and will use them both in the future.
SDO is enchanting with its ArrayAccess for XPath, and I’ll be using SDO XML for that. I’m just not quite “down” with DOM XPath yet and probably won’t be for some time. It is really the only feature for me that gives it an advantage over the other choices, besides ArrayAccess property access.
Databases
Updated: It seems some comments made weren’t based on fact, so I decided to rewrite parts of this section to correct those flaws.
For my development with ArrayAccess it would make more sense to use SDO over PDO, because SDO already has that feature. If I used PDO I would have to write the ArrayAccess method myself. It would save time to use SDO in that case. For those who don’t care about ArrayAccess, PDO probably would be a more logical choice.
Possible reasons for not using SDO include:
- Current speed comparsions of mysql extensions verses PDO suggests that PDO is slower by a considerable degree without emulating prepares. SDO uses PDO for the Relational part, so it is safe to say that SDO will be as fast as PDO if not slower.
- SDO has even more complexity than PDO and the PDO learning curve hasn’t so far been so great. SDO seems easy, as does PDO, but there are probably going to be “gotchas”, like in PDO, that would need to be covered. The best way to use SDO as it was intended and not coding it hackish-ly will also have to be covered in better detail.
To put it bluntly and I’m repeating what others have simply stated before, is that more people are going to use PDO for their database Data Object. SDO still uses PDO, but it is still another layer that developers might not care about.
Conclusion
I’m sorry if I ask a lot more questions, but such SDO requires a great deal of thought for any project. It would be nice if every developer used it, to make working on projects easier. It just needs to offer more backends.
In a couple of years, we’ll look back and ask what the big fuss over developers not using SDO was about. I’m quite sure that enough PHP developers are going to embrace SDO in the coming years depending on the coverage it gets that IBM and Zend’s investment will pay off in the end.
Possibly Related Posts:
- Bullet: E-Book Library Management and Content Server
- Using ZendFramework 2 beta1 For Directory Project
- The Way of Kings and Cosmere Theory
- “In Time” Movie Premise Flawed
- Completing HTTP Library For PHP
I have seen sdo on pecl some time ago, but there was no time to test it till now. it`s one of the next tasks on my todo-list.
I looked at the SDO specs a month ago and I was very impressed with what I saw. I immediately set out to create a test database with some interesting relationships to see how SDO would handle them. Unfortunately, the current SDO_DAS_Relational implementation has one massive drawback: only one foreign key can be defined per table. That pretty much ended my journey into SDO. I’d love to revisit it someday, but I think I’ll wait until some progress is made with the relational DAS driver.
I really shouldn’t write “informative” posts when I can barely keep my eyes open, let alone think. The post was always intended to be my opinion. I can’t speak for other developers, I can only speak for myself. I’m giving my comments as to why the perception is that other developers aren’t using SDO.
The intention was purely ancedotal and was a comment on the discussion some developers are having.
I’ve recently started working on the PHP SDO project and as a newcomer I share you frustration at the lack of simple tutorials. I also struggled with finding information that had been written about the code and how to use it. To that end I’m trying to set up a home web site for the project so that firstly we can get a view about what information is available, over and about all the stuff in PHP PECL, without having to jump from blog to blog. Secondly it would be good to have somewhere to share thoughts on how to improve the technology and record what needs to be added. I’ve got a couple from this blog, a spreadsheet DAS, multiple foreign keys per table in the relational DAS.
I’ll post again when I’ve got the site up to invite you all to chip in with any more thoughts you have about how we can make PHP SDO more effective. If anyone feels motivated to help out with the PHP SDO project in the future then I’d love to hear from you:-)
Yes! Thank you Simon.
I would very much like to see SDO expanded and look forward to more information.
I looked at it quite a bit but ran into three seperate issues which made me decide not to use it for our project. In priority order:
1. No UTF-8 support pending PHP6.
2. Based on a just now released C++ library. (Granted it is an Apache project and their developmenet roadmap is encouraging…)
3. Not included by default in PHP5 builds. This means fewer people will have access to it, and that feeds into the less users/less ongoing cycle.
We’re interested but #1 knocks it out for us (for now anyway).
Lack of UTF-8 is a big showstopper.
We’ve finally put up a homepage to collect together PHP SDO info, hints, wish list etc. Getting a web site up took a little longer than I expected. Eventually the chaps running the osoa.org site very kindly offered me some space on their hosted service so the url is:
http://www.osoa.org/display/PHP/SOA+PHP+Homepage
There’s not much there yet but hopefully we can get more samples and tutorial info up there in due course. Any comments, ideas, etc. for PHP SDO and or the site are more than welcome (I added the UTF-8 comment to the wish list). There is a Google list for the extension so that would be a good place (see the front page of the site).
You’ll see some empty pages there to cover the Service Component Architecture implementation for PHP ready for when that gets released. Seems to make sense to put these related technologies on the same site but its not done yet hence the pages are blank.