Friday, December 31, 2004

.NET certification : why is it important

With .NET, Microsoft is also espousing a vision, this time about how the Internet can make businesses more efficient and deliver services to consumers. The present enterprise setup's need to have n-tier architecture with diverse platforms and object models communicating with each other. The present applications are to be created such that those applications have to run in any platform (like Windows, Linux, Mac, Unix etc) and which consist of components written in many programming languages and object models.

Many language vendors have tried to upgrade their languages, but there is a limit to which they have been successful since they have to maintain backward capability and face many other problems too. To solve the problem of the current programmers Microsoft has come with a very promising solution "The .NET Platform".

.NET provides a number of benefits that will make developers more productive, reduce the number of bugs, speed application development, and simplify deployment. IT managers are understandably wary, since .NET is a new technology that requires a moderately steep learning curve. For most organizations, however, the benefits will far outweigh the negatives; and with .NET, you'll see great productivity gains for future development projects.

And ofcourse, Once i was reading a book of an author "DAN Appleman" and he states that World is divided into two camps .One who supports Microsoft and others who oppose them. For me Microsoft is not a whale in an ocean but itself is an ocean.
Not only is .NET a Money Making Machine for Microsoft but it also ease developers from facing other problems that i listed above.

.NET certification is the premier credential for professionals who design and develop leading-edge business solutions with Microsoft .NET development tools, technologies and platforms. Earning a Microsoft certification acknowledges your expertise in working with Microsoft products and technologies and sets you apart from the crowd as a development professional. Microsoft certification demonstrates that you have the ability to successfully implement Microsoft business solutions for your organization or client.

With Microsoft targeting all its future applications on .NET and companies adopting the Microsoft new initiative, it is quite obvious that .NET is going to pave its way for the future and will be Microsoft's weapon for its future vision. .NET is a major leap of Microsoft with intranet in mind. Getting knowledge of .NET and eventually the MCSD .NET certification will certainly help you in maintaining consistency with the future releases of Microsoft.


Wednesday, December 29, 2004

Cool Tools for C#

I stumbled upon this link today - which lists a whole boatload of tools that can be used with .NET. Seems like a pretty comprehensive list, and as it's on MSDN it *must* be good.
http://msdn.microsoft.com/vcsharp/team/tools/default.aspx



.NET Framework Security Model

.NET Security model has six major areas

1. Type Safety
2. code signing
3. Cryptographic services
4. Code Access Security
5. Role Base Security

Now let’s analyze each of them one by one

Type Safety
Type Safe Code means that code can only access those memory which it is authorize to access. For e.g. code cannot access private fields of other objects.
It does not mean that code can not call any native code. Code can call the native code if it has permissions which is generally given at a very high level and got Skip Verification Number. This type verification occurs during JIT compilation. Advantage of type safety is that multiple instance of the type safe code can execute in one process.

Code Signing -- Internet seems to be one of the foremost media of communication. As far as user is concerned, User always have a threat of malicious users. By means of code signing, we can ensure the authenticity and integrity of the code prior to downloading and running that code. Code signing works on Strong names


Data Signing and Encryption – Rather than sending the data in the Plain text, Now a days a data is been encrypted by using mathematical algorithm the resultant code is called Cipher text which is not easy to deduct. The encryption is generally done through the Hashing algorithm which convert the specify code length string to a fixed length byte also called hash. Decryption is a process of converting the Cipher text back to the Plain text.

Code Access Security -- Code Access Security ensures that System Administrator can set up their own security mechanism and give different trust level to different code based on their origin. If the required permissions of the assembly are not given by the system, your assembly will not run. So you are not always sure that your assembly will run on each computer. So while designing the assemblies, you should be aware about the system policies of the computer in which that assembly will run

Role Based Security -- It allows you to check the membership condition and the role associated with that user. Net Framework contains the classes which can check windows users and groups and implement authenticity

Wednesday, December 15, 2004

Do you know the Beauty of Sql Server 2000

Do you know you can have

1. 32,767 database per instance of sql server
2. 2 billion tables per database
3. 1024 columns per table
4. 65,535 secondary datafiles per database
5. 256 filegroup per database
6. bytes per row - 8060
7. clustered index per table - 1
8. columns per index - 16
9. columns per select statement - 4096
10. files per database - 32,767
11. maximum file size of data - 32 TB
12. nested subqueries, transactions, Stored Procedures, triggeres - 32
13. rows per table - limited to storage space
14. tables per select statement - 256
15. Non clustered index - 249

Friday, December 10, 2004

Thoughts

***********************************************************************
I have often regretted my speech, never my silence - Xenocrates
********************************************************************
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away - Antoine de Saint Exupery

*********************************************************************
Shoot for the moon. Even if you miss, you'll land among the stars - Les Brown

**********************************************************************
A people that values its privileges above its principles soon loses both - Dwight D. Eisenhower
**********************************************************************
The true measure of a man is how he treats someone who can do him absolutely no good - Samuel Johnson
***********************************************************************
You can only find truth with logic if you have already found truth without it - Gilbert Keith Chesterton
************************************************************************
The secret of success is to know something nobody else knows - Aristotle Onassis
*************************************************************************
Be nice to people on your way up because you meet them on your way down - Jimmy Durante
**************************************************************************
Blessed is the man, who having nothing to say, abstains from giving wordy evidence of the fact - George Eliot
***************************************************************************
I have not failed. I have just found 10,000 ways that won't work-- Thomas Alve Edisson

There is always some reasons to smile

*****************************************************************
One day a man was having a conversation with god when his whole life flashed before his eyes as a series of footsteps on the sands of time. He saw that there were two pairs of footprints, but during the most difficult periods of his life there were only one set of footprints. He asked god "You said you will be with me throughout this journey, but why have you deserted me during the most critical times of my life??" to which god answered "Son, I did not desert you, I was always with you...you see only one set of footprints because during those difficult times in your life, I was carrying you"

Another day a S/w Programmer was having a similar conversation with his PM when his whole project flashed before his eyes as a series of footsteps on the sands of time. He saw that there were two pairs of footprints, but during the most difficult times in the project there were only one set of footprints. He asked his PM "You said you will be with me throughout the project, but why have you deserted me during the most critical times of the project??" to which the PM answered "Son, I did not desert you, I was always with you...you see only one set of footprints because during those difficult times, I was sitting on your head!!"

Thursday, November 25, 2004

Importance of ClickOnce Deployment

ClickOnce deployment is a deployment technology for smart clients; if you have ever built any smart clients, you will be agreed that as of now , they are built using No-Touch deployment. Though No touch deployment in itself is great but contain few issues that needs to be resolved. Some of those issues with No touch deployment are

1) Smart Client applications cannot check for updates on their deployment server
2) They cannot incrementally update themselves

Let’s think of how to build an auto update feature in No touch deployment. For doing this, a developer needs to write and implement this feature but in ClickOnce, a smart client auto update feature is built into the framework which is responsible for checking for the application updates automatically. Obviously, these are smart client applications written using .NET FX 2.0 to take advantage of ClickOnce but the developer doesn’t write any code for update check or to pull down updates. If an update is detected, it can be pulled down incrementally or in whole by the ClickOnce subsystem it makes the updating of Smart Clients very easy

Tuesday, November 16, 2004

Seminar from Steve Ballmer, CEO Microsoft

On a few days visit to India, Steve Ballmer, CEO of Microsoft spends some time with the developer community of Bangalore. I was honured to get a chance to attended that seminar On a one hour, he had been very clear about the Microsoft Strategies towards .NET and taking some collaboation with Indian companies. Steve Ballmer clearly stated that Microsoft is not looking for developing .NET in platforms other than windows.He clearly stated that .NET is not going to be Platform independent and also laugh when asked about Projects like MONO in Linux. He regarded these as the bad clone of .NET. He showed a great intrest in interoperability and strenghthen the use of Web services and also declared it Microsoft is also looking for some security aspect with it by implementing and enhancing WS-I. On one of the question asked for the qualities to be a CEO, he responded that a person should be Optimist and Good Team leader along with having a Great Sales Representative. He had also given some information about the LongHorn, Yukon and Whidbey as the future products. One of the intresting thing that i got to know in his seminar was about Microsoft Sharepoint Portal Server. On talking about Mobile development, He informed that Microsoft CE.NET will be more enhanced to meet the customer needs. This is the product that has given Microsoft highest revenue till now in the history of Microsoft.

Wednesday, November 10, 2004

Structured Exception Handling of my Life

TRY
{
Trouble Trouble till Termination;
TRY TRY till Totality;
GO,GET,GOING;

}
catch( Negligence)
{
Woods are lovely Dark and Deep;
Miles to Go before i Sleep and Miles to go Before i Sleep;
}
catch
{

Learn the road by travelling it rather than consulting all the maps of world;
}
Finally
{
ARISE, AWAKE AND STOP NOT TILL THE GOAL IS REACHED;

}

Discount on Microsoft exams

Good News Guys,

You can also avail a 20% discount on Microsoft Certification exam fees if you take your exams before December 31, 2004. To learn more about the offer, please visit

http://www.microsoft.com/india/learning/makeyourmove/

Tuesday, November 09, 2004

When to use Exceptions in .NET

Introduction
I had seen a lot of articles and problems on .NET pointing about the need of exception problems. This small article will point of need of the exceptions and its usage.The main importance is to increase capability in right usage of exceptions in .NET and not in how to write exceptions.

Exception , Bugs and Errors ? Three different Enemies

It is a common misconception to know that developers use to think of Errors , bugs and Exceptions as the same acronym but in reality they are different. Lets see it one by one. Bugs generally arises due to programmers mistake and even the compiler are the first friend to fights against this bug by informing about the syntactical accuracies.. Though Bugs can also led to exceptions but can be avoided if we write good code. We should atleast minimize the usage of bugs by writing clear code.

Errors arises due to User's mistake. For example the user has entered the string in case of integer. Though exception can also arise due to errors but one should avoid errors by writing the good validation code. This precaution not only safe us from writing wrong exceptions but do help us in writing good coding.

Exceptions are not necessarily errors
. Whether or not an exception represents an error is determined by the application in which the exception occurred. An exception that is thrown when a file is not found may be considered an error in one scenario, but may not represent an error in another.

You should not use exceptions as a means to provide your intended functionality. For example, a user might enter an invalid user name or password while logging on to an application. While this is not a successful logon, it should be a valid and expected result, and therefore should not throw an exception. However, an exception should be generated if an unexpected condition occurs, such as an unavailable user database. Throwing exceptions is more expensive than simply returning a result to a caller. Therefore they should not be used to control the normal flow of execution through your code. In addition, excessive use of exceptions can create unreadable and unmanageable code.

Exceptions are known but unpreventable errors for eg, out of memory etc... This is the place where your exception handling comes into account and can atleast notify the user with the problem. As a good coding syle, i will always recommend you to write exception handling to deal with only unprevetable situation. Though Microsoft has really put its sincere effort in helping us dealing wiht all kind of exception which either arises due to bugs, errors or exception but you should avoid using exception handling till the time it is not required. One of the reason writing the above statement is that Exception handling is memory intensive and can also affect other application running concurently. Throwing exceptions on things like invalid arguments to an API is probably just fine, but on the other hand throwing an exception due to invalid user input, or badly formatted text from an external system, could be a bad idea. Significant use of exceptions in business logic validation is more often a bad idea than a good one,

It is often preferable to use Multiple Catch statements in a single Try block, although the placement of Catch statements can impact performance.To understand about the exception hierarchy is the formost task and one should give a deep thought before dealing with exceptions in .NET. Once an exception is caught, the processing of the remaining Catch statements is aborted. Subsequently, once the Catch clause completes processing, the Finally clause is processed if available. To make your exception handler more clear, specific and efficient , go from Specific exceptiion to Generic ones.

class ExceptionTestClass
{
public static void Main()
{
int x = 0;
try
{
int y = 100/x;
}
catch (ArithmeticException e)
{
Console.WriteLine("ArithmeticException Handler: {0}", e.ToString());
}
catch (Exception e)
{
Console.WriteLine("Generic Exception Handler: {0}", e.ToString());
}
}
}


See in this example , it is better to catch the Arithmetic exception first and then Exception class as the base exception class is System.Exception.One important thing that should be taken care is that altrhough you should put all the specific handling catch blocks but should also catch any unhandled exception through System.Exception class. See in this example, Is there any neccessity to catch the Arithmetic exception if user would have entered the value of x. In that case, Probably, it would have been checked through validation code . You demanded that user should entered any numeric non zero value, but if user has entered 0, you should checked through your validation code and rather than using the exception.

Finally : Exceptions are like Accidents

You don't know when you can met with an exception so you should have the precautionary measure. This precautionary measure is very important and approriate measure should be taken at appropriate position.For example , In case, if you will wear a helmet while you are in boat does not make sense to all.

Though i had not covered this article by giving some code example but has deal with the situation which can help developers to become judicious in the usage of the Exceptions. I hope this small article would be of great usage to all the developers trying to know where to use the exception handling or not.

Serialization in .NET

Introduction
Serialization is a process of taking an object and converting into a form so that it can be transported across the network or can be persisted in the storage location. This storage location can be physical file, database or ASP.NET Cache. The form contains the state of the object so that by this format, we can construct the same object a later point in time, which is called Deserialization.

There are three formats of serialization

Binary Serialization : Light and compact used in Remoting
SOAP Serialization : interoperable use SOAP and used in web Services
XML Serialization : Custom Serialization



XML SerializationFor XML serialization, you need to use the attributes and specify them for each and every public member that you need. But since it is limited that it can serialize only public members, Serization done by it is called custom serialization. It is also known as Shallow Serialization

SOAP and Binary SerializationXML serializes only public members of the class. You use SOAP or Binary serialization when you need to transport data across the network. SOAP sends it using HTTP Protocol which makes it most interoperable while Binary serialization is known for its light and compact nature. Web Services uses the SOAP Serialization and Remoting uses the Binary Serialization. Infact Serialization is always neccessary when you need the object to transfer across a network. Advantage of using the SOAP or Binary serialization is that you can serialize the entire object and all those object that are being refrenced by it. This is why it is also called Deep Serialization. If you want any class to serialize through any of these methods then you should use [Serializable] attribute on that class and then you can use the SoapFormater class or BinaryFormatter class to do the serialization. These classes have Serialize and DeSerialize method. If you will not use SerializableAttribute for the class, then it will raise the exception.

Though this is the easiest way but at time you need the way so that you can decide what fields to serialize and how the serialization actually occurs. You can implement the ISerializable interface in the class. You need two things for that

Constructor that is overridden and can handle the Deserialization process
GetObject method that tracks about which data is serialized.
A small example below illustrate this all.

public class Employee :ISerializable
{
private int emp_no;
private string name;

protected TestData(SerializationInfo info,StreamingContext context)
{
this.emp_no = info.GetInt32("emp_no");
this.name = info.GetString("name");
}
void ISerializable.GetObjectData(SerializationInfo info,
StreamingContext context)
{
info.AddValue("emp_no", this.emp_no);
info.AddValue("name", this.name);
}
}
}


I hope this introductory serialization information can help you to understands about Serialization with its need and its effective usage.