Solved

Implementing Search in object oriented design

Posted on 2014-12-11
1
139 Views
Last Modified: 2014-12-17
Hi experts

Could you provide me with some best pratice examples of how to implement a site search for a website. I am interested in how to design my objects and classes in regards to the search.

Is it better to create a search object, which handels all searches or add a search interface to all searchable objects?

Many thanks
0
Comment
Question by:riffrack
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 22

Accepted Solution

by:
ambience earned 500 total points
ID: 40496503
Search is closely related to the data and access patterns. One pattern that comes to mind that allows for flexible searches is the Specification pattern. As a start check out http://www.codeproject.com/Articles/670115/Specification-pattern-in-Csharp

If you are using the repository pattern then adding a new method for new kind of searches. This makes sense if for example you dont require a great deal of flexibility in search types.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Saving a setting for all users at runtime which is secure. 2 225
Accessing sub list data in a C# struct 6 451
Dice Roll Probabilities 3 153
sort Multi-dimensional array 6 44
Before You Read The Article Please make sure you understand these two concepts: Variable Scope (http://www.php.net/manual/en/language.variables.scope.php) and Property Visibility (http://www.php.net/manual/en/language.oop5.visibility.php).  And to …
Introduction Many of the most common information processing tasks require sorting data sets.  For example, you may want to find the largest or smallest value in a collection.  Or you may want to order the data set in numeric or alphabetical order. …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question