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

Implement PBCController as central class for business logic #20

Open
obraunsdorf opened this issue Sep 8, 2019 · 1 comment
Open

Implement PBCController as central class for business logic #20

obraunsdorf opened this issue Sep 8, 2019 · 1 comment
Labels
development Issues regarding development, transparent for user

Comments

@obraunsdorf
Copy link
Owner

obraunsdorf commented Sep 8, 2019

At the moment some of PBC's business logic resides in the implementations of Qt main dialog and PBCPlayView.

It would be better to implement a central component PBCController, which controls the application, implements all the business logic and acts as interface between the dialogs of the Qt-Framework and all the PBC-specific code.
This should improve code separation and therefore readability, maintainability and modularity.

@obraunsdorf obraunsdorf added the development Issues regarding development, transparent for user label Sep 8, 2019
@obraunsdorf obraunsdorf changed the title Implement a new class PBCController Implement PBCController as central class for business logic Sep 8, 2019
obraunsdorf added a commit that referenced this issue Apr 8, 2020
This merges some code which does essentially 2 things:
- setting up a unit test infrastructure with the Boost test framework
- implementing basic functionality to import another playbook, including tests

The implemented importing functionality is one big step for issue #10. 
The API supports importing all plays, categories, formations and routes.
However, you cannot choose which particular plays to import and which not.
Furthermore, there is no exporting functionality, yet to let you choose
which particular plays/categories/.. you want to export.
There is also a GUI dialog missing to fully use the current API.
Currently, it is hardcoded that plays, categories and formations (but no
routes) are imported and that the name of everyone of these are prefixed
with 'imported_'.


To implement playbook importing there are some changes to the codebase:
There is a new class PBCController. This addresses issue #20 and is a first step for centralizing the business logic of PBC.
For now, the PBCController simply does nothing else than maintaining the active instance of PBCPlaybook.
The class PBCPlaybook is no longer a singleton. There is the one "active Playbook" object instead.
This was necessary to be able to instantiate another object of PBCPlaybook for another playbook to be imported.

Moreover several adaptions for the CI scripts were necessary.
@obraunsdorf
Copy link
Owner Author

obraunsdorf commented Apr 8, 2020

The class PBCController was introduced in commit 1a27168.
It currently only holds a reference to the active playbook.
It should be easy to implement the whole API between the core of PBC and Qt only there. Still, would be quite some refactoring to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Issues regarding development, transparent for user
Projects
None yet
Development

No branches or pull requests

1 participant