Welcome Guest, Not a member yet? Register   Sign In
active record class
#1

[eluser]introvert[/eluser]
I trying using active record class which is available on CI wiki and I'm not that much excited about it as on ruby's active record (I think its a bad replica).

I've been wondering if anyone uses this AR simulator for rapid/advanced application development?

I have a feeling it will just make the concept of my code unclear since I will still use db->get functions most of the time where AR cant help.

What do others think about it?
#2

[eluser]GSV Sleeper Service[/eluser]
It's a misnomer that's for sure, CI 'Active Record' has it's uses, but it's not active record in the well known design pattern sense, it's more of a query builder.

I recommend you check out Doctrine (http://www.doctrine-project.org/), which is very similar to RoR active record, and quite straightforward to use alongside CodeIgniter
#3

[eluser]introvert[/eluser]
Do you use Doctrine? Does it have CI support?
#4

[eluser]BrianDHall[/eluser]
Personally, I prefer ORM and try to pretend SQL and ActiveRecord doesn't exist Smile For that I recommend Datamapper Overzealous Extension.

And yes, GSV is right, ActiveRecord in CI is really just an SQL syntax helper more than anything else.
#5

[eluser]introvert[/eluser]
[quote author="BrianDHall" date="1253734234"]Personally, I prefer ORM and try to pretend SQL and ActiveRecord doesn't exist Smile For that I recommend Datamapper Overzealous Extension.

And yes, GSV is right, ActiveRecord in CI is really just an SQL syntax helper more than anything else.[/quote]

Datamapper looks really great!
#6

[eluser]BrianDHall[/eluser]
[quote author="introvert" date="1253735778"][quote author="BrianDHall" date="1253734234"]Personally, I prefer ORM and try to pretend SQL and ActiveRecord doesn't exist Smile For that I recommend Datamapper Overzealous Extension.

And yes, GSV is right, ActiveRecord in CI is really just an SQL syntax helper more than anything else.[/quote]

Datamapper looks really great![/quote]

I think its just awesome, and I haven't even gotten into the advanced parts like the extensions that help to automate form generation and such.

Its a little tricky at first as you have to go carefully step by step and make sure you setup your has_one and has_many relations on both 'sides' of the relationship and plural vs singular naming of the models, db tables, and db rows as they are the most common errors (and bit me multiple times before I learned them).

But once you spend a little more time setting up your db like this, it is so much easier to actually access the information. DMZ happily puts together complex inner and outer joins and can utilize in table foreign keys on some relationship types to really build nice efficient SQL - yet I on the other hand don't even know how to properly use JOIN. And I kind of hope I'll never need to learn, because I haven't written a line of SQL since I started using ORM and I sure don't miss it.




Theme © iAndrew 2016 - Forum software by © MyBB