Search code examples
spree

Spree Why there is a Taxonomy and a Taxon model


I am reading the spree code source and I am wondering why there is a model Taxon and a model Taxonomy.

According to the Spree documentation:

  • Taxonomy – a hierarchical list which is made up of individual Taxons.

  • Taxon – a single child node which exists at a given point within a
    Taxonomy. Each Taxon can contain many (or no) sub / child taxons.

As Taxon can have many taxons and taxons can have children. Why there is a need of the Taxonomy model? Is this due to performance?

(NOTE: I am not sure this is the right place to ask as it's not really code related issue)

Thanks for your explanation


Solution

  • A taxonomy is representative of the root node. It provides the over-arching classification for a set of items. For example, "Clothing" could be a taxonomy (with a root "Clothing" taxon) and then underneath that root there would be other taxons like "Pants", "Shirts", "Shoes" and so on.

    There's no particular reason why we have both taxonomies and taxons other than that's the way it's always been and to change it right now does not leads to any particular benefit.