Project structure matrix

peacemaker

Expert
Licensed User
Longtime User
Hi, All

Question about the project structure in any B4X IDE regarding the conditional compilations.

If we have for now matrix dimensions:
  1. X = 2: Client and Server sides
  2. Y = 4+: Internal solution mutually exclusive options of the Client, say: Sensor_WiFi, Sensor_LoRA, Sensor_BLE, Sensor_USB....
  3. Z = 2+: Hardcoded Server's URL variant: URL1, URL2,.... that will be adding. Again: it's hardcoded constants, not settable variables.
So, it's X * (Clients(Y) + Servers(Y * Z)) compilation variants having the shared code for sure.
The shared code should be maintained.

How the project structure may be organized (say, in B4R IDE) to have some correct source code with maximally shared code modules ?

I have invented such idea, but no idea if it might help if even released.
 

Dr_JU

Member
  • Could you clarify what you're trying to achieve, or more precisely, what you're doing (as project)?
Because i could explain you matrices in Clifford algebras on coplanar spaces with a Minkowski metric, but I don't think that's relevant.
 

peacemaker

Expert
Licensed User
Longtime User
  • Could you clarify what you're trying to achieve, or more precisely, what you're doing (as project)?
Because i could explain you matrices in Clifford algebras on coplanar spaces with a Minkowski metric, but I don't think that's relevant.
I guessed it's rather clear what it is: project with many compilation options that depend one on another.

Now i'm trying just to split the project into 2 projects: Clients project (with their conditional compilations), and Servers project (with their conditional compilations).
 

Dr_JU

Member
Ahh...., then I understood correctly, but I feared I hadn't.

Independent dimensions: treat each dimension as a separate variable:
  • Role: client or server (different behaviours).
  • Gateway/URL: puede variar por deployment o por build.
  • Hardware sensors: drivers and physical capabilities.
  • Software/features: protocols, flags, libraries.
Rules by branch: define clear rules by role. E.g.: “a server has 1 URL per build” or “a client can point to 2 URLs at runtime”.

Key decisions: move as much as possible to runtime (configuration, URLs, gateway selection) and leave only what's strictly necessary at compile-time (hardware drivers).

(example)

Client:
if there are C clients, each client can use U URLs and S mutually exclusive sensors: client_builds = C×S×U

if the sensors are independent (on/off): client_builds = C×(2^S−1)×U
 
Top