I’m little more than a hobbyist with Xojo, even though I’ve been using it for probably 20 years. As a result it’s possible that what I’m writing about here has already been done and is common knowledge. But I’m offering it as an idea for other hobbyists who might find it helpful. As always, all comments welcome.
When I’m creating a new project I often find that I need to bring in the same features that I’ve previously brought in to other projects. But I’ve typically ended up just creating them afresh, or cutting and pasting from other projects. I’ve been thinking for a while that it would be good to build the scaffolding for a typical Xojo project (at least, typical for me) so that the next time I need those features I already have them.
To cut a long story short, I’ve spent some time recently doing this. I have created an application that I now have in my Xojo Project Templates folder. It’s called Scaffold. It has a main window, a settings window and a log window; I use these features a lot in my work, so it made sense to have standard templates for them. Scaffold uses the ModernPreferences and Log4Xojo modules (thanks to the authors of these modules), and a couple of extension methods. I have written a couple of articles documenting the process, which if you are interested you can find here: Scaffolding a Xojo application part 1 - tellura.co.uk
I’m happy to share the Project Template BTW. It’s not perfect by any means, but it does the job as a springboard for creating a new basic application.
On a broader front, I think it would be nice to have other scaffolded Xojo applications; maybe one for a local database with CRUD functionality, one for a RESTful client. Any thoughts?
I’ve had this thought for a long time also, but I haven’t done anything about it yet. But, I have recently consolidated the 20+ different versions of my “standard” helper module
I went down the Xojo Libraries route.
I looked at my apps, and found clear portions of code that could be extracted out to a library.
I then built another library on top of that, and more and more. I now have about 6 libraries that are used for many different areas of my applications. Eg i have a base library which has all my debug logging and such, and another library which has all the GUI controls i have created.
Create a new application, drop in the libraries you need, revert to saved and you have access to everything.
I have Claude code checking and rebuilding the libraries looking at the dependencies, and it deploys to a built folder so i can quickly access them. You need to have auto increment build numbers turned on so ensure Xojo IDE clears out caches. It sometimes gets confused, but a clear cache has always fixed it.
Claude has also analyzed the libraries and built unit tests and md files explaining whats in them. I can then include those md files in claude projects to discuss future apps so it knows what is available.
Some people on this forum are against libraries, however i have been using them for 6 months and they are very useful for internal development.
Other things i can do is rapidly develop new features in a library, test it locally and then drop it into my apps, link it up and know it will work. My largest app takes minutes to debug, doing it in a library takes seconds.
Adding new modules etc into the base library does required full cascading rebuilds of the other libraries, but with XMCP and Claude code it is as simple as typing in /rebuild into Claude code.