Best practice tipps needed!

Dear community,

I‘m pretty new to Xojo and programming in general… I tried myself several time with other languages, but discarded my plans for different reasons (too difficult for beginner, etc.)… With Xojo I found the right language for my skills AND my goals, and yes, it really makes fun and motivates me to see my big progress in a short time!!

Now I need your assistance: As a test application (desktop, Win), I make one who manages persons and groups of persons. Both, the persons and groups have different attributes. My first tought was, to design classes for both, the groups and the persons (and here 2-3 subclasses). When I got the persons‘ data from the UI, I saved them into a persons object and added it to the RowTag of a ListBox, where I also wrote the data readable for the User. But here I got stuck: I only wanted to make those persons visible in the PersonsListBox, who are member of the group selected in the GroupListBox. Every time the user changes the group selection in GroupListBox, the PersonListBox has to be rebuilt - and the data I saved there is lost! (Or how can I make specific rows invisible?)

The next step of my project would be, to save the application data into a SQLite DB File. That brings me to another idea: Why not save all the data to the file directly and read it from there when needed? In that case, I wouldn‘t attach the Object to the RowTag.

What are your approaches in such a case? How do you plan your apps in general? Do you draw flowcharts or something before you begin, or how do you plan and convert your plans to reality?

Thanks for your inputs! :slight_smile:
Cheers, Dominik

this (or something similar) would be your best approach… store the database record KEY only in the listbox

Start with the objects.
Design tables in a database to handle them.
Create a view to display them.
Create a set of methods to amend them, and have the view change to reflect the changes.

eg all the data is a database.
The view shows a list of groups.
When the group is changed, the view displays people from those groups. (maybe a sub set if the list is large)

This method is commonly called MVC, or Model-view-controller–view–controller

In my iOS apps I keep everything in arrays in memory and use a JSON file to save and restore the state as necessary. But that’s iOS. In my early Mac apps I used a database file.