Archive for the '.Net' Category
Friday, June 29th, 2007
After its last release on October 16th 2006, I had received lots of email about library, its strength and its area of improvements, specially, the one prompting to kill the great G. Unfortunately I could only start working on improvements and suggestions some times ago, and fortunately its ready to be delivered anytime during next week :). It contains lots of new improvement, datastructure, algorithms… Great G prefix is no more.
By the way, don’t stop sending me suggestions, remember its yours and only yours library.
Posted in .Net, C#, Generics.Net | 1 Comment »
Saturday, February 17th, 2007

9th January 2007, I headed my journey to Sydney, business capital of Australia and city of harbor. I spent for 39 days and spent wonderful time. During tour I could manage to visit many places in Sydney and Melbourne and met wonderful people. I noticed Aussie people are humble and friendly. Some of the things in Australia were similar to those of in India. Those are…
- Multicultural Society: Australia has multi-cultural society. People from about 200 countries have migrated to Australia, making Australia one of the most culturally diverse countries in the world. On the other side India too has got 28 states and 7 union territories, each with unique culture, identity. Most of the Indians are multilingual and multi cultural. And they feel proud to be part of such a nice country.
- 26th January: India and Australia share common national day 26th of January. In the year 1808 - January 26th, The Rum Rebellion succeeds in taking control of the Australian government, Aussie celebrate that day as an Australia Day. On the same day in the year 1950 the Constitution of India comes into force, and India declares itself as a “Republic”, a date thereafter celebrated annually as Republic Day in India.
- Drives on Left: Like India, Australia is one of the few countries in the world that drives on the left. There is a history behind why some countries follows the British way of left side driving. Click here to know more
I know some of you might be expecting my tour photos. Don’t be worried, I am going to put those snaps in the new section at www.aamirOnline.com called Gallery, which is coming soon, wait for that.
Posted in .Net | 2 Comments »
Monday, January 8th, 2007
According to definition, an Interface in a system is considered as a contract. Classes that implement the contract must adhere to its terms and conditions. It’s like a legal agreement where contractee (classes) which are bound by the contract and hence must implement each and every aspect of that exactly as it is outlined or defined. From the implementation viewpoint this definition or perspective is good, however so far as designing is concern it doesn’t help much. It’s very difficult for developer from a non object oriented programming background, to understand why has been a particular interface designed that way. They very well understand how to implement it, however can’t think about incorporating ones own interface into application design. To prove that I asked following questions to many of such developers. And got expected answers.
- Q: Do you know the interface concept in contemporary languages like C#, VB.Net or Java? A: Yes
- Q: What is an interface? A: Interface is some thing, which only contains declaration of methods, properties. A class that implements an interface must implement it exactly as it is defined.
-
Q: Why can an interface only contain structure, not concrete code? « No Answer »
- Q: Have you implemented interfaces in your projects? A: Yes.
-
Q: Have you designed interfaces in your project? A: No, it was never required.
See the answer to question number 3: most of the developer doesn’t even know why an interface can not contain concrete code. If you are among such developer, don’t worry, you will understand it why. Question number 5 reveals that many developers in reality never ever create a single interface in their software development career on their own. In other words it is non-utilization of most important feature of the modern languages. Changing Perspective Let me ask you few questions which will eventually help in understanding of interfaces. You may find them silly and weird! But please try to answer them for a moment.
- Why don’t you call a car, a bike?
- What is the reason that, you do not consider a monkey as an elephant?
- Why do you think that fish can not fly?
You very well know the answers to these questions, right? Questions are different but answer is common, that every object questioned here has some characteristics, qualities and properties. They have their way of performing some action. For example: We can not call a car a bike because we know the structure of the bike somewhere in our mind, unlike cars; bikes are motor vehicle with two wheels and instead of driven, it’s ridden. We can not consider a monkey as an elephant because we know that monkey has different qualities and attributes then those of elephant. Same way we know that fish can not fly because fish is an aquatic animal which characteristically having fins, gills, and a streamlined body. Fish can’t have organs to fly. Flying is a quality of birds. I am repeating this again; every object has some quality, attributes and characteristics. They have their own way to operate something, perform actions and they know how to communicate and interact with other objects. Combining all these attitude, attributes, qualities, characteristics, communicating and operating way et cetera defines an object. And definition or classification of object is an interface. Â Please notice, I have used two words to define an interface: Definition and Classification. Â Lets consider following example.
ICar – Toyota Corolla – Mercedes Benz
Here Toyota Corolla and Mercedes Benz both implements an interface called ICar. So by considering interface as a definition: I can say Toyota Corolla and Mercedes Benz are ICar and they have all the attribute and qualities which fulfills the requirements to be an ICar. By considering interface as a classification I can say: ICar is a category. Toyota Corolla and Mercedes falls into category of an ICar because they satisfy all the characteristics and operational methods required to be considered as an ICar. Other way round, if any of the ICar, Toyota Corolla or Mercedes Benz would not be considered as ICar if they had not satisfied requirements to become an ICar. Non technically manufacturer of these ICar must put all the attributes and features in their respective cars to be considered or classified as an ICar. Technically developer of class ToyotaCorolla and MercedesBenz must implement an interface ICar to be considered these class as an ICar, failing to do so will result in compile time error. I hope you not have got the basic understanding interface as what exactly it is’ Next article will put some more highlight on interfaces.
Posted in .Net | 580 Comments »
Sunday, December 17th, 2006
Introduction
There are many developers who design and develop programs using object oriented languages like, C#, Java, VB.Net. These software professionals who might have got very good theoretical knowledge of Object Oriented Programing Elements like Encapsulation, Polymorphism, Inheritance, Abstraction etc. However they fail creating well designed applications or systems. They fail on different aspects. One of such aspect, which is very difficult for to integrate into their designs, is effectively incorporating interfaces into design.
This is a multipart series which will help understand the concept of interfaces from the different perspective. Next article will be discussing about envisioning and understanding of interfaces.
Posted in .Net | 3 Comments »
Sunday, October 29th, 2006
Whether you want to generate a dynamic function, write a dynamic algorithm or want to handle delegate inline, anonymous functions have always been at your service. However one area where in anonymous function lacking is, making a recursive call. Since it does not have function signature it’s not possible to make recursive call, at lease not directly. This entry shows you how to achieve that by utilizing some reflection API. Yes reflection, it’s always been there as your lifeguard ;).
   To understand the concept lets first create a simple recursive function to find a triangle.
Code: public int Triangle(int n) { return (n==1) ? 1 : n + Triangle(n-1); }
Now we will use anonymous function to find a triangle. Please notice the code. It performs following steps to achive recursion.
- First finds the current performing method using top frame in the StackTrace.
- And then invokes it.
Code: public delegate int TriangleDelegate(int n); public static int AnonymousMethodTriangle(int n) { TriangleDelegate triangle = delegate(int n) { //Find Method MethodBase method = new StackTrace().GetFrame(0).GetMethod(); return (n == 1) ? 1 : n + (int)method.Invoke(null,new object[] {n-1});//Invoke Method }; return triangle(n); }
Pretty simple huh….
Posted in C# | 560 Comments »
Monday, October 16th, 2006
Verions 0.2.0 alpha of generics.net is out which contains following new stack oriented stuffs.
- IGStack : Represents the interface for stack in generics.net.
- GLinkedStack : Represents a linked list based stack.
- GSynchronizedStack : A proxy stack class which makes IGStack based object synchronized.
Posted in .Net, C#, Generics.Net | 67 Comments »
Tuesday, October 10th, 2006
First version of generics.net, 0.1.0 has been released. Written in C# 2.0 generics.net is an object oriented library aims to provide complete generic solutions in terms of datastructures, algorithms and patterns. Current verion is in alpa and not completed, it is released to the community so thats it can be discussed and contributed. Project is hosted at codeplex.com, a microsoft’s community development site. Generics.net was visualized late in october 2004, then it was planned to be hosted at gotdotnet.com. Unfotunately it never happend. Anyway, now since project has been started it will reach to desired destination soon… Next version 0.2.0 will be released soon in the first half of the upcoming week ;).
Links
Generics.net project home
Posted in .Net, C#, Generics.Net | 6117 Comments »
|