Hi Lex,
Which solution did you finally apply to your application & DB Design. I'm currently using the exact same design in my Database (except for some details, e.g. I don't have default description in the non localized table).
I have the following schema:
- TABLE_ITEM (ItemID, ItemCode, TimeStamp)
- TABLE_ITEM_LOCAL (ItemLocalID, ItemID, LanguageID, Label, TimeStamp)
- VIEWLOCAL_ITEM (ItemID, ItemLocalID, LanguageID, ItemCode, Label)
- TABLE_LANGUAGE (LanguageID, LanguageName, CultureCode, ...)
This way, I can query my View to get the Localized item depending on the Language ID. I built the view using Cross Join with the Language table so I always get a record for the asked language, even when no record does exist. Example:
SELECT TOP 100 PERCENT ItemID, ItemCode, LanguageID, ItemLocalID, Label, TABLE_ITEM_LOCAL.[TimeStamp]
FROM dbo.tbl_StatusType CROSS JOIN
TABLE_LANGUAGE LEFT OUTER JOIN
TABLE_ITEM_LOCAL ON ItemID = TABLE_ITEM_LOCAL.ItemID AND
TABLE_LANGUAGE.LanguageID = TABLE_ITEM_LOCAL.LanguageID
ORDER BY ItemID, TABLE_LANGUAGE.LanguageID
There are various problems with such solution:
- I don't have a default language translation (I could use a case with a subselect in my View, but I need to carry for performances as I have large tables with many records). A good solution would be to handle the translation and default language in the DataLayer (or ServiceLayer?)...
- Views do not provide DeepLoading or CRUD capabilities as Tables allow... That's really a pain.
Does anyone have an idea if adding support for such design into the template would be difficult ? if so, how could it be done (from a design perspective...).
Thanks.