Posts

Showing posts from May, 2016

Code Contracts in C#

Code contracts introduced in .NET Framework 4.0 is a useful but underutilized feature. It enables a developer to publish various conditions that are necessary within an application. There is a   concept called  Design by contract  where you can  define pre-conditions, post-conditions, and invariants on class methods. The basic idea was for a method to define a contract which states conditions that must be true  when the method gets called . This is also called as preconditions. The method must also define conditions that must be true  when it finishes execution . This is called as postconditions. The method can also define conditions that should remain true  while the program is running . This is called as invariants. .NET 4.5 introduces a new feature in Code Contracts called as abbreviations. Abbreviations are useful in scenarios where some contracts are required repeatedly. So if a method contains multiple contracts, just decorate that method with the  ContractAbbreviator  attri

Types of s/w licenses

Hi Guys, When we work with any application(s), it  may have license, sometimes tools are of freeware with no license. To my knowledge, here are few types of license that are common. 1. Concurrent Licenses - Licenses that can be installed on any number of machines but can be used on a limited number of machines at any given point 2. Developer License -  Software that needs to be licensed by developer and the redistributable components can be deployed to any number of client/servers. 3. Evaluation - Trial license which may come with limited functionality or for a definite period of time 4. Free License - License that is available for free. 5. GNU License – General Public License is a free software license ensuring that the rights are preserved even when the software is copylefted. 6. OEM (Original Equipment Manufacturers) - Software license that accompanies hardware 7. Site License -  Software that is licensed to a site.  The definition of the site can vary by vendor – physical

Web applications Vs Web sites

When to use Web applications and Web sites. Courtesy: MSDN Scenarios in which Web application projects are the preferred choice include the following: You want to be able to use the  Edit and Continue  feature of the Visual Studio debugger. You want to run unit tests on code that is in the class files that are associated with ASP.NET pages. You want to refer to the classes that are associated with pages and user controls from standalone classes. You want to establish project dependencies between multiple Web projects. You want the compiler to create a single assembly for the entire site. You want control over the assembly name and version number that is generated for the site. You want to use MSBuild or Team Build to compile the project. For example, you might want to add pre-build and post-build steps. You want to avoid putting source code on a production server. You want to use the automated deployment tools that are available in Visual Studio 2010.