I have some database entities
And URLs are supposed to be the following:
site.com/category-name
site.com/category-name/product-name
where category-name and product-name are slugifyed category.name and product.name respectively. The question is what is the best design
pattern: add one more field slugifiedName to the database entities Category and Product (and to the database)? Or to generate slugified names on fly? First variant is easy but seems to be not beautiful.
It seems to be better not to store duplicated names in the database. But then when should I generate them?