-
Notifications
You must be signed in to change notification settings - Fork 5
Architecture of Algernon
legend:
- purple - 0 software
- yellow - GUI
- blue - application software
- green - technology software
Classification according to Siedersleben2004 (Moderne Software-Architektur. J. Siedersleben; dpunkt, 2004.)
Algernon is currently based on a very simple search procedure, which should probably adapted very soon.
- All searchable items are created in
ALGItemProvider initializeItems
- When entering a search term, the fitting
ALGItemFilter
is selected. - The searching behavior depends on the filter (e. g. searching for class comments works differently), but by default a fuzzy matching algorithm (
ALGFuzzyMatcher
) is used to find all items that have all characters of the query in the right order. All items are assigned a score based on that. - The
ALGSmartSorter
sorts these items based on the fuzzy matching score, how often they were seletced before and when. - Matching results are displayed in the
ALGResultList
.
An ALGType
represents a kind of search result result. For example classes and methods have an ALGType
. If you work on Algernon you will often find yourself in the situation to add a new type.
- Subclass
ALGType
toALGMyNewType
- Implement
ALGMyNewType>>algertemList
. This method should return all things that algernon should search for. For exampleALGClassType>>algertemList
returns anALGItem
for each class in the image. Take a look atALGItem>>withAlgertype:
for how to create anALGItem
for your type. - Add your new type to
ALGItemProvider>>initializeItems
. This method will be called when Algernon is first launched and will create all the items to search through, including your new ones.
Everytime you search something in Algernon, the items are matched by an ALGItemFilter
. Normally this is done by the ALGRegularFilter
that implements the fuzzy matching based on item name you are used to. But sometimes we want to have special logic around filtering. For example: If you enter a keyword like open
you only want to see results that respond to that keyword. You might want to create your own filter. This is how to do it.
- Subclass
ALGItemFilter
toALGMyNewItemFilter
. - Overwrite
ALGMyNewItemFilter>>filter:anItemCollection:given:aStringCollection
. The first argument will be the set of all items to filter through and the second will be the tokens of the input string. Here you can now filter how ever you like. - Overwrite
ALGMyNewItemFilter>>helpTexts
andALGMyNewItemFilter>>keywords
. Here you define which keywords activate your filter and write the help texts for these keywords. These texts will be displayed by thehelp
keyword.