views:

117

answers:

1

Roughly a month ago (after christmas) i found this post and realized how useful reflection is. So i decided to learn and got carried away and spent around 10days on this which became a ORM for sql(ite).

My question is, is there anything wrong with this ORM is used? I never used an ORM before and i heard you should not write one yourself. I dont see what is wrong with mine except maybe lacking functionality compared to others. So what is wrong with this ORM? (Links below)

The idea was i should write class normally, avoid tagging fields with attribute as much as possible and to insert extremely easy. I though update logic may be too complex and the user really should write the queries instead of assuming, getting things wrong or play a game of how to tag the class. So theres none of that, just simple inserts and filling up your own queries if its trivial. I wrote a tutorial for my friend 2 weeks ago. It seems to compile and run, so judging by that what is wrong with my ORM?

http://codepaste.net/29xkub
http://codepaste.net/qnrira

Also i dont want to continue this and have it grow. So far i used it in 3 projects and had no problems but is there another ORM that does what this does? foreign keys are a must and ATM i dont have this implemented solely because i am waiting for http://sqlite.phxsoftware.com/ to update to 3.6.19+

+3  A: 

The only reason for not writing one yourself is similar to why you would use the .net framework - it's already been done, probably been used in anger in a number of projects and has probably dealt with whatever edge cases you have not thought of...

Paddy
The problem is i dont know anything about ORMs. I know i shouldnt write libs because it grows thus I dont want to write and asked what can do what my example does. This seems good enough and only has 10days. I know i shouldnt write more and i plan not too but what does what my example does? I seen NHibernate and it doesnt appear to do what mine does and Subsonic doesnt seem to do multiple inserts nor foreign keys.
acidzombie24