国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Heim Datenbank MySQL-Tutorial Architecture FAQ for Localization and Globalization Part 2

Architecture FAQ for Localization and Globalization Part 2

Jun 07, 2016 pm 03:44 PM
faq for

http://www.codeproject.com/Articles/29362/Architecture-FAQ-for-Localization-and-Globalizatio Architecture FAQ for Localization and Globalization Introduction (B) What are satellite assemblies? (A) How do we generate Satellite assemblies? (

http://www.codeproject.com/Articles/29362/Architecture-FAQ-for-Localization-and-Globalizatio

Architecture FAQ for Localization and Globalization


Introduction

(B) What are satellite assemblies?

(A) How do we generate Satellite assemblies?

(A) What is AL.EXE and RESGEN.EXE?

(I) What is the use of resource manager class?

(A) What precautions do we need to take while deploying satellite assemblies?

(A) Can you explain the fundamentals of “GetGlobalResourceObject” and “GetLocalResourceObject” functions?

(A) Can we sign a satellite assembly?

(I) Can you explain collation sequence in sql server?

(A)How do we define collation sequence for database and tables?

(A)Can we change the order in a select query with a specified collation sequence?

(A) Can you list best practices for globalization and localization?

References

Other Interview question PDF's

Introduction

You can see the part 1 of the article at:-?LocalizationGlobalizPart1.aspx???

When we see around, architectures mainly discuss about loose coupling , scalability , performance etc etc. Many architecture forget one of the important aspects in software is making application globalized. Depending on project some application would not really want to have multi-language based websites , but i am sure many will. So in this article we will go through a series of FAQ which will give you a quick start on making application multi-language based.

Lately i have been writing and recording videos heavily on design patterns , UML and many architectural stuff you can visit?http://www.questpond.com?for design pattern and UML videos.

You can read my previous articles on design patterns and UML in the below links:-

Part 1 – Design patterns Factory, Abstract factory, builder, prototype, shallow and deep copy, and singleton and command patterns

SoftArchInter1.aspx??

Part 2 – Design patterns Interpreter, Iterator, Mediator, Memento and observer patterns

SoftArch2.aspx?

Part 3 – Design patterns State, Stratergy, Visitor, Adapter and fly weight pattern

SoftArch3.aspx?

Part 4 Design patterns Bridge, Composite, Decorator, Facade, COR, Proxy and template pattern

SoftArch4.aspx

Loosely coupled architecture using

IOCDI.aspx?

You can download by architecture interview question book from?

http://www.questpond.com/softArchi.zip.zip??

?



(B) What are satellite assemblies?


(A) How do we generate Satellite assemblies?


(A) What is AL.EXE and RESGEN.EXE?


In the previous question, you have seen how we can use resource files to store data according to the localized languages. However, when you actually go for deployment you will not like to also install the “resx” or “txt” files. It is definitely not a good deployment practice to install data, which can be easily modified. In short some how we should install this in a binary format so that no end user can change it. That is why Microsoft introduced satellite assemblies.
Satellite assemblies are assemblies, which do not contain source code. They only contain resource files. You can create a satellite assembly using rsgen.exe and al.exe. They are in binary DLL format, which makes it easier to ship it during deployment. So finally, during deployment you do not need to ship the resx files but only the compiled satellite DLL.
?

Architecture FAQ for Localization and Globalization Part 2

Figure 14.15: - resgen.exe and al.exe in action


The above diagram will give you a complete picture of how to generate Satellite assembly. You can see from the above figure we need two exe resgen.exe and al.exe. Once you made your resx file or text file, you should first convert in to a “.resource” files. This is done by using the resgen.exe. Below is the command snippet for resgen.exe where LoginScreen.aspx.el.resx is the resx file and output is Greek. Resources file. If you do not provide the output file name it will generate “LoginScreen.resources”.

Resgen LoginScreen.aspx.el.resx Greek.Resources

You can also generate resx files from txt file using resgen.exe below is the code snippet for the same:-

Resgen MyLanguage.txt MyLanguage.resx

The above command snippet will generate a MyLanguage.resx using MyLanguag.txt file. You can make a DLL using resource files and not resx so you should make this conversion.
Now once the resource file is generated its time make the compiled assembly of the same so that it can be shipped during deployment. This is accomplished by using the assembly linker tool al.exe provided by Microsoft. Below is the command code snippet for the same.

al.exe /out: el.dll /c: de /embed: greek.resources

In the /out switch you need to provide the output DLL name. /c you need to specify the culture of the resource file. /embed you need to specify all the resources which are present in the resource file. As said previously other than strings you can also put image files like GIF, BMP etc. So those physical resources you can specify in the /embed switch. You can specify more than one resource use “,” as a separator to specify more than one resource files.?
?

(I) What is the use of resource manager class?


Resource Manager Class helps us to read the resource files and get the values using key.?
First, you need to create the object of resource manager. You need to specify the resource name and the assembly in the constructor.

privateResourceManagerobjResourceManager = new ResourceManager("Globalization.resource",System.Reflection.Assembly.GetExecutingAssembly());

Once the resource manager is populated with details, you can then use the Get String function to get by key. For instance in the below code snippet we are using the “cmdAddNew” key to get the value for button “cmdAddNew”.

cmdAddNew.Text = objResourceManager.GetString("cmdAddNew");
?

(A) What precautions do we need to take while deploying satellite assemblies?


When we deploy the assembly, the folder structure has to very organized. Below table shows how the folder structure should be organized. Main Folder is the main application folder. All satellite assemblies should be deployed in the Main application folder with in there own respective folder. The respective folder is denoted by the culture code.
?

Architecture FAQ for Localization and Globalization Part 2

Figure 14.16: - Satellite Assembly folder structure


You can see from the above figure Hindi satellite assembly is deployed in hi folder, Greek satellite assembly is deployed in el folder and so on. If the program does not find resource file for a culture it uses the invariant culture satellite assembly. The above folder structure is a strict requirement when we deploy the satellite assembly. Any mismatch in the folder structure will lead to in appropriate results.
?

(A) Can we get a strongly typed resource class rather than using resource manager?


In the previous question, we had seen how resource manager class could be used to read the string from the resource file. However, there has been considerable improvement in VS.Net 2005 for resource support. You no more need to load using resource manager class. However, Microsoft has still kept it for backward compatibility. You can now get strongly types classes in your VS.NET intelligence as shown in the figure below.
?

Architecture FAQ for Localization and Globalization Part 2

Figure 14.17: - Strongly typed resource class


All belong to Resources namespace. Let us do a small sample and see how the strongly typed classes work in VS.NET 2005 and the simplicity, which they bring while implementing globalization in projects. Below is the screen shot of the project? It is a simple login screen with user id and password text boxes. User has options to select the language. Currently only two languages are provided English and Greek. Depending on the languages selected, the user id and password label values will be displayed.?
?

Architecture FAQ for Localization and Globalization Part 2

Figure 14.18: - Strongly typed project


Note: - In the globalization project you can get the project sample in “LoginScreenUsingStrongType.aspx”.


Below is the code snippet, which describes the various important divs of the code. First thing are the resource files. We have generated two resource files one for Greece with el and second is the general resource file which will be used when the regional code does not match.?
?

Architecture FAQ for Localization and Globalization Part 2

Figure 14.19: - Walkthrough for using the resources namespace


There are three important steps in the code:-

? First is set the culture information for the current thread with the new culture info object. Structure has the language code, which is currently selected in the drop down.
Thread.CurrentThread.CurrentCulture = new CultureInfo (structure);

? We set the same culture to the Resource class.
Resources.Resource.Culture = Thread.CurrentThread.CurrentCulture;

? Now we are all set to use the value.
lblUserId.Text = Resources.Resource.lblUserIdResource1.ToString ();

blPassword.Text = Resources.Resource.lblPasswordResource1.ToString ();

Note: - You can get the same from globalization folder in “LoginScreenUsingStrongType.aspx”. Try to add a new language and most of the fundamentals will be clear.


(A) Can you explain the fundamentals of “GetGlobalResourceObject” and “GetLocalResourceObject” functions?


These two functions belong to the Http Context object. Using it you can get the object reference of the resource object. For instance you can see from the below code snippet we have reference to the Global resource object and we are trying to get the value for “l(fā)blUserIdresource1” key.

lblUserId.Text=HttpContext.GetGlobalResourceObject("Resource", "lblUserIdResource1").To String();
Note :- In the same globalization folder there is “LoginScreenUsingGetGlobal.aspx” which demonstrates how “GetGlobalResource” works.


One short note because “GetGlobalResourceObject” and “GetLocalResourceObject” operate from with in current HttpContext.It uses what the regional settings are sent from the browser end.
?

(A) Can we sign a satellite assembly?


Yes you can sign the satellite assembly using the /key file switch which takes “.snk” file as the input parameter.

al /res:MyLanguage.resources /c:de /keyfile:MyLang.snk out:MyLanguages.resources.dll
?

(I) Can you explain collation sequence in sql server?


First, let us define collation.
Collation sequences are set of rules, which determine how the data is sorted and compared. Sorting rules can be defined with options with case-sensitivity, accent marks, kana character types, and character width.

Case sensitivity

If A and a, B and b, etc. are treated in the same way then it is case-insensitive. A computer treats A and a differently because it uses ASCII code to differentiate the input. The ASCII value of A is 65, while a is 97. The ASCII value of B is 66 and b is 98.

Accent sensitivity

If a and á, o and ó are treated in the same way, then it is accent-insensitive. A computer treats a and á differently because it uses ASCII code for differentiating the input. The ASCII value of a is 97 and áis 225. The ASCII value of o is 111 and ó is 243.
Kana Sensitivity
When Japanese kana characters Hiragana and Katakana are treated differently, it is called Kana sensitive.?

Width sensitivity

When a single-byte character (half-width) and the same character when represented as a double-byte character (full-width) are treated differently then it is width sensitive.
?

(A)How do we define collation sequence for database and tables?


You can create a database with language specific collation sequence. For instance in the below create statement tblCustomer is created by Latin language collation sequence.?

Create database tblCustomer collate Latin1_General_BIN

You can also create tables with particular collation sequence. Below is the create table syntax for the same.

Create table tblCustomer?
(
[CustomerCode] char(10) COLLATE Albanian_CI_AI_KS_WS NULL,
[EntryDate] [char] (8) COLLATE Korean_Wansung_Unicode_CS_AS_KS NOT NULL ,
[CustAbbrev] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL?
)


(A)Can we change the order in a select query with a specified collation sequence?


Yes we can specify a collate sequence in the order by clause. That will change the sort according to the collation defined in the order by claused.


ORDER BY?
{
order_by_expression?
[ COLLATE collation_name ]?
[ ASC | DESC ]?
} [ ,...n ] ]


(A) Can you list best practices for globalization and localization?


Below are the best practices while developing international language support software:-
? Do not hardcode strings or user interface resources.
? Make sure your application depends on Unicode.
? Whenever you read or write data from various encoding make, sure you use the System. Text namespace. Many programmers assume ASCII data.
? While testing test it with actual international data and environments.
? Whenever we manipulate data, for instance numbers, dates or currency make sure that you are using culture-aware classes defined in System. Globalization namespace. Below is the table, which specifies in more detail about the functionality and the classes to be used to achieve the same.
?

Architecture FAQ for Localization and Globalization Part 2

Figure 14.20: - Functionality and classes used


? ????If a security decision is based on the result of a string comparison or case change operation, perform a culture-insensitive operation by explicitly specifying the CultureInfo.InvariantCulture property. This practice ensures that the result is not affected by the value of CultureInfo.CurrentCulture.?
? Move all your localizable resources to separate DLL’s.
? Avoid using images and icons that contain text in your application. They are expensive to localize.
? Allow plenty of room for the length of strings to expand in the user interface. In some languages, phrases can require 50-75 percent more space.
? Use the System.Resources.ResourceManager class to retrieve resources based on culture.
? Explicitly set the CurrentUICulture and Current Culture properties in your application. Do not rely on defaults.
? Be aware that you can specify the following three types of encodings in ASP.NET:?
? Request Encoding specifies the encoding received from the client's browser.
? Response Encoding specifies the encoding to send to the client browser. In most situations, this should be the same as request Encoding.
? File Encoding specifies the default encoding for .aspx, .asmx, and .asax file parsing.
?

(A) Why is the culture set to the current thread?


First, let me explain this question. If you look at the code snippet of how to set the culture info.

Thread.CurrentThread.CurrentCulture = new CultureInfo(strCulture);
It uses the current thread to set it. What does that mean? Let us drill down a bit, of how IIS handles request to understand this concept. When any user requests a resource from IIS like an ASPX page or any other resource. IIS services that request in his own thread. That means if 100 users have requested some resource from IIS he will serve every request in its own thread. In short, IIS will spawn 100 threads to service the 100 request. It is very much practically possible that you can have different locale in different threads. Therefore, when we set a culture we cannotset it for the whole application, as it will affect all the requests. So when we set a culture we set it to a particular thread rather to the whole application.


About the Author

Shivprasad?koirala


Erkl?rung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Hei?e KI -Werkzeuge

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Clothoff.io

Clothoff.io

KI-Kleiderentferner

Video Face Swap

Video Face Swap

Tauschen Sie Gesichter in jedem Video mühelos mit unserem v?llig kostenlosen KI-Gesichtstausch-Tool aus!

Hei?e Werkzeuge

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version

SublimeText3 chinesische Version

Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1

Senden Sie Studio 13.0.1

Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

SublimeText3 Mac-Version

SublimeText3 Mac-Version

Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Hei?e Themen

PHP-Tutorial
1502
276
17 M?glichkeiten, den Bluescreen ?kernel_security_check_failure' zu beheben 17 M?glichkeiten, den Bluescreen ?kernel_security_check_failure' zu beheben Feb 12, 2024 pm 08:51 PM

Kernelsecuritycheckfailure (Kernel-Check-Fehler) ist eine relativ h?ufige Art von Stoppcode. Unabh?ngig vom Grund führt der Bluescreen-Fehler jedoch dazu, dass viele Benutzer diese Seite sorgf?ltig vorstellen. 17 L?sungen für den Bluescreen ?kernel_security_check_failure“ Methode 1: Entfernen Sie alle externen Ger?te Wenn ein externes Ger?t, das Sie verwenden, nicht mit Ihrer Windows-Version kompatibel ist, kann der Bluescreen-Fehler ?Kernelsecuritycheckfailure“ auftreten. Dazu müssen Sie alle externen Ger?te trennen, bevor Sie versuchen, Ihren Computer neu zu starten.

Wie deinstalliere ich Skype for Business unter Win10? So deinstallieren Sie Skype vollst?ndig auf Ihrem Computer Wie deinstalliere ich Skype for Business unter Win10? So deinstallieren Sie Skype vollst?ndig auf Ihrem Computer Feb 13, 2024 pm 12:30 PM

Kann Win10 Skype deinstalliert werden? Diese Frage m?chten viele Benutzer wissen, da viele Benutzer feststellen, dass diese Anwendung im Standardprogramm auf ihren Computern enthalten ist, und sie befürchten, dass das L?schen den Betrieb des Systems beeintr?chtigt Diese Website hilft Benutzern. Schauen wir uns genauer an, wie Skype for Business unter Win10 deinstalliert wird. So deinstallieren Sie Skype for Business unter Win10 1. Klicken Sie auf dem Computerdesktop auf das Windows-Symbol und dann zum Aufrufen auf das Einstellungssymbol. 2. Klicken Sie auf ?übernehmen“. 3. Geben Sie ?Skype“ in das Suchfeld ein und klicken Sie, um das gefundene Ergebnis auszuw?hlen. 4. Klicken Sie auf ?Deinstallieren“. 5

Wie man for verwendet, um die Fakult?t von n in JavaScript zu finden Wie man for verwendet, um die Fakult?t von n in JavaScript zu finden Dec 08, 2021 pm 06:04 PM

So verwenden Sie for, um n Fakult?ten zu finden: 1. Verwenden Sie die Anweisung ?for (var i=1;i<=n;i++){}“, um den Schleifendurchlaufbereich auf ?1~n“ zu steuern. 2. In der Schleife K?rper, verwenden Sie ?cj *=i“. Multiplizieren Sie die Zahlen von 1 bis n und weisen Sie das Produkt der Variablen cj 3 zu. Nach dem Ende der Schleife ist der Wert der Variablen cj die Fakult?t von n und wird dann ausgegeben.

Was ist der Unterschied zwischen foreach und for-Schleife? Was ist der Unterschied zwischen foreach und for-Schleife? Jan 05, 2023 pm 04:26 PM

Unterschiede: 1. for durchl?uft jedes Datenelement über den Index, w?hrend forEach die Datenelemente des Arrays über das zugrunde liegende JS-Programm durchl?uft. 2. for kann die Ausführung der Schleife über das Schlüsselwort break beenden, forEach jedoch nicht . for kann die Ausführung der Schleife steuern, indem es den Wert der Schleifenvariablen steuert, forEach jedoch nicht. 4. for kann Schleifenvariablen au?erhalb der Schleife aufrufen, forEach kann jedoch keine Schleifenvariablen au?erhalb der Schleife aufrufen ist h?her als forEach.

Wie vermeide ich Ausnahmen in einfachen for-Schleifen in JAVA? Wie vermeide ich Ausnahmen in einfachen for-Schleifen in JAVA? Apr 26, 2023 pm 12:58 PM

Einleitung Bei der tats?chlichen Gesch?ftsprojektentwicklung sollte jeder mit dem Vorgang des Entfernens von Elementen, die die Bedingungen nicht erfüllen, aus einer bestimmten Liste vertraut sein, oder? Vielen Schülern fallen sofort viele Wege ein, um dies zu erreichen, aber sind alle Wege, die Ihnen einfallen, für Mensch und Tier harmlos? Viele scheinbar normale Vorg?nge sind in Wirklichkeit Fallen, und viele Anf?nger k?nnten in sie tappen, wenn sie nicht vorsichtig sind. Wenn beim Ausführen des Codes leider eine Ausnahme ausgel?st und ein Fehler gemeldet wird, ist dies ein Segen. Zumindest kann der Code rechtzeitig erkannt und gel?st werden, ohne dass ein Fehler gemeldet wird, aber in der Gesch?ftslogik treten verschiedene seltsame Probleme auf Das ist noch tragischer, denn wenn man diesem Problem keine Beachtung schenkt, kann es zu versteckten Gefahren für das sp?tere Gesch?ft kommen. Was sind also die Implementierungsmethoden? Welche Implementierungen k?nnten

Was sind die g?ngigen Flusskontrollstrukturen in Python? Was sind die g?ngigen Flusskontrollstrukturen in Python? Jan 20, 2024 am 08:17 AM

Was sind die g?ngigen Flusskontrollstrukturen in Python? In Python ist die Flusskontrollstruktur ein wichtiges Werkzeug zur Bestimmung der Ausführungsreihenfolge des Programms. Sie erm?glichen es uns, verschiedene Codebl?cke basierend auf unterschiedlichen Bedingungen auszuführen oder einen Codeblock wiederholt auszuführen. Im Folgenden werden g?ngige Prozesssteuerungsstrukturen in Python vorgestellt und entsprechende Codebeispiele bereitgestellt. Bedingte Anweisungen (if-else): Bedingte Anweisungen erm?glichen es uns, verschiedene Codebl?cke basierend auf unterschiedlichen Bedingungen auszuführen. Die grundlegende Syntax lautet: if Bedingung 1: #when Bedingung

6 Beispiele, 8 Codeausschnitte, ausführliche Erkl?rung der For-Schleife in Python 6 Beispiele, 8 Codeausschnitte, ausführliche Erkl?rung der For-Schleife in Python Apr 11, 2023 pm 07:43 PM

Python unterstützt For-Schleifen und seine Syntax unterscheidet sich geringfügig von anderen Sprachen (wie JavaScript oder Java). Der folgende Codeblock zeigt, wie Sie eine for-Schleife in Python verwenden, um die Elemente in einer Liste zu durchlaufen: Der obige Codeausschnitt gibt drei Buchstaben in separaten Zeilen aus. Sie k?nnen die Ausgabe auf dieselbe Zeile beschr?nken, indem Sie nach der Druckanweisung ein Komma ?“ hinzufügen (wenn viele zu druckende Zeichen angegeben sind, wird sie ?zeilenumbrochen“). Der Code lautet wie folgt: Wenn Sie m?chten Anzeige in einer Zeile statt in mehreren Zeilen. Für Textinhalte k?nnen Sie die obige Codeform verwenden. Python bietet auch integrierte Funktionen

Wie man mit PHP FAQ- und Message-Board-Module im CMS entwickelt Wie man mit PHP FAQ- und Message-Board-Module im CMS entwickelt Jun 21, 2023 am 11:10 AM

Mit der schrittweisen Entwicklung von Websites haben immer mehr Unternehmen und Organisationen begonnen, Websites als wichtiges Mittel zur F?rderung und Bereitstellung von Dienstleistungen zu nutzen. Auf Websites sind auch Module wie FAQ (h?ufig gestellte Fragen) und Message Boards zu unverzichtbaren Modulen für den Alltag geworden Operationen. In diesem Artikel wird erl?utert, wie Sie mit PHP FAQ- und Message-Board-Module im CMS entwickeln. 1. Datenbankdesign des FAQ-Moduls Das FAQ-Modul ist haupts?chlich in zwei Teile unterteilt: Fragenliste und Antwortliste. In der Datenbank müssen wir Fragetabellen bzw. Antworttabellen sowie Zuordnungstabellen zwischen Fragen und Antworten erstellen. Struktur der Fragentabelle

See all articles