Multiplatform project file organization: Separate "Upstream" project for core functions?
-
Hi, I've developed a C++ Qt desktop application, and I want to port it to Android, and eventually iOS. I'm sure that some of my code will have to be repurposed for the different UI layout that i'll setup on mobile, but there are definitely some functions that will work exactly the same, such as functions that crunch strings or generate save/cache files. How should I go about organizing these common functions so that they're all stored in headers that don't pertain to a specific Qt project? Do people commonly run into this problem when porting their projects to other platforms?
Thanks!
-
Hi and welcome to devnet,
The most common is to cleanly separate the UI and the core logic. Then you can build/specialise your UI for the target platform. A bit like the model view paradigm where the data and it representation are clearly separated.
-
Hi and welcome to devnet,
The most common is to cleanly separate the UI and the core logic. Then you can build/specialise your UI for the target platform. A bit like the model view paradigm where the data and it representation are clearly separated.
-
Unless you are re-using your core libraries in several project, it's pretty rare to have it in a separate repo.
Hover you can have several sub-projects. For example one for a library containing your core logic and one for the application itself.