C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

what is Sattilite Assembly. explain clearly.


Posted Date: 09 Jul 2008      Posted By: samul      Member Level: Gold     Points: 1   Responses: 5



what is Sattilite Assembly. explain clearly.




Responses

Author: SSN    09 Jul 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 6

What is satellite Assemblies?

A definition from MSDN says something like this: "A .NET Framework assembly containing resources specific to a given language. Using satellite assemblies, you can place the resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user elects to view the application in that language."

This means that you develop your application in a default language and add flexibility to react with change in the locale. Say, for example, you developed your application in an en-US locale. Now, your application has multilingual support. When you deploy your code in, say, India, you want to show labels, messages shown in the national language which is other than English.

Satellite assemblies give this flexibility. You create any simple text file with translated strings, create resources, and put them into the bin\debug folder. That's it. The next time, your code will read the CurrentCulture property of the current thread and accordingly load the appropriate resource.

This is called the hub and spoke model. It requires that you place resources in specific locations so that they can be located and used easily. If you do not compile and name resources as expected, or if you do not place them in the correct locations, the common language runtime will not be able to locate them. As a result, the runtime uses the default resource set.

How do creating a Satellite Assembly ?

1.Create a folder with a specific culture name (for example, en-US) in the application's bin\debug folder.

2.Create a .resx file in that folder. Place all translated strings into it.

3.Create a .resources file by using the following command from the .NET command prompt. (localizationsample is the name of the application namespace. If your application uses a nested namespace structure like MyApp.YourApp.MyName.YourName as the type of namespace, just use the uppermost namespace for creating resources files—MyApp.)

resgen Strings.en-US.resx LocalizationSample.
Strings.en-US.resources
al /embed:LocalizationSample.Strings.en-US.resources
/out:LocalizationSample.resources.dll /c:en-US
The above step will create two files, LocalizationSample.Strings.en-US.resources and LocalizationSample.resources.dll. Here, LocalizationSample is the name space of the application.

4.In the code, find the user's language; for example, en-US. This is culture specific.

5.Give the assembly name as the name of .resx file. In this case, it is Strings


For more informations go through the links:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcreatingsatelliteassemblies.asp
http://www.ondotnet.com/pub/a/dotnet/2002/10/14/local2.htm



Author: chandramohan    09 Jul 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 1

When you wish to localize the application (make the application customizable for different languages and cultures), it can be written in culture-neutral code (code that uses resources from an assembly rather than hard-coding the resources in the program) and distribute the localized modules in separate assemblies called satellite assemblies.

To create the satellite assemblies, you will use the al.exe utility (Assembly Linker) to link your resource file to an assembly, as shown in this example:

al /t:library /embed:strings.en.resources /culture:en /out:MyApp.resources.dll

The /t option will direct al to build a library,
and the /embed option identifies the file to be linked.

----------------

When you make external sets of resources for your application to use (that is, resources that are not a part of your main assembly), these are referred to as 'satellite assemblies'. They are also compiled, and they have their own assembly. If you ever need to change information in a satellite assembly, you can do so without having to change the information in your main assembly, which saves time for you and your users. Satellite assemblies can consist of resources only, therefore they have no code. Satellite assemblies will be compiled as dll's and will be referenced by your main assembly, although this is done for you by the ResourceManager: you do not need any specific code to tell your program how to reference the satellite assemblies.


--------------
When you make external sets of resources for your application to use (that is, resources that are not a part of your main assembly), these are referred to as 'satellite assemblies'. They are also compiled, and they have their own assembly. If you ever need to change information in a satellite assembly, you can do so without having to change the information in your main assembly, which saves time for you and your users. Satellite assemblies can consist of resources only, therefore they have no code. Satellite assemblies will be compiled as dll's and will be referenced by your main assembly, although this is done for you by the ResourceManager: you do not need any specific code to tell your program how to reference the satellite assemblies.


-------------

What is satellite Assemblies?

A definition from MSDN says something like this: "A .NET Framework assembly containing resources specific to a given language. Using satellite assemblies, you can place the resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user elects to view the application in that language."

This means that you develop your application in a default language and add flexibility to react with change in the locale. Say, for example, you developed your application in an en-US locale. Now, your application has multilingual support. When you deploy your code in, say, India, you want to show labels, messages shown in the national language which is other than English.

Satellite assemblies give this flexibility. You create any simple text file with translated strings, create resources, and put them into the bin\debug folder. That's it. The next time, your code will read the CurrentCulture property of the current thread and accordingly load the appropriate resource.

This is called the hub and spoke model. It requires that you place resources in specific locations so that they can be located and used easily. If you do not compile and name resources as expected, or if you do not place them in the correct locations, the common language runtime will not be able to locate them. As a result, the runtime uses the default resource set.

How do creating a Satellite Assembly ?

1.Create a folder with a specific culture name (for example, en-US) in the application's bin\debug folder.

2.Create a .resx file in that folder. Place all translated strings into it.

3.Create a .resources file by using the following command from the .NET command prompt. (localizationsample is the name of the application namespace. If your application uses a nested namespace structure like MyApp.YourApp.MyName.YourName as the type of namespace, just use the uppermost namespace for creating resources filesbMyApp.)

resgen Strings.en-US.resx LocalizationSample.
Strings.en-US.resources
al /embed:LocalizationSample.Strings.en-US.resources
/out:LocalizationSample.resources.dll /c:en-US
The above step will create two files, LocalizationSample.Strings.en-US.resources and LocalizationSample.resources.dll. Here, LocalizationSample is the name space of the application.

4.In the code, find the user's language; for example, en-US. This is culture specific.

5.Give the assembly name as the name of .resx file. In this case, it is Strings.

-------------------------

using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyVersion("1.0.1.0")]

public class TestClass
{
public static decimal SquareNumber(decimal baseNumber)
{
return CalculatePower(baseNumber, 2);
}

private static decimal CalculatePower(decimal baseNumber, int exponent)
{
decimal returnValue = 1;

for (int i = 0; i < exponent; i++)
returnValue *= baseNumber;

return returnValue;
}
}
its gives the specific

-----------



Author: Kumar Velu    09 Jul 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 6

A definition from MSDN says something like this: "A .NET Framework assembly containing resources specific to a given language. Using satellite assemblies, you can place the resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user elects to view the application in that language."

This means that you develop your application in a default language and add flexibility to react with change in the locale. Say, for example, you developed your application in an en-US locale. Now, your application has multilingual support. When you deploy your code in, say, India, you want to show labels, messages shown in the national language which is other than English.

Satellite assemblies give this flexibility. You create any simple text file with translated strings, create resources, and put them into the bin\debug folder. That's it. The next time, your code will read the CurrentCulture property of the current thread and accordingly load the appropriate resource.



Author: Sridhar R    15 Jul 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 1

A Satellite assembly contains the compiled resources like TEXT, Images etc.

These resources can be normally be Language specific TEXT and other types of resources.

A .NET assembly uses this assembly to read the language specif resources at runtime by JUST changing the CULTURE of the runnung thread.

So using the Sattellite assemblies CODE and the resources can be managed in two different assebblies.

Regards
Sridhar R
Nothing is illegal, Until You Get Caught
With Tears...Sridhar R



Author: Ashok    15 Jul 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 1

Satellite assemblies are assembly files (.dll) that contain localized resources for an application. Each satellite assembly file contains the resources for one culture. An application can have many satellite assemblies, depending on how many cultures the application supports.

Web application projects use satellite assemblies to store the translated strings, graphics, and other culture-dependent aspects of an application’s user interface. To create the assemblies themselves, you use the Resource Manager. At run time, the Web application loads the translated strings into the Web form based on the current thread’s CurrentUICulture property

Please rate this post, if it is useful for you.

Thanks & Regards
Ashok



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : How to read the contents of .ldf file
Previous : what is the difference between Delete and Truncate. explain with an example.
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use