Monday, February 16, 2009

No Database...Only Model !!

Till date we have spent our lot of time getting data from database, reading through results, pushing data into business class, using data reader and various other methods.

With the Entity framework, we do not query against the schema of the database , but rather against a schema that represents or reflects our business model.

So the very first question comes into our mind is ..'What the benefit of Entity Model over Relation database shema?'
The Entity Framework does the retrival, storing part of the job for you, similar to the way an Object Relational Mapping tool works.

It retrievs the data as object. You work on that object and save the object. EM (Entity Model) itself converts the object to rows and columns and save the data to database.

Not only saving data to database, EM also maintains relationships between tables (called Entity) . Relationship can be as Association like one to one, one to many and even many to many, inheritance etc.

So you can store data to various tables if you create instance of one entity (table) and that entity have reference to various other entities.

In next blog, I will show an example to clear this logic.


No comments:

Post a Comment