
COM Component on Application Scope
Hi, we're designing a e-commerce site which is supposed to easily support
multiple languages.
To accomplish this an external consultant has created a VB6 COM component,
which is apartment threaded.
The way this currently has been set up is:
* In the Global.asa we create an instance of this object, and we read all
the translations (approx 300 entries) from the DB in memory.
Set LanguageObj = Server.CreateObject("Language.Dictionary")
LanguageObj.getFromDB(myDSN)
Set Application("LT") = LanguageObj
* Then in each file that needs translating (which is most of them), we call
on this Application variable, using an include file containing this function
Function Trans (StringToTranslate, sUserLanguage)
On error resume next
Dim text
text = Application("LT").Lookup(CStr(StringToTranslate),
CStr(sUserLanguage))
Trans = text
End Function
(example) in the welcome page, this would be called like Response.write
Trans("[welcome_text]", "FR").
This works and since it's all stored in-memory, it's very fast.
But I'm a bit concerned about scalability. If the site gets something like
200 concurrent users (which it will), will this approach create a Bottleneck
situation, since all users are in fact using the same object.
This object does run under MTS, but I'm not sure this will make much of a
difference, since there's only one instance of it created in the whole site.
Does anyone have any experience with a similar situation? Any feedback is
appreciated.
Many thanks,
Sam Goutsmit
MCP Visual Interdev