-
Notifications
You must be signed in to change notification settings - Fork 80
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
[UserStory] Refactor "Play" function implementation #84
Comments
Refactoring for maintainability is highly desirable! Thanks for bringing attention to this. Some concerns about the Acceptance Criteria:
|
Responding to the concerns about the acceptance criteria.
This is certainly a valid concern, the original acceptance criteria were overly specific and mentioned a specific proposed solution. Likely the acceptance criteria should be more along the lines of, audio functions are inside of their own classes (should more classes be needed), and that is more agnostic with regards to the implementation. Likewise, the mention that the class name should be audioProvider is overly specific and should be omitted from the acceptance criteria.
I believe the intent is that any refactoring shouldn't remove functionality that is in the current version. Currently, when the user selects the play option under the file menu button "File>Play," a thread is opened to play audio which is generated from the ImgProvider instance that is open in the window where "File>Play" was selected, this is done by calling ImgProvider.play(). It may be necessary to change how the play method is called in ImageLab.java if the method is moved to another class, so the source code may need to be changed there too. I'd say that moving the play method to another class and then changing how it is called so that it uses the new class would be the most likely implementation, given that it is the most direct way to refactor the current code. Having the current ImgProvider.play() method simply dispatch to a new method in a new class would work as well, but seems less elegant and also doesn't solve the initial problem of moving audio related functions away from a class which ostensibly is for providing image display functions.
As above, this was a reference to the menu item under "File>Play"
This is also a reference to the current behavior of the ImgProvider.play() method. Currently, ImgProvider.play() uses other ImgProvider methods in order to get Image information and then creates a small song based on the RGB values in the image. In order to maintain current functionality, if the play() method is moved to another class, it needs to be able to access that information from ImgProvider. This shouldn't be too much of an issue because the methods used, getRed(), getGreen(), and getBlue() are all public, but any implementation of the play() method should be able to either be fed an instance of ImgProvider via an argument, or have access to an instance of ImgProvider via fields in its own class. |
All replies make sense. Please either create a new issue or revise this one. Thanks! |
User story updated to fix problems with previous acceptance criteria. |
Modified title to clarify that this is a refactoring effort. |
User Story
Essential components
Story
As a Developer
I want Audio functions to be separated
so that the program is more maintainable and easily extendible
Acceptance Criteria
Supporting Information
Currently, the play method is included inside of the imgProvider class. The imgProvider provides image information to generate the audio. Play method seems to be unrelated to the function of imgpProvider. Moving the play method to another class will allow further development of audio features and potentially allow for more extensibility of play methods.
Dependencies
Depends On
Dependents
The text was updated successfully, but these errors were encountered: