-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor modularity #1
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modus subclasses no longer depend on a Sylladex object reference
Some additional refactoring to extend the previous commit so that it covers the forgotten #.refreshModus() method
Fully replaced the entry method with a Hashmap of command name and routed consumer objects - contained in new `CommandMap` class. Added more getter/setters to ModiMgr to shorten chain calls. Sylladex refactored in response to these changes.
Sylladex now has it’s own CommandMap object. Also now constructs a list of all command names once (during modus selection) instead of every time the list is needed. Also cleaned up many snippets of code to reduce lines and increase readability. Searcher now works with (almost) all collections instead of just List. This reduces the overall call chains for formatting beforehand.
the ModusManager now collects the modus by filtering out invalid modi during the modus name to modus class object conversion step. Only instantiated a modus class when required and only holds onto one modus object reference at a time. using class objects is stronger than stringly names while being more modular by not trying to instantiate everything it can the first go around. Updated other classes code to reflect this implementation change. Added custom annotation and validation methods to help with the modus filtering process. Reformatted the code for better organization.
created ModusBuffer to act as a buffer that contains all the required data a modus would need to access and support modus hot swaps using the inverted dependency technique. sylladex was refactored to not share static objects and instead pass wrapped objects to the modus buffer on modus manager construction. sylladex is pruned of unnecessary dependencies. modus manager now handles modus input and acts as an API for the modus to the sylladex using the facade pattern technique. Modus now relies on the modus buffer for data from the sylladex, using the modus buffer's public getters.
the write and load methods were encapsulated into a File Controller to promote Single Responsibility of the sylladex.
created a util package to handle the command maps. created a case-insensitive map for handling command strings if desired. created an abstract command map class that implements the constructor and delegates map methods using composition and delegation pattern. created modus and sylladex command maps that extend the command map and add command execution specific methods. These features were added to make minimap impact to previously implemented. Minimal refactoring to other code where required for supporting the new types.
Removed unused classes within package. Removed unused methods within Searcher class. Marked in-use methods within Searcher class as deprecated. These changes should have no impact on other code as the changes affected unused code.
hotfixed a typo that affected the Searcher class' import declarations.
* moved the modus package to be within the app package. reasoning: the modus classes are tied close enough to the app package and won't exist elsewhere. * moved the ModusBuffer class to the model package. reasoning: the class acts as a buffer of data and is responsable for holding application state, so being a model for the modus classes makes sense.
* removed Searcher class; * updated modus class methods that used the deprecated fuzzy search method so that they can operate non-fuzzy. * updated several pentafile methods to reduce redundency and promote better communication on failure
* fixed a bug in ModusManager that caused construction to fail if using a name of a nested package (as opposed to the root package). * fixed all compilation-time errors in Modus subclasses, specifically corrected method signatures only to the extent that they can compile without throwing an error. They have yet be implemented, nonetheless.
* added several custom exception classes to the util package for use in Modus and ModusManager classes. These enable more expressive handling of the various kinds of exceptions with differing severity that a Modus class may throw; especially given the more 'blind' execution nature of the Modus classes. * fixed a few logical bugs within PentaFile class regarding card retrieval
class diagram no longer reflects current application state
Refactor branch complete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactored/overhauled several key structure implementations
removed co-dependencies and loosen coupling wherever possible
Sylladex
(lowest level) toModus
(high level), abstracting with modelsSylladex
(controller) depends onModusManager
(container) to interface with theModus
ModusManager
depends onModusBuffer
(model) andModus
(sub-controller)Modus
depends onModusBuffer
,Metadata
(model), andCard
(model)ModusManager
uses theModus
interface in conjunction with lambdas in aCommandMap
to dynamically execute functionality from the currently connectedModus
ModusBuffer
encapsulates data and provides required data to theModus
while also buffering this wrapped data between any swappedModus
objects.Sylladex
provides all required information in wrapped objects to enable soft linkage of data and allow theSylladex
to hold data manipulated by theModus
without having to collect it, utilizing the 'double pointer/reference' pattern design used in the C language.untangled older monolithic, spaghetti-esque code and purified code smells
improved the testability of the code
exception
handling practices to make debugging information more expressive and easier to find