Project organization

I’m just curious how everyone organizes their Xojo projects. Do you organize by type (windows, containers, custom controls, classes, modules) or by function (contacts, tasks, accounts, reports)? Do you use folders, modules, or a combination of both?

I tend to group objects in folders by type and name related objects by function so they are listed together in the navigator. For example, in a folder named UI I would put windows and containers named ContactDashboard, ContactEdit, ContactPickList, etc. Similarly, i put my classes in a separate folder named classes and name each class also by function. They would be named ContactTable, ContactRecord, etc. so they too are listed together in the navigator.

For custom controls, i try to write them with a more general purpose in mind, as much as possible, so they can be reused in other projects. I put these custom controls, in addition to external controls, in a folder named classes. They would be named something like SearchTextField, PickListbox, NavBar, etc.

For more general purpose utilities and extending the functionality of built-in controls for which I do not wish to create a custom control, I will use modules. For example, in a module i would put a function to convert a recordset to an array. Or, extend a control to get the right and bottom location of the control.

I create folders according to Type (using your names above). I often have a tab open for each of these types. If I have a lot of related items within its Type folder, I create a sub-folder (folder in folder) to hold them together. I order them alphabetically, but usually place the external items at the bottom of the list.

I have tried to edit projects created by others who sort according to Function and find there is a lot more duplication of objects and code, plus, for me, it is much harder to debug large projects this way, since I spend a lot of time trying to find the item I need.

@Tim Leeland — I always group everything by function but I would never use something as broad as “UI”. I try to use more specific names and groups items which depend on each others so I could, ideally, just copy and paste them to another project… but it usually is not as simple as the theory :slight_smile:

I try to avoid “folders” in the IDE except for Graphics and the occasional custom control the consists of multiple classes. Otherwise I group Windows, Modules and Classes together, with Modules usually consisting of “related” functionality making as many “private” as is feasible