snack-boomz / GUI-Calculator

Quick GUI Calculator - The Odin Project Web Development Online Curriculum: Foundations Course: GUI Calculator
https://snack-boomz.github.io/GUI-Calculator/
1 stars 0 forks source link

Use more of a MVC paradigm #10

Open oparkins opened 3 years ago

oparkins commented 3 years ago

I'm looking at: https://github.com/snack-boomz/TheOdinProject-JavaScript-GUICalculator-2/blob/cb79ac3f8a53f6944a4e06fd84d4864628eb9ea3/script.js#L865

(if I'm understanding it right)

And typically you will want to avoid using a UI component to save your state in. Instead, you'll want to use a Model-View-Controller paradigm:

The main difference is that you would have some other state holding the second digit instead of getting it from the display.

snack-boomz commented 3 years ago

so the MVC paradigm concept was something I recall using later down the line in the curriculum, or at least in a similar fashion with modules and factories, as seen here implemented in my Tic-Tac-Toe project here

You'll see that I have a DisplayController IIFE, a factory function, and a gameBoard. Now whether I implemented the MVC very well is another topic, but nevertheless, issue #10 makes for a great opportunity to apply the MVC paradigm to an older project like I had done for the tic-tac-toe project.

Looks look I've got some refactoring to do!

oparkins commented 3 years ago

If you learned in it the other project, then I'll take a look at that project later. I don't know if it is worth your time to refactor this one when you can keep moving forward within the Odin Project activities. But up to you. Glad you did learn it though!

snack-boomz commented 3 years ago

Check out my Tic Tac Toe project if you'd like to see some newb-fashioned MVC integration! (By that all I mean is an attempt at a DisplayController, gameBoard, and factory)