Jump to content

opinion about ORM


birbal

Recommended Posts

Do you use ORM in your production or commercial application? I think ORMs are good for maintaining OO relation with datbase, But it has its limitation. For DML ORM is great for faster development and minimize duplication of code. But for DQL I think it is hard to do complex SQLs with ORM. Raw SQL would go along well.

I have read somewhere it is not good to fit something like RDBMS to OO which it is not. Anyway i dont know how many open source and commercial application uses it. It looks like OSCommerce prefer to not use ORM.

 

I have own written active record like ORM which uses Reflection to map the classess. It works well with DML and DQL (one to one,one to many relations). But have some issues with many to many relations (It could be resolved though i think). Though it serving well , I am not much happy with it as i expected. I can even see if i use Raw SQL i could even mnimize (for DQL) one or two query than that ORM. Though that helps to reduce writing code manually a lot.

 

Conclussion, I have decided to use it in DML part. and change the DQL part to be raw SQL specially in many to many relations table and complex queries.

 

From this disappointment i look into other ORM like doctrine or propel. But they have learning curve and fairly complex. They I think do lot of things than i need. Currently I am not in position to invest time to read and grasp whole doctrine/propel and at the end , find the same conclussion as above. I know benfits and drawbacks of ORM, still hearing any experience regarding this would helpful. Another query does Doctrine supports temporary tables or not ?

 

Even I tried to install doctrine. But composer showing some error. Before i resolved it and invest time. i would like to hear your story with ORM.

Edited by birbal
  • Like 1
Link to comment
Share on other sites

I have just started looking at ORM and it seems like an interesting concept. I would like to see how I can use it to create a persistence layer for my API applications and provide a buffer between my services controllers and the actual database implementation itself. Currently I inject PDO into my Service controllers and was thinking about wrapping PDO into a database class to represent the persistence layer that way.

 

However, right after that, I found out about Paris.

http://culttt.com/2013/02/11/what-is-object-relational-mapping/

http://j4mie.github.io/idiormandparis/

 

So, I don't have much of an opinion yet, but hoping to get into some discovery on it all by the end of the week.

Edited by thescientist
Link to comment
Share on other sites

@theScintist Thats ORM sounds new to me. Will check it later. Let us know about your opinion, when you are done with it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...