Localization, the XML column way

Localization, the XML column way

Old forum URL: forums.lhotka.net/forums/t/5219.aspx


COBRASoft posted on Saturday, August 09, 2008

Hi all,

I'm seriously considering a complete rewrite of my ERP application using CSLA.Net, DevForce or even XPO/XAF. My biggest problem with all these frameworks is localization of the data and out-of-the-box UI databinding support for ALL DevExpress components.

Until now, I've always used a seperate table for each table needing localized descriptions. E.g. a table 'Article' and a table 'ArticleLanguage'. This required join between those tables every time and most frameworks don't provide this list behaviour as a standard functionality. Even worse, if I want to print an invoice in another language than the logged in user, the problem gets even worse.

After a lot of research, I found this website: http://www.dnknormark.net/?tag=/globalization. This is an awesome solution for my problem. No more joins, no more extra table. The only problem I have with this is, what framework supports XML fields and is able to search/filter on them? Can CSLA.Net handle this? Is there an EASY way to solve this problem forever?

Greetings,
Sigurd

rsbaker0 replied on Saturday, August 09, 2008

I've been working on a CSLA port of a legacy C++ application for a while now, and we're using DevExpress components. The binding seems to work fairly well.

Unlike some other frameworks, CLSA poses no specific requirements on how you fetch your data and is quite amenable to both client and server side caching (but again this is up to you). I'd think if you wanted to store your localized names in a dictionary per the URL above that CSLA would make this quite easy for you.

The standard object fetch in CSLA includes the concept of a user-definable "criteria" class, so you could even include the desired language in your fetch criteria. Your fetch method could then use this to retrieve localized names from your dictionary.

COBRASoft replied on Monday, August 11, 2008

Hi,

Thank you for your answer. I will look further into this.

Greetings,

Sigurd

mcsean replied on Thursday, August 14, 2008

Oh boy!! I have been struggling to find out a better way to save string data with different languages as well, and discovered that MSSQL support the XML column, which is great, I can now save them all in a column, and the helper class can be easily written to handle the data binding. CSLA.net offers great flexibility.

The question I have for now is how do I query to those XML columns in Linq  on top of CSLA framework? and what about the performance hit?

Comments?! or a few lines of sample code please?  

COBRASoft replied on Thursday, August 14, 2008

Hi,

I'm still struggling with CSLA.Net itself, so no way yet for the XML solution, let stand LINQ on top of it.

A possible solution could be to use a nvarchar(MAX) as store XML in there. There are some drawbacks with that though. Cannot be indexed, so full text search won't work.

Another problem with the XML solution is accents like in French. XML stores those in some kind of HEX format and this way it can't be searched directly. A XML translation would be needed...

Please, anybody, if you have a better solution, let us know, I'm sure a lot of people have to deal with this problem.

Greetings,
Sigurd

Copyright (c) Marimer LLC