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

Refactor Architecture #452

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Refactor Architecture #452

wants to merge 3 commits into from

Conversation

LBeghini
Copy link
Member

@LBeghini LBeghini commented Jan 20, 2024

Closes #193
Closes #191
Closes #180
Closes #182
Closes #446
Closes #435
Closes #450

Tip

  • To view the visual of the software, we strongly recommend the use of the sandboxes.
  • Domain logic can be better understood executing the tests.
  • The app is still functional and can be executed from main.

What is new? ✨

Project Structure

  • sandbox
    This folder copies the structure of view inside source. It is supposed to help develop visual components using PyQt. Each file inside the sandbox must follow the pattern sandbox_{component_name}, and be stored in the same project structure found on view, because it uses the structure to automatically build the components.

  • source

    • commons
      Stores objects and configurations that are used across the software.

    • domain
      Keeps all the logical foundation of the software, and all necessary configuration to make the program run. It is the only part of the software that interacts with mathematical libraries.

      • boolean_expression_solver
        Is where all the logic to solve equations or inequalities is. Now it is complex enough to deal with multiple logical connectives AND, OR. It also knows how to prioritize expressions with the use of parenthesis.
      • entities
        Those are the objects from the domain of the project. In a very basic way, they are meant to replace the dictionaries and will be used across the software to perform necessary calculations.
      • [WIP] filter
    • view
      Contains all the visuals of the software and is the only part that interacts with PyQt library.

      • components
        Components encapsulate logic and contain elements. They act as higher-level UI constructs and may involve more complex interactions. Components are responsible for managing the behavior of elements and coordinating their actions.
      • elements
        Elements are minimal, basic components with common behavior. They are the building blocks of the UI and can make the use of items.
      • items
        Items are VERY minimal components, mostly used to display information and with almost no modifications from its parent Qt class.
      • pages
        Pages represent distinct sections of the application UI. Each contains one or more components and is responsible for displaying them. They are the content to be displayed inside the windows.
      • utils
        Contains methods, configurations, and constants that are required across the view.
      • windows
        Windows are what will actually be displayed as a complete component of the software. Its internal contents are pages, and they have extra configurations as of where it's going to be displayed, the window size and so on.
    • controller
      Makes the interactions between windows of the software.

  • test
    This folder copies the structure of source, as each file containing logic is supposed to be tested to grant coverage.

Discoveries

  1. CODE DOCUMENTATION
    Following the proposed pattern from Add code documentation #191 , the code is being documented. Some examples can be found at source/view/components.
  2. TESTS
    Apart from testing the logic from domain, components from view are also being tested using PyQtTest.
  3. ICONS
    Instead of downloading icons to be used in the software, it is now installed a library qtawesome that allows us to import icons directly.
  4. COLORS
    Now we have a standardized way to use colors on the software, that adapts to the system's theme.
  5. LOGS
    It was implemented a way to add logs at the crucial parts of the software to facilitate debugging once the executable is generated
  6. CONFIG
    Stores the needed settings and information of the software, including, for example, the software version.

Warning

ONLY the Wizard is implemented so far.

  • Wizard
  • Filter
  • Project

Co-Authored-By: Fernando Pimenta <108306295+fsoupimenta@users.noreply.github.com>
Co-Authored-By: Lavínia Beghini <lavinia@beghini.dev.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants