A friend of mine programs in php and ruby. But we were talking about our projects and I brought up how I don't do much database type applications because I find it boring. And we somehow got on the subject of SQL.

This is more of a discussion question, as I am not looking for the solution to any definitive problem.

Im new to the whole LINQ concept. I never have used it, but I have seen it used, and It seems to be a kinda of "middle man" between objects and databases or XML files. And someone please correct me if Im wrong. But it seems to be a way of using queries to choose properties from objects in a collection as if there were in a database.

That seems a bit opposite of what I am looking for. I was introduced a concept, that there could be an object. that could be mapped to a database. And it would be as simple as inheriting a new class from this object, specifying its database path and type, Then choosing from it a table, the inherited object would then have properties of the same name as the columns in the table and could be manipulated easily, then calling an inherited method like .save(); would simply update your database, with no direct SQL strings having to ever be created , adapted, or executed.

anyone know of this and in a feeling to share? or can someone suggest some good reading material on the matter, and please only serious links.

Recommended Answers

All 6 Replies

Alright. I have read those pages in full. The First page shows how to use the designer to map an sql server 2000 database automatically to an object. and that's pretty simple, but what about say a MS Access database, something more modular like for a desk top application? The 2nd page shows describes using javascript to interact with an XML file for setting for some 3rd party tool called Hibernate.

Am I to understand that in order to use ORM I need some outsides tools? that the .net framework can't naively do this through code?

This was described to me in a way that had me picturing an object that was inheritable, that when you created a new object that inherited from it, it passed back to the base a datasource type like oleDBConnection and a connection string for it. this new object would be a collection of all the objects in the datebase, and would support methods to easily update, remove, save, refresh ect. From the database without writing any sql execution codes, or having to adapt from the return information to use it.

it would simply be an object you would define with properties of each column. change something a property in on of the objects, and call its update method, and the database it updated.

am I not getting this right? how is this done?

Yes you got it right, It just mapping to database object.
Because it separates Data Access Layer from Logic Access Layer by putting these objects (Creating by ORM) to make life more easier and more separated.

I think I got the concept, I just can't seem to put it into action. I would like to create a intermediate layer for an access database for use with a simple desktop application. Its just not going well. maybe i will just stick with SQL.

But ORM very useful for large business applications. You mayn't find the reason to use it.

My friend swears by it using sql server and php. he told me I could use a embeddable version of SQLite, and get an easy ORM library for it. I will look into that.

Thanks Ramy

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.