Mahdi Taghizadeh I'm who I'm!

2Jun/105

EAV and the .NET Framework

Recently I've been working on a web application's database model in which I had different types of products and services that my client is going to offer in his eShop. The problem was different nature of attributes each type had and I should have defined a relationship between them and my online order pipleline. Using the common relational database approach I finished up with an OrderDetail table which had multiple foreign keys related to tables which was representing different kinds of products. Anyway, I'm not going to explain my project details here. That was a preface to explain a concept that Farid Arzpeyma introduced to me: Entity-Attribute-Value (EAV) Model, an approach that is widely used in enterprise eCommerce platforms like Magento.

There are many documents and articles out there describing EAV, its concept, principals and usages and I'm not going to talk about it here but quoting this which describes it shortly:

Entity-Attribute-Value model (EAV), also known as object-attribute-value model and open schema is a data model that is used in circumstances where the number of attributes (properties, parameters) that can be used to describe a thing (an "entity" or "object") is potentially vast, but the number that will actually apply to a given entity is relatively modest. In mathematics, this model is known as a sparse matrix.

What I came up with in my mind was possible existing frameworks for .NET developers to implement this model in their applications. Because EAV breaks the rule in which we're urged to use a vertical data representation (using columns) - by introducing another method of collecting data records and their types in table rows - it's necessary to adopt our OOP code to smoothly interact with this new structure. By the time Microsoft hadn't released SQL Server 2005, storing hierarchical data structures was a painful handy job for database developers but at the time Microsoft introduced XML datatype with SQL Server 2005 it became easier for them to natively store such structures right inside a column in a database. EAV is a similar concept and its main goal is to enable developers store attribute/value information in a table in a hierarchical manner.

Unfortunately it seems that there have been very few interests in the .NET community to work on open source frameworks in order to work with EAV database models. My searches shows a disappointing number of articles, blog posts and tools for this purpose.

The first article I found was Entity-Attribute-Value (EAV) model with SQL Server 2005 xml datatype that is talking about how to implement an EAV-like model using the new XML datatype in SQL Server 2005 and later. Mladen Prajdić has also referenced to another article explaining EAV in SQL Server more generally.

The second was a newer talking about a solution with Entity Framwork: Generic Entity Attribute Value Model – A POCO Implementation. This is closer to what I had in my mind because it's talking about EAV in general and how to implement our data layer, built on EAV pattern, using EF.

And finally the third was an open source project on CodePlex but unfortunately it seems that it's no longer active and there isn't even a public release out.

My conclusion is, the .NET community hasn't done much efforts on EAV concept and in my opinion it is because Microsoft policy - since creation of .NET Framework - has been just to spread this technology and best practices have rarely gone further on advanced and enterprise topics.

Tagged as: , 5 Comments
   
1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213| viagra sale in india in chemists sustituto de viagra pay with paypal for viagara viagra te koop in nederland levitra india generic average age for viagra viagra stories little blue pill yahoo the best viagra with no prescription vaginal viagra suppositories side effects ordering viagra online xxx pill viagra for man order viagra viagra online viagra from canada generic viagra shipped to the usa overnight infinimax viagra buy viagra without a prescription viagra with dapoxetine overnight deliveryAccutane Online Doxycycline online Buy Cheap Lexapro Online No Prescription Prednisone Online Buy Accutane No Prescription