Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System Architecture rework #28

Open
LeonMatthes opened this issue Jul 21, 2019 · 1 comment
Open

System Architecture rework #28

LeonMatthes opened this issue Jul 21, 2019 · 1 comment
Labels
internal This is an internal issue regarding refactoring, API changes, etc., intended for developers

Comments

@LeonMatthes
Copy link
Owner

LeonMatthes commented Jul 21, 2019

Currently the roles of the main classes (controller, context, menu and models) are pretty mixed into each other.
They should however all perform just one role, these should be:

Controller
Responsible for directing user input, to open/close the menu and to provide the menu with the appropriate model.
Currently the controller is Smalltalk-specific, there are even subclasses for browsers and workspaces, that provide functionality that should probably belong to the context.

Current sins:
#allowOverriding, #completionAdditionals, keeps a permanent reference to the context

Context
The context should be responsible for detecting in what context Autocompletion was opened.
Is there a receiver? What class is it? etc.
Therefore this should be the first Smalltalk-specific part of the system, not the controller.
The context should then be the first part that the Textfield-Model has controller over, basically deciding whether it is a Smalltalk-Textfield or something else.
This would make it possible to implement #23
The context should therefore also be the one responsible for checking whether it is parsing a method, not the controller.

Possible sin: Contains a reference to the model, not necessarily a problem, but who knows

Model
The Model is responsible for collecting all the entries, storing and filtering them
There should be Smalltalk-specific models as well as general purpose ones.

Current issue: Pretty slow, otherwise the models code is pretty solid.

Menu
The menu is responsible for displaying the model data.
It should be as smalltalk-agnostic as possible.

Current sins: Keeps a permanent reference to the context which it uses to access the model instead of communicating with the model directly.
Refactoring needed to remove the context from the model

@LeonMatthes LeonMatthes added the internal This is an internal issue regarding refactoring, API changes, etc., intended for developers label Jul 21, 2019
LeonMatthes added a commit that referenced this issue Jul 21, 2019
…ible.

Do not use the controller for that.
See #28
@LeonMatthes
Copy link
Owner Author

New questions:
Who is responsible for switching to untyped?
This is currently done by the menu morph, but should rather be a feature of the Controller, which could just reopen the menu to refresh it.
That would however make the controller smalltalk-specific again..
But thats not too bad as the feature could just be ignored in a non-smalltalk context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal This is an internal issue regarding refactoring, API changes, etc., intended for developers
Projects
None yet
Development

No branches or pull requests

1 participant