Welcome Guest, Not a member yet? Register   Sign In
Do you wish to see an ORM feature in CI 2.x ?
#1

[eluser]DeaD SouL[/eluser]
Please vote,

and tell us why..?


thanks all
#2

[eluser]WanWizard[/eluser]
I think there are several great ORM implementations available.

In general, the more you move up the application stack, the more difficult it's going to get to find something that works for everyone. CodeIgniters appeal is that it is fast, basic, and extendible.

I think it would be more useful to have a proper CodeIgniter 'addons' site, like mojoaddons, so people know where to find addons, docs, etc. It would also allow some of us to get some beer money to compensate for all those late nights... Wink
#3

[eluser]nelson.wells[/eluser]
Isn't that what the wiki is for?
#4

[eluser]Jelmer[/eluser]
I second WanWizard: with RapidDataMapper, DataMapper Overzealous and Doctrine there's 3 very good choices and AR will do fine for lots of users.

Also agree on the addons website part, had the intention of creating one (already registered codeignitershare.com) but with an unexpected heavy workload in the summer period I never got round to it (but as more work = more money, I'm not complaining Wink).
The problem with both the Wiki and the forums is that the code is divided between the 2. There's no really good categorizing because the wiki isn't really moderated. The forums aren't that good either because they're not categorized at all in Ignited Code. And stuff gets lost in the massiveness of the forums once its older then a week and hasn't been commented upon, which is a shame as there's a lot of good code which you just don't need at the precise moment it's posted but might find very useful later on.
Also on the wiki stuff there's rarely good discussion about the code (which are actually on the forums) which makes it hard to assess the code quality and user experience without reading the whole code yourself.

It would be nice to have a website where libraries, helpers, tutorials etc could be shared, categorized, commented on, reviewed and rated. That would really improve the accessability of what the CI community has to offer.
#5

[eluser]Jondolar[/eluser]
I don't get ORMs. They are soooo resource intensive and for the most part, approach database access and management that violate some best practices.

I spent several months working with Doctrine, only to realize that I could write Active Record code just as fast, make modifications during design time much faster, feel confident that every query was highly optimized and not be painted into a corner with some missing feature or change in direction of the original project.

Now that I think about it, the code gurus that work on CI could probably come up with a kick-ass ORM that would make sense, be easy to use and easy to optimize.
#6

[eluser]Jelmer[/eluser]
I don't know Doctrine and I didn't do full testing with DMZ - so I can't comment on those. But implementing RapidDataMapper actually spead things up for me instead of slowing them down like one would expect from a more complex system.
So my experience doesn't match yours in that respect.

Also ORM's prevent mistakes because they allow you to code stuff in a way that's more logically. And the more logical your code the less chances of forgetting certain work-arounds.
Even if I'd have lost performance implementing RDM I would also recommand it to those losing just a little bit of performace. Sometimes writing more logical code is more important then writing the most precise efficient code. Because the mistakes and harships you might face after writing very complex statements with Active Record, those might cause more problems then a couple percentage points performance difference is worth.

Always try to find a balance, don't just look at 0.1% points in performance - also think about future changes. A system that's completely optimized might give users 0.003 seconds faster load time but might cause you hours upon hours of work implementing changes.
In my opinion a well coded system isn't the most possible efficient system, but a system that keeps the balance between very logical code and performance optimization.
#7

[eluser]pbreit[/eluser]
ORMs seem too "magical" for me. The biggest problem with frameworks is that they move developers too far away from what actually happens and an ORM feels like that for me. It would be used by a handful of developers who appreciate it and confuse the rest.
#8

[eluser]WanWizard[/eluser]
I agree with @Jelmer.

I'm currently busy with a big project with involves a code conversion to Datamapper (DMZ).

With all the magic that happens below the surface, I don't see an increase in memory usage, and only a slight increase in processing time. So far, I've seen one query that I would have written differently, but so far Datamapper does it's job. I do however see an enormous reduction in code, as a lot of validation, conversion or manipulation of data happens behind the scenes, in the model (p.e. serialize/unserialize of a column value). This increases the maintainability of the application, which in turn makes it a lot cheaper for the client to run. The slight decrease in performance is not an issue, a new and faster server for this application is cheaper for the client than hiring me for a week to work on the code.
#9

[eluser]Jelmer[/eluser]
Quote:ORMs seem too “magical” for me. The biggest problem with frameworks is that they move developers too far away from what actually happens and an ORM feels like that for me. It would be used by a handful of developers who appreciate it and confuse the rest.
There's nothing magical about it. In general it's a good thing to code as much DRY as possible, which often means that you'll write helpers/libraries that take care of the lower level programming. Of course it's good to remind yourself from time to time how things work behind the scenes and don't use a sledgehammer (a humongous function) when a normal one (basic PHP) will do. But using libraries that perform repetitive simple tasks in one simple call will result in far better code.

Conventional wisdom is that needing such helpers/libraries will slow you down as they're written genericly and not specificly for the task (if they're well written that is). The end result is often that your code is far easier to read, it's easier to maintain and it's easier to spot mistakes. All of that often results in far better code that will be faster.
But as I mentioned, you should always remain aware what happens behind the scenes. If it looks like magic, make yourself aware what happens behind the scenes by reading the code you're using.
#10

[eluser]Rui Lima[/eluser]
Doctrine is great!




Theme © iAndrew 2016 - Forum software by © MyBB