Question

In Sitecore I am trying to understand what are the advantages of using Glass Mapper versus other ORMS such as Entity Framework?

Was it helpful?

Solution

The purpose of Glass is to map your Sitecore content data to and from strongly typed classes. The purpose of Entity Framework is to map SQL Server data to and from strongly typed classes.

They both have similar advantages - in that they automate the mapping of raw data into model classes. This helps standardise the process of reading and writing data in your solution, and hopefully help you reduce bugs and increase productivity. They can also help you do things like Unit Test code by abstracting away the data layer.

You could well use both in one project.

But they're not interoperable - you would not use Entity Framework on Sitecore data, and you would not use Glass on SQL Server data.

-- Edit to add --

I realise the general benefits of ORMs have been discussed in another SO question here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top