Azure-Samples / MqttApplicationSamples

Samples implementing common PubSub patterns for Edge and Cloud Brokers
MIT License
25 stars 25 forks source link

Directory structure does not scale to different languages due to directory fragmentation #79

Closed ryanwinter closed 7 months ago

ryanwinter commented 11 months ago

Fragmenting language across multiple separated subdirectories, makes it difficult to easily share code across different application samples.

We should consider inverting the directory structure so that language is at the top level which allows each language to adhere to the requirements imposed by the language and its build environment.

For example:

-|- python/
 |  |- mqttclients/
 |  |- gsg.py
 |  |- command.py
 |- csharp/
 |  |- ...
 |- java/
 |  |- ...

Language

C, Go, Python, .NET

rido-min commented 11 months ago

we talked about this issue at the beginning of this repo. We decided to go with this structure to enable reusing the required setup across languages.

makes it difficult to easily share code across different application samples.

why?

ryanwinter commented 11 months ago

I agree, however as we progress through implementation we are seeing some issues with this layout and I though it would be good to revisit this given we have more knowledge to make sure this still makes the most sense.

Side effects I am seeing are that most languages dont like having their files not hosted in a the subdirectory tree. We see side effects of this with Go, C and Python (not sure about Rust). The workaround have been to pollute the languages agnostic directories with languages specific files.

I think it would be worth taking another look to confirm that we want to continue down this route.

rido-min commented 11 months ago

which issues? we should have the common code in the mqttclients folder and reference those from the samples. Some times we might need to add something in the root folder to wrap both, such as go.mod, or the global CMake file.

rido-min commented 7 months ago

@ryanwinter can you provide some suggestions to move forward on this issue?

ryanwinter commented 7 months ago

I'll close this, not aware of any changes needed anymore.,