Department
of Computer Science and Automation
|
Source Code Search Engine, M. Bharat Kumar |
a) Find source code.If you also consider that the crawler is external to the search engine system, then you can put one more usecase,
b) Feed source code.Why is this a good decision? Is there a good intuition in making the crawler an external party?
1) So, the user wants to specify the search specification. Who collects the specifications? Let us introduce an entity called "Search-specifiation-interface" or just "SearchInterface". The function of this entity is to provide an external contact point and let the user specify his search requirements. This search interface may contact other people and then collect results and provide them back.This seemed intuitive. The SearchInterface surely is a Boundary class, and the QueryProcessor, SearchEngine were Control classes, and the SourceCodeBase was the Entity class. But what is passed around?
2) Whom does this SearchInterface contact? He has to send it to some person who can understand the search-specification. A search specification is a query. Lets call this person a QueryProcessor. The QueryProcessor will look at the query and split them into possibly smaller queries etc etc. He employs the work of a simpler person who can be asked to give answers for discrete simple searches.
3) This person is the "SearchEngine".
4) The search engine does various things, but essentially works on a SourceCodeBase to search.
1) Introduction of classes Query and Result. The advantages of this were just mentioned.The relationships between these domain classes are also important. SearchInterface is associated with QueryProcessor, QueryProcessor with SearchEngine and the SearchEngine with the SourceCodeBase. SearchInterface, QueryProcessor, and SearchEngine are associated with Query and Result. Infact Query and Result are part of a ternary relationship between the classes SearchInterface, QueryProcessor, and SearchEngine.
2) Classification of classes in terms of the MVC.
1) The high level analysis provided the large classes which appeared to become components in my architecture.You should have realized by now that nothing much appeared to be object-oriented yet! For one it shows that elegant designs (if I can call this one as elegant :) ) need nt be object oriented at all.
2) Some of the model classes also served as excellent Message classes.
3) The use of connectors has helped us to abstract out several architectural issues likea) distribution (the components can be on different machines)4) Each component and connector can be taken up on their own, and we can have class diagrams for them. The MVC can be applied recursively!
b) load balancing (the connector can take up the job of performing load balancing and routing requests to components that are most free)
c) efficiency aspects in remote transfer (you could use plain RPC, or a message-oriented-middleware or even an Object RPC).
5) Once you have divided the problem into so many sub problems, you are at so much more ease to just solve simple problems.
Modified by: Sandhya G & Shijesta Victor on 03.11.2003