Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Virtuemart do EAV without using EAV?

I understand the three basic failures in EAV, namely that it takes a lot of work to reassemble the data. However, I want a database where I can add custom fields. A lot of people say that Virtuemart allows custom fields but without using an EAV database structure. Can someone explain how this can be done or provide links?

like image 289
Zachary Scott Avatar asked Jan 23 '23 19:01

Zachary Scott


1 Answers

I believe they store custom fields in a chunk of XML or YAML or other domain-specific language.

Basically, they use Martin Fowler's Serialized LOB pattern.

This makes it hard to use SQL expressions to query the custom attributes. You have to fetch the whole row back into your application and parse out the custom attributes. But this is no worse than the pain caused by EAV.

See http://web.archive.org/web/20110709125812/http://sankuru.biz/en/blog/8-joomla-configuration-issues/35-the-cck-buzz-content-creation-kit-and-the-eav-problem.html

Virtuemart and CCK

Virtuemart (VM) custom user fields are CCK-style, but do not rely on EAV. Therefore, they are very usable, and useful. I do recommend their use.

VM product types are also CCK-style, but unfortunately do rely on EAV. Therefore, I avoid VM product types like the plague. Instead, I just manually create additional fields in the product record.

The VM attribute system (simple, custom, advanced) is actually too underpowered to be considered CCK grade.

A good improvement to VM, would consist in rephrasing the VM product types and attributes to non-EAV CCK-style custom fields (and therefore make them work more like the VM custom user fields).

like image 103
Bill Karwin Avatar answered Feb 01 '23 16:02

Bill Karwin