Implementing Search in object oriented design

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
Who is Participating?
ambienceConnect With a Mentor Commented:
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

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.