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 #446

Open
5 tasks done
LBeghini opened this issue Nov 14, 2023 · 3 comments · May be fixed by #452
Open
5 tasks done

Refactor Architecture #446

LBeghini opened this issue Nov 14, 2023 · 3 comments · May be fixed by #452
Assignees
Labels
question Further information is requested
Milestone

Comments

@LBeghini
Copy link
Member

LBeghini commented Nov 14, 2023

As the software grew and at speed, the architecture of the code started to degrade. Updates needs to be made to fill the most recent needs of the software.

Definition

The proposed architecture is designed with modularity and separation of concerns in mind. It consists of the view, that contains elements, components, and windows, each serving a distinct purpose. Additionally, controllers facilitate communication between windows, the domain handles logic and domain classes, and the store manages shared information across components.

  1. view
    The View package encapsulates the graphical user interface components and their organization.

    • elements
      Elements are minimal, basic components with common behavior. They are the building blocks of the UI and do not require extensive testing. Examples include buttons, labels, and input fields. Elements are the atomic units that form the foundation of the UI.

    • 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. These should be thoroughly tested to ensure their functionality.

    • windows
      Windows serve as the outermost layer, wrapping everything together. They represent distinct sections of the application UI. Each window contains one or more components and is responsible for displaying them. Windows provide a cohesive user experience by organizing components in a meaningful way.

  2. controllers
    Controllers facilitate communication between windows. They manage the flow of information and user interactions. Controllers act as intermediaries, handling events and updating the UI accordingly. They play a crucial role in ensuring proper navigation and coordination between different windows.

  3. domain
    The domain is the core of the application, housing logic and domain classes. It handles business rules, computations, and other non-UI related functionalities. Separating the domain from the UI ensures a clean and maintainable architecture, allowing for easier testing and future updates. It is important to emphasize that the domain has absolutely no knowledge about Qt.

  4. store
    The store is a centralized repository for information necessary across components. It stores shared state and data that multiple components may need to access. This ensures consistency and avoids redundancy in data management across the application.

Steps

  • Create components and elements
  • Replace components at windows
  • Migrate logical code blocks from controllers to domain
  • Eliminate the use of dictionaries, replacing them by classes
  • Organize the store
@LBeghini LBeghini added the question Further information is requested label Nov 14, 2023
@LBeghini LBeghini added this to the Discovery milestone Nov 14, 2023
@LBeghini
Copy link
Member Author

Centralize Qt configurations, such as the use of customized Fonts

@atilaajones
Copy link
Contributor

atilaajones commented Nov 15, 2023

It's necessary to have a controller for each dock, not everything in the project controller.

@LBeghini
Copy link
Member Author

LBeghini commented Nov 28, 2023

Here follows a flow representing the new architerure

graph TD
  subgraph View
    subgraph Elements
      A[Button]
      B[Label]
      C[Input Field]
    end

    subgraph Components
      D[Component 1]
      E[Component 2]
    end

    subgraph Windows
      F[Wizard Window]
      G[Dialog Window]
    end
  end

  subgraph Controllers
    H[Controller 1]
    I[Controller 2]
  end

  subgraph Domain
    J[Logic]
    K[Domain Classes]
  end

  subgraph Store
    L[Shared Data]
  end

  A --> D
  B --> D
  C --> D

  D --> E
  E --> F
  E --> G

  G --- H
  G --- I

  H --- J
  I --- K

  J --- L
  K --- L

@LBeghini LBeghini linked a pull request Jan 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

3 participants