I do not think it is right, now that a product may have multiple categories.
At some point the attribute set is the category. So I think it will be better to just add a category to the attribute set and add this link to the TemplateCategoryAll union.
product_attribute provides a set of attributes per template and attributes are
introduced in the variant. It is very common for companies to have something similar
to this but with categories <-> templates instead of templates <-> product.
Typical examples include most online shops, such as sales of domestic appliances,
computers, etc. With categories like "TV", "Console", "Fridges", etc. All those will
need to share the same attribute set (Inches, SmartTV (yes/no), ...) while being
different templates (different name, prices, suppliers, ...).