Recent

Author Topic: Establishing relationships. anyone have a better idea?  (Read 1330 times)

Hansvb

  • Hero Member
  • *****
  • Posts: 619
Establishing relationships. anyone have a better idea?
« on: February 26, 2024, 09:25:38 pm »
Hi,

Does anyone have a better idea or points of interest for the following? ...

In my daily work I create all kinds of ETL procedures (Extract Translate Load). Which actually means that I am working with many different data in all kinds of locations. As long as I am building, I know exactly where everything is and what the consequences of adjustments are, but if I have to change a table after six months, I no longer always know what the possible consequences are without first view the data at all the locations. That's a bit of a waste of time.
So now I'm looking for a way to document that. I haven't been able to find any useful tools for this, but if anyone knows anything, I'd love to hear it.

Until now I had the idea (and already tested it a bit) to put a number of string grids on a form, separated by splitters). And then if items have a relationship, these relationships are displayed using a color.
At first glance it works, but if you have 10 string grids it becomes tedious to read and creating the relationships is labor intensive. I do this with checkboxes and then saving it in a SQLite databas which consists of only 2 tables. 1 with all individual names of the items and 1 relationship table.
The idea seemed nice, but I think it quickly becomes confusing. (to manny grids with to manny rows).

Hence the question. does anyone have a better idea for capturing relationships between all kinds of different (data) items? Before I start again with "my new MVP knowledge", see other thread.

« Last Edit: February 26, 2024, 09:27:23 pm by Hansvb »

jamie

  • Hero Member
  • *****
  • Posts: 6128
Re: Establishing relationships. anyone have a better idea?
« Reply #1 on: February 27, 2024, 01:22:38 am »
You need a TTreeView structure.

The root names would be the master and all items under that tree per root is related.
The only true wisdom is knowing you know nothing

Edson

  • Hero Member
  • *****
  • Posts: 1302
Re: Establishing relationships. anyone have a better idea?
« Reply #2 on: February 27, 2024, 05:35:59 pm »
I've the feeling you need to model the entity "objects related" by a class and store several of that classes in a list. Then you will need a View-form to show the content of the list with the possibility of delete/edit. The backend of that will be storing the list, in a database, file or serializing.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Zvoni

  • Hero Member
  • *****
  • Posts: 2327
Re: Establishing relationships. anyone have a better idea?
« Reply #3 on: February 28, 2024, 09:27:32 am »
Ouch....this looks suspiciously like an EAV-Antipattern, which is "blegh"
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Establishing relationships. anyone have a better idea?
« Reply #4 on: February 29, 2024, 08:17:35 am »
Ouch....this looks suspiciously like an EAV-Antipattern, which is "blegh"
I hate a term that makes me need to join 3 tables just to get a value of a single key.

cdbc

  • Hero Member
  • *****
  • Posts: 1086
    • http://www.cdbc.dk
Re: Establishing relationships. anyone have a better idea?
« Reply #5 on: March 04, 2024, 11:58:20 am »
Hi Hans
I stumbled upon an interesting article by Graeme Geldenhuys, which seems to deal with the same sort of issue you're having, with regards to relations...
It's a short article with example code etc...
I dunno if it matches your case, but here it is:http://geldenhuys.co.uk/articles/relationship_manager.pdf
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

Hansvb

  • Hero Member
  • *****
  • Posts: 619
Re: Establishing relationships. anyone have a better idea?
« Reply #6 on: March 05, 2024, 03:53:46 pm »
Hi,

That wasn't what I was looking for but it does look interesting. I should definitely read that carefully.

What I have difficulty with is the representation of the relationships in the form. I now do that with stringgrids and colors. It works but quickly becomes confusing when there are to manny stringgrids in the form. I was actually hoping someone would know a better way.

cdbc

  • Hero Member
  • *****
  • Posts: 1086
    • http://www.cdbc.dk
Re: Establishing relationships. anyone have a better idea?
« Reply #7 on: March 05, 2024, 06:51:25 pm »
Hi
Have you had a look at e.g.: UML-modelling, I've seen tools doing some cool stuff with the relationships between objects, maybe one could /translate/ something like that to your use-case...
I know Delphi shipped some things with the architect versions ealier on, but I don't know about lazarus, of yet.
Food for thought:
https://sourceforge.net/projects/essmodelforlaza/
https://umbrello.kde.org
http://www.umlet.com/
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

 

TinyPortal © 2005-2018