Thursday, February 19, 2004

Re: Code Review

please confirm what i understood. as many classes in one package get converted to one exe/dll file. also the size of these exe's/dll's must be very small comparatively. say a few 5-10kb for small apps plus some extra 10+ kb for the metadata.

Yes... many classes can be compiled down to one exe/dll. The key word is "can". You can compile each class to it's own dll if you want to and then reference those dll's in an exe.

I'm not sure about the size of the exes/dlls. For my CDPlayer app, which had 9 source code files, several images and a resource file, the exe came out to 144 kb. I'm not sure how the assembly stores the metadata exactly, but you can view it using the il disassembling tool (ildasm). But the metadata shouldn't take up too much space... I wouldn't think.

mohn told me that code on one (earlier) .net version could not be run on the newer version because of configuration file stuff. could you (mohn) explain more on this. also in .net, are certain parts of the api removed for next versions, or carried about like in java.

When you create an application with one version of the framework, your app will only run if that ver of the framework is installed. That info is contained in the exe/dll metadata. So again, taking my CDPlayer app as an ex. I created it using v 1.0. You (Rahul) have v 1.1 on your machine. So if you download my .exe and try to run it, you will get a message saying that the correct ver of the framework is not available.

Now, this is NOT to say you cannot run it on other framework versions. All I have to do is create a config file and give that to you along with the exe. When you run the exe, the CLR will look at the config file (this is done automatically), which will say that my app is compatible with v 1.1 and it will execute.

So this gives you the flexibility to limit your apps to certain versions if you want to. Only two versions of the framework have been released so far v1 and v1.1. And as far as I know there aren't any breaking changes. But in the future, if something does change, you can ensure that your app requires a certain ver of the framework to execute through config files.

No comments: