|
using System;
namespace ContentSearchFactory
{
/// <summary>
/// Summary description for FactoryClass.
/// </summary>
public abstract class SearchFactory
{
public SearchFactory()
{
//
// TODO: Add constructor logic here
//
}
/// <summary>
/// Added by Pratik Patel. This is Parameterized Factory Method which is static.
/// </summary>
/// <param name="searchType"></param>
/// <returns></returns>
public static SearchFactory GetSearchObject(string searchType)
{
SearchFactory objContentSearchObject = null;
if(searchType.ToString().ToUpper() == "SIMPLE")
{
objContentSearchObject = new SimpleSearch();
}
if(searchType.ToString().ToUpper() == "PROXIMITY")
{
objContentSearchObject = new ProximitySearch();
}
if(searchType.ToString().ToUpper() == "SIMILARITY")
{
objContentSearchObject = new SimilaritySearch();
}
return objContentSearchObject;
}
public abstract void GetSearchResult();
public abstract void ExecuteSearch();
public abstract void SaveAndSearch();
public abstract void ValidateSearch();
public abstract void UpdateDisplayName();
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
He is a Bachelor of Engineering (Computer science) graduate with the total work experience of around 5 years on microsoft technologies primarily on C#.NET. Currently he is engaged in exploring new technologies like nHibernet, DDD, TDD, jQuery and ASP.NET MVC. His previous experience includes the development of the leading community website, C++/COM+ with active directory (He loved playing with AD), MS-CRM, .NET remoting, webservices and ASP.NET. He holds the MCP certification for 70-316.
Along with Software Development, he likes to play harmonica (Mouthorgan) and likes to spend the weekend researching on new coding techniques published on www.codeproject.com