[Cppcms-users] Application Hierarchy and namespaces
Brought to you by:
artyom-beilis
From: <jo...@em...> - 2020-10-13 17:09:10
|
I’m planning on building a “larger” web application consisting of a complex end-user front-end and an administrator back-end. Splitting the application into different sub-applications as per the documentation is definitely necessary here. My question: I’d like to have a separate namespace per (sub)application. Can views & content classes also be in different namespaces. Basically I'd like to implement a project folder structure like this: my_fancy_server/ ├─ apps/ │ ├─ app_01/ │ │ ├─ app_01.hpp │ │ ├─ view/ │ │ │ ├─ foo.tmpl │ │ │ ├─ bar.tmpl │ │ ├─ content/ │ │ │ ├─ tmpl_foo.hpp │ │ │ ├─ tmpl_bar.hpp │ ├─ app_02/ │ │ ├─ view/ │ │ │ ├─ bar.tmpl │ │ │ ├─ foo.tmpl │ │ ├─ content/ │ │ │ ├─ tmpl_bar.hpp │ │ │ ├─ tmpl_foo.hpp │ │ ├─ app_02.hpp ├─ view/ │ ├─ master.tmpl ├─ content/ │ ├─ content.hpp ├─ website.hpp ├─ main.cpp Then I'd like each `app_xx` folder to have it's own C++ namespace. Therefore, the data/content class of `app_01/tmpl_foo.hpp` would be `apps::app_01::foo`. Is this advisable/recommended/wrong/not-optimal/perfect/ ...? I'd be thankful for any kind of feedback as I'd like to prevent having to re-organize everything after a few weeks of working and realizing that this is not optimal. Best regards, ~ Joel |