Friday, July 29, 2011
Friday, July 22, 2011
That is the dilemma I believe ails the Windows phone in its quest to make a headway in the highly competitive mobile landscape. Even with the great reviews of the huge mango update scheduled for the fall, and the prospects of second generation hardware coming from OEMs like Samsung, HTC and especially the much awaited Nokia branded phones, I'm afraid that Windows phone will continue to languish as a so-so mobile OS behind Google and Apple if Microsoft does not fundamentally change their approach in marketing and exposing the OS to the consumers. The new iPhone hardware refresh with IOS 5 and the latest Android 4.0 are set to come out around the same time frame in the fall as Windows Phone Mango. Being the under dog, Microsoft has to actively do more work than their top two competitors.
Here are the six areas that I think they need to fix in order to give Windows Phone a chance to gain market share.
In the way of development of programs using FORTAN and COBAL like erlier languages the complexity was increasing for larger programs. So, the developers found out structured programing language like C. Later on these structured programing languages also became complex in developing large projects , so developers come up with the Object Oriented programing (OOPs) language.
Structure programing works only for what is happening inside the code but does not explains which data is affecting (not works around data).
Object Oriented Programing works on both; around the code (what is happening) and around the data (which data is affecting).
To achieve the Object Oriented Programing concept we have to fallow three principles of OOPS conecpt and those are
- PolyMorphism and
Let us learn about each concept
It means binding the Code and Data together; encapsulation provides security to data.
C# basic unit of encapsulation is Class, C# uses a class specification to consrtuct objects. Objects are instances of the class. Code and data are memebers of the class, the data defined in the class is field.
According to greek meaning it is "manyforms". We can describe polymorphism based on programing language like this. "Method name is same but its signature is different", it means same method name we can use more than one time within a class but its signature should be different. Signature is nothing but type of parameters or number of parameters passing to that method.
For example, You drive an vehicle, which has properties like wheel size, engine size, gas tank size, and other properties. The automobile you drive is a concrete implementation of the automobile interface. It has additional features, like sliding doors, logo type, cd changer slot count, moon roof lever location, or other various properties that are specific to the make/model of the vehicle.
In OO programming, Vehicle would be the base class, and each vehicle manufacturer would have its own implementation. For instance, Maruti has K-series engine technology, which is its own implementation. Volvo uses diesel engines, which is the TDI technology. More importantly, you may add a feature in the vehicle and implement make/model implementation, such as Car, Truck, or Suv etc.
- Polymorphism helps in decreasing the complexity of program.
It means "Reusability". Inheritence is the process by which one object can import the properties of another object.
We can achive the reusability using hierarchies, if we will not use hierarchies then each object would have to explicitly defines all of its characteristics (spcific and general characteristics). By using inheritance process an object need only to define those qualities that make it special within its class. It can inherit its general characteristics form parent or base class object.
The concept of inheritance is used to make things from general to more specific e.g. take Animal is the general class in that we can classify animals as Mammal and Reptile () these are two derived classes of super classs Animal and dog is a child class for both Mammal and Animal classes .
C# is a complete Object Oriented Programming language from Microsoft that is inherently supported in .NET. Lets learn about C# now.
C# sample program
Create a sample.cs file in Notepad and write following code.
static void Main()
Console.WriteLine("Hello World !");
Now open the Visual Studio Command Prompt and write following line of code.
C:\> Csc sample.cs
You should be get a .exe file named sample.exe. Run this exe file by double clicking and you will see a console window opens and write the text "Hello World!" Press Enter key and that window closes.
Now let me define each line of statement one by one.
static void Main():
static: a method that is declared with static keyword that method is called before an object of its class has been created.
void: it means the Main() method doesn't return a value.
In the above program if you type "main and writeline" insted of "Main and WriteLine" then compile time errors will occur. Because C# is case sensitive language and you will be forced to use the method or class name the way it has been defined in C#.
To print the result in console application Console.WriteLine(" Hello World !") is used and in web application Response.WriteLine("Hello World !") is used. In C#, all variables must be declared before they are used.
Keywords determines the features built in the language. C# has two types of keywords reserved and contextual keywords. The reserved keywords cannot be used as names for variables, classes and methods.
The Contextual keywords are those that have a special meanings. In special cases they act as keywords.
C# Reserved keywords
|void||while|| || || |
C# Context keywords
|var||where||yeild|| || |
An identifier is a name assigned to a variable name, method name or any userdefined names. Identifiers may start with Underscore (_) but should not start with a digit. Reserved keywords of C# can be used as an identifier if it preceded by "@" otherwise not.
ex: "@for" is identifier
"for" is not a identifier
Reference: I have given above information from the C# 4.0 Complete reference book that I am going through.
Hope this article was useful. Do let me know your comment or feedback.
With the rate of changes/ additions of features in the .Net framework, many of very good features don't get the deserved attention. Especially on the ASP.NET front, there have been many such features haven't caught the eye of developer. Dynamic data which was introduced with ASP.Net 3.5 (SP 1) is one of such cool new addition in the archery of ASP.Net.
Precisely ASP.NET dynamic data provides a framework which enables quick building of functional data driven application that are based on Microsoft ORM i.e. LINQ TOSQL or Entity framework data model. It has added smart validation and ability to change the display with templates to DetailsView, FormView, GridView, and ListView controls. As per Microsoft, the dynamic data framework enables major usability and RAD development changes to work with data model. The LINQTOSQL or EF can be registered with dynamic data to result into a fully functional web site. It supports all CRUD operations. We will explore dynamic data website with .NET framework 4.0.
Let's start a small demonstration (employing Entity Framework) step by step.
Environment: VS 2010, SQL Server 2008 with "AdventureWorks" database
Thursday, July 21, 2011
To create a dynamic menu for the website we would use ASP Menu Control, we can't bind a Menu control directly to database data. Neither the SqlDataSource nor ObjectDataSource controls implement the IHierachicalDataSource interface. Therefore, if we want to represent database data with the Menu control, we need to perform some more work i.e. build the menu items programmatically in the Menu control. This is the approach followed here.
Imagine that you want to represent the contents of the database table with a
This database table represents menu items. The menu items are nested with the help Of the Parent column. For example, the customer menu item is nested under the User management as shown similarly the further nesting can also be done.
protected void Page_Load(object sender, EventArgs e)