Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Factory Pattern
    primarykey
    data
    text
    <p>I am building a search application that has indexed several different data sources. When a query is performed against the search engine index, each search result specifies which data source it came from. I have built a factory pattern that I used to display a different template for each type of search result, but I've realized that this pattern will become more difficult to manage as more and more data sources are indexed by the search engine (i.e new code template has to be created for each new data source).</p> <p>I created the following structure for my factory based off of an article by Granville Barnett over at <a href="http://dotnetslackers.com/articles/designpatterns/Design-Patterns-Part-3.aspx" rel="nofollow noreferrer">DotNetSlackers.com</a></p> <p><a href="http://img11.imageshack.us/img11/8382/factoryi.jpg" rel="nofollow noreferrer">factory pattern http://img11.imageshack.us/img11/8382/factoryi.jpg</a></p> <p>In order to make this search application easier to maintain, my thought was to create a set of database tables that can be used to define individual template types that my factory pattern could reference in order to determine which template to construct. I figured that I'd need to have a look up table that would be used to specify the type of template to build based off of the search result data source. I'd then need to have a table(s) to specify which fields to display for that template type. I'd also need a table (or additional columns within the template table) that would be use to define how to render that field (i.e. Hyperlink, Label, CssClass, etc).</p> <p>Does anyone have any examples of a pattern like this? Please let me know. Thanks, -Robert</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload