ZenArchitect.NL (Henk van Dijken)

the art of model-driven code generation

Archive for the ‘pattern’ tag

The Search-Engine Pattern

without comments

imageThe Search-Engine pattern is a simple, but powerful pattern. The user provides some sort of search phrase and the search engine returns all matches found in a data store. Next, the user browses the results to select the one she is looking for. When selected details are shown. This is exactly how Google (and other search engines) works.Datamodel

This pattern is also very useful for maintenance of simple data normally found in an information system. 

To apply this pattern to entities under maintenance, they have to fulfill some criteria. The entity must be:

  1. searchable
  2. able to return displayable results
  3. identified by a unique key

The entities in the model shown right fulfill these criteria. They all have a unique identifier. They are searchable through their name, which is also used for displaying in the search results.

When looking in more detail, the entities in the simplified model look very similar. This makes them excellent candidates for a generic code-generated maintenance solution.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Written by Henk van Dijken

October 30th, 2009 at 4:31 pm