[TYPO3-ect] taxonomies / categories in TYPO3
Elmar Hinz
elmar07 at googlemail.com
Wed Oct 10 12:41:15 CEST 2007
Mads Brunn wrote:
> Hi Elmar (and others who has an opinion)
>
> A technical question:
>
> I saw that you had asked a question on the dev-list regarding
> "MM-relations with metadata" (the "MM_match_fields" feature in tcemain).
> I have now implemented this feature in EXT:categories so that a common
> MM-table is used for all relations between the category table and other
> tables.
>
> Du you still consider this to be the correct way of doing it (from your
> experience with the CCF) or should I rather go for one MM-table per
> table? I'm a little bit uncertain about the pros and cons using this
> approach and I'm not even sure that the "MM_match_fields" feature was
> meant for this purpose?!
>
> Looking forward to hear your opinion on this.
>
> ./mads
Hi Mads,
that is good news.
If you store all categories into one generic table tx_categories, it would
look like "a break of style", if you take a different approach for the
relations to them. It's rather a feeling of mine, that one table with meta
keys is easier to handle, than multiple tables.
If there is a clean API to the category framework, it's more or less
transparent for the developer, how the data is stored.
"Less" because there will be the moment, when he needs to build joins with
the categories. Even than it doesn't make a big difference if you specify
the relation by an own table name or a meta key.
The other point is the question of management of the tables. A bigger
project has dozends of category relations. The majority of the database
tables would become category relations. That's reallive experience.
If one table has several categories, you need to find, manage and code with
individual tablenames for the different MM relations.
tx_people_categories_language
tx_people_categories_profession
...
tx_book_categories_language
tx_book_categories_genre
...
That makes matters more complex, but would be similar for meta keys.
Having such a garden of category tables makes the overall maintainance of
the database more difficult.
One advantage seems for sure, that you can export one relation by exporting
one table. But that doesen't really work. You will have id conflicts in
tx_categories, when importing into an other database. An export/import
script would be required anyway.
Regards
Elmar
More information about the TYPO3-team-extension-coordination
mailing list