Saturday, February 26, 2011

CTS Spec


Types expose functionality to your applications and other types. Types are the mechanism by which code written in one programming language can talk to code written in a different programming language.

Because types are at the root of the CLR, Microsoft created a formal specification—the Common Type System (CTS)—that describes how types are defined and how they behave.

The CTS specification states that a type can contain zero or more members.
  • Field A data variable that is part of the object’s state. Fields are identified by their name and type.
  • Method A function that performs an operation on the object, often changing the object’s state. Methods have a name, a signature, and modifiers. The signature specifies the number of parameters (and their sequence), the types of the parameters, whether a value is returned by the method, and if so, the type of the value returned by the method.
  • Property To the caller, this member looks like a field. But to the type implementer, it looks like a method (or two). Properties allow an implementer to validate input parameters and object state before accessing the value and/or calculating a value only when necessary. They also allow a user of the type to have simplified syntax. Finally, properties allow you to create read-only or write-only “fields."
  • Event An event allows a notification mechanism between an object and other interested objects. For example, a button could offer an event that notifies other objects when the button is clicked.

Sunday, February 20, 2011

Publisher Policy


In general, the publisher of an assembly simply sent a new version of the assembly to the administrator, who installed the assembly and manually edited the application’s or machine’s XML configuration files. In general, when a publisher fixes a bug in an assembly, the publisher would like an easy way to package and distribute the new assembly to all of the users. But the publisher also needs a way to tell each user’s CLR to use the new assembly version instead of the old assembly version. Sure, each user could modify his or her application’s or machine’s XML configuration file, but this is terribly inconvenient and error prone. What the publisher needs is a way to create policy information that is installed on the user’s computer when the new assembly is installed.

A publisher policy assembly is a way for a publisher to make a statement about the compatibility of different versions of an assembly. If a new version of an assembly isn't intended to be compatible with an earlier version, the publisher shouldn't create a publisher policy assembly. In general, use a publisher policy assembly when you build a new version of your assembly that fixes a bug. You should test the new version of the assembly for backward compatibility. On the other hand, if you’re adding new features to your assembly, you should consider the assembly to have no relationship to a previous version, and you shouldn't ship a publisher policy assembly. In addition, there’s no need to do any backward compatibility testing with such an assembly.

Sunday, February 13, 2011

.NET Culture


Like version numbers, assemblies also have a culture as part of their identity. Cultures are identified via a string that contains a primary and a secondary tag. As the samples, German's
Primary Tag-de and CH as Secondary Tag; for British English itz en GB

In general, if you create an assembly that contains code, you don’t assign a culture to it. This is because code doesn’t usually have any culture-specific assumptions built into it. An assembly that isn’t assigned a culture is referred to as being culture neutral.

Now you can create one or more separate assemblies that contain only culture-specific resources—no code at all. Assemblies that are marked with a culture are called satellite assemblies. For these satellite assemblies, assign a culture that accurately reflects the culture of the resources placed in the assembly. You should create one satellite assembly for each culture you intend to support.

You’ll usually use the AL.exe tool to build a satellite assembly. You won’t use a compiler because the satellite assembly should have no code contained within it. When using AL.exe, you specify the desired culture by using the /c[ulture]:text switch, where text is a string such as “en-US,” representing U.S. English. When you deploy a satellite assembly, you should place it in a subdirectory whose name matches the culture text.

If you prefer, you can specify the culture by using the System.Reflection. AssemblyCultureAttribute custom attribute instead of using AL.exe’s /culture switch as
[assembly:AssemblyCulture("en-US")]

Sunday, February 6, 2011

Salute to Master


CSIR (Council of Scientific and Industrial Research) honoured me by inviting to share the recent technology in IT industry. Itz 2 days South India conference. On Thursday (3rd Feb), I shared the latest technology in Microsoft platform.

Though I used to take sessions to college student community frequently, this is the first time in my life to run an official conference. To be frank, itz kind of bit nervous during the inaugural function. They had 2 industry speakers per day. During the inaugural process, I was one of the celebrity for the lighting (kuthu vilaku) event. After the official introduction, the huge conference stage was only to me. My agenda was to share overview at 11-12:30, 3-4 deep dive and 5-5:30 hands on demo. In between, the other speaker covered.

On attending some interactive, impressive, inspiring sessions in my career, I thought of following the same methodology. Took the packet collar mike, walked inside the crowd, asked few interactive questions, shared reward(jst choc) to them. Sessions reached quite well. My prof Ms TamilSelvi was part of the crowd and enjoyed the transition in her product on last 20 years.

Committee shared a wonderful momento with overwhelming positive feedback and standing applause from the audience. When they shared vote of thanks at EOD (End Of the Day), I requested few mins for me. Exact script was as below:

  • Itz immense pleasure for me to get this opportunity. Thanx to everyone in this conf.
  • Exactly 2 decades ago, same person don't know how to speak cont in English, how to draft the presentation, how to connect audience. Today's credit goes to all my mentors especially my first one Prof TamilSelvi
  • Thanx everyone!

On seeing my prof in 3rd row, she is full of tears (with joy). Jst before leaving conf, I told her that we used to feel proud when our IT products are appreciated by end customers. And today itz your turn, Mam. One of the glourious moments in my life. Salute to true masters!

PS: On Feb 1991 (2nd year of UG), I was selected for my first tech presentation (RISC/CISC) in TCE, Madurai. Felt worried and reluctant. My prof coached/groomed for 2 weeks to host on the stage. Now, itz Feb 2011.