Sunday, June 10, 2012

Playing with Constructors (c# 4.0) (Examples in VS 2010)

Constructors are class methods which executes when class object is created. 
Constructors can be marked as public, private, protected, internal, protected internal, static.
Classes can have multiple constructors. If we do not specify constructor, c# will create default one.

Scenario 1: Inheritance and default constructors

When we inherit base class (Base1) in child class (Base2), and create an object of child class, it executes base class constructor first and child class constructor later. This helps that when child class constructor is executing, system makes sure that base class has already set properties or initializations and then child class can re-set those according to need. Refer below example for this:

class Base1
{
    public Base1()
    {   Console.WriteLine("Base 1 .ctor called");
    }
}
class Base2 : Base1
{
    public Base2()
    {   Console.WriteLine("Base 2 .ctor called");
    }
}

Actual call is
Base2 base2Obj = new Base2(); or
Base1 base1Obj = new Base2();

Output is

Base 1 .ctor called
Base 2 .ctor called

Even if you write base2 constructor as below, output will be the same as mentioned above.

public Base2() : base()
{       
     Console.WriteLine("Base 2 .ctor called");
}

Conclusion:

It always the base class costructor that  get called first. Derived class may not like the way that the base class has been initialized. It can change the initial value of data provided that it has access to do so.


Sunday, December 4, 2011

Terminologies used in "Full Text Search"

Recently I and my Friend Sonali has completed a white paper on full text search engines with detail case study on SQL Server 2008 full text search & Lucene.net

The important thing to understand in full text search is, being aware of various terminologies used in full text search process. In below paragraph I am going to explain in short about what is full text search and in later paragraphs various terminologies used in the process.
This information is collected from various websites, from msdn, apache lucene.net formal website etc

Full Text Search
In text retrieval, full text search refers to a technique for searching a computer-stored document or database. In a full text search, the search engine examines all of the words in every stored document as it tries to match search words supplied by the user.
Full text search is often divided into two tasks: indexing and searching.
The indexing stage will scan the text of all the documents and build a list of search terms, often called an index.
When a query arrives, either programmatically or as a result of a user request, the full-text engine accesses the sorted and optimized word index to identify which documents contain the requested term(s). The engine creates a list of documents that qualify, typically provided as a list of pointers into the main document index.

General terms used in full text search engines...

Saturday, June 18, 2011

What is Scrum?

I always hear 'Scrum' and 'Agile' words in my project since my project is following Scrum methodology. I started working in Scrum project, when I was very new to these terminologies. After 3 years, now I realize the importance for Scrum over other software development methodologies.

Below information I collected from few websites which defines above both things.

Agile Methodology

Agile methodology is an approach to project management, typically used in software development. It helps teams respond to the unpredictability of building software through incremental, iterative work cadences, known as sprints.

Agile development methodology attempts to provide many opportunities to assess the direction of a project throughout the development lifecycle. This is achieved through regular cadences of work, known as sprints or iterations, at the end of which teams must present a shippable increment of work. Thus by focusing on the repetition of abbreviated work cycles as well as the functional product they yield, agile methodology could be described as “iterative” and “incremental"

Agile methodology emphasizes the communication ,collaboration ,rapid exchange of information , teamwork and what is very important the functioning software and flexibility.

The results of “inspect-and-adapt” in this methodology to development greatly reduce both development costs and time to market. Because teams can gather requirements at the same time they’re gathering requirements, the phenomenon known as “analysis paralysis” can’t really impede a team from making progress. And because a team’s work cycle is limited to two weeks (or as defined), it gives stakeholders recurring opportunities to calibrate releases for success in the real world.