1. Create a new branch from your existing main branch. Give the branch a name that will be recognizable to you later as button factory works.
2. On your newly created branch, create a new class called ButtonFactory.
3. Inside the ButtonFactory, you will create functions that facilitates creating each button.
4. Change the logic in your main calculator app to use the button factory.
Note: Your Button Factory must have several functions. Not just one utility function.
button = new wxButton( ...
will become somthing like
button = ButtonFactory.CreateAddButton();
or
button = factory.CreateAddButton();
5. What will you need to do to the event table to make this new factory functional? Will you need to use the bind functionality?
6. Try to move as much code over to the ButtonFactory as you can. Inside the ButtonFactory, you may have functions that call other functions in order to make your code more efficient.
7. Once you are done, merge your changes back to your main branch in and submit a link to your GitHub commit.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here