sharkhandler
Programmer
Hi there,
We have just been given the task of rebuilding our web based ecommerce system from scratch using the .NET framework. One of our tasks has been the redesign of the various subsystems within the product. A major question is - what happens in the case of searching. A user could search on several things within our systems and we want to know the best way forward.
1. We have a Search object. This contains all the functionality required to handle searching, overloaded functions, maybe an inheritance hierarchy so that we can derive customer specific searching. This way a subsystem would simply create a new instance of the required object and invoke the specific function required.
eg:
the advantage of this is that all the searching functionality is in one location, but it seem to me that you make quite a tight coupling between the calling object and the object that is created.
2. Each subsystem implements an interface I_Searchable. We have a search object that acts as a Manager object, in that it loads up the object to be and runs a search based on the provided interface. The advantage is that the search manager function can be relatively generic - it simply runs searches on the module loaded atrun time. The disadvantage is that should I_searchable change, we would have to make changes in multiple places (unless we sub the interface).
Personally, I'm tending towards a 50/ 50 mix of interfaces (for generic searching) and an inheritance hierarchy of the search manager (for client specific searching).
any ideas? as this design will be just as applicable to our reporting module.
Paul
We have just been given the task of rebuilding our web based ecommerce system from scratch using the .NET framework. One of our tasks has been the redesign of the various subsystems within the product. A major question is - what happens in the case of searching. A user could search on several things within our systems and we want to know the best way forward.
1. We have a Search object. This contains all the functionality required to handle searching, overloaded functions, maybe an inheritance hierarchy so that we can derive customer specific searching. This way a subsystem would simply create a new instance of the required object and invoke the specific function required.
eg:
Code:
public class CustomerSpecificSearch extends GenericSearch
public String SpecificSearchFunction (Param 1)
public String specificSearchFunction(Param1, Param 2)
the advantage of this is that all the searching functionality is in one location, but it seem to me that you make quite a tight coupling between the calling object and the object that is created.
2. Each subsystem implements an interface I_Searchable. We have a search object that acts as a Manager object, in that it loads up the object to be and runs a search based on the provided interface. The advantage is that the search manager function can be relatively generic - it simply runs searches on the module loaded atrun time. The disadvantage is that should I_searchable change, we would have to make changes in multiple places (unless we sub the interface).
Personally, I'm tending towards a 50/ 50 mix of interfaces (for generic searching) and an inheritance hierarchy of the search manager (for client specific searching).
any ideas? as this design will be just as applicable to our reporting module.
Paul