The way I outlined, if I remember correctly, also allows for modules with embedded classes or other modules, while it doesn’t work as expected otherwise.
As I said, though, I’ve not had a need to do this in quite some time, so it may be different and YMMV.
It looks like modern Xojo entirely blocks making and adding an external module with child classes/modules. If you try, you get messages. You can export the module, but you cannot then import it in to a new project as an external.
I noticed that too, when I was trying to incorporate your excellent GraffitiColors module as an External Item to some of my projects. I had to rework things to put the parts I wanted all as direct child objects from the one parent Module. Then it worked fine
Xojo externals are useful up to a point
And then when they turn out to not be you need to move to something else
For us that was day 1 and we’ve used svn externals since the first time we needed to share code between projects as they need to say in sync
I’m just suggesting for those than have the ability to use text projects that they should get used to using their version control system for this and retain more history in a usable form
In the past I’ve used extrnals a lot and often and it is very helpful if you are working on projects alone or with restricted user groups with same philosophy and project spirit and knowledge. But this can become deadly if somebody changes something you are not aware of.
Since 2019 I’ve begun to move my objects and code snippets to an internal git Instance. I love https://gitea.io/ which is lightweight, blazing fast and easy for collaborative work with others.
I’d sure want it to be “pluggable” so you could select git, I could pick git OR svn depending on project etc
If a person could write a “Version control script” that the IDE could use that’d be almost ideal then it would be infinitely extensible by anyone for whatever version control system they used
And if there wasnt one installed then the IDE just acts like it does now
I hark back to the days when you compiled a number of modules and therebye created a library, against which you linked your programs, and the linker included modules as required from the library to make the executable.
That, to me, was always a good way to re-use code.
However, I don’t know if there is a “best practice”… I guess that depends on your project(s) and needs, as all possibilities have their pros and cons.
There is quite some information in this topic, and also the Blog shows both (dis)advantages of that approach.
The MonoRepo approach could also be used without a Version Control system.
An advantage of the MonoRepo approach is that everything is contained in a single folder (containing sub-folders of course; all files referenced relatatively), and can be moved around and to other Operating Systems without issues.
Not with what the Blog Post is showing - that’s using just the xojo text project format. All (even shared) code is considered an “internal item” for the Xojo IDE, while parts of the code/files (all in xojo’s readable text format; not binary or xml) are shared between several projects.
That works just fine with the MonoRepo approach described in the Xojo Guest Blog Post: Xojo Projects in a MonoRepo.
One example is Aloe Express (which consists of Modules with nested Classes in there) - works fine for us to share between multiple projects.
Sure… a MonoRepo is not ‘the’ solution for every collection of projects - but maybe something to consider.
I’m curious if we’re the only ones that are using “shared code” with Xojo Text Projects using a MonoRepo - at least I’m not aware that this approach has been explained on the forum before… So I hope this Blog Post has been helpful to some, food for thought to others.