Dynamic dispatch... and why Xojo needs it.

with two shared methods you need a dummy class object as information
class1

[code]Public Shared Function FindId(no As Integer, obj As Object) as String

Return "Hello " + Introspection.GetType(obj).Name
End Function
[/code]
class2 super to class1

[code]Public Shared Function FindId(no as Integer) as String
// Calling the overridden superclass method.
Return Super.FindId(no, New Class2)

End Function
[/code]
will output class2

[code]Var t As String = Class2.FindId(1)

System.DebugLog t
[/code]
you will have a id for your query, the table name and you can return any object.

I see where you’re coming from and that would be a cool feature. I just did it differently. The majority of the code is in the base class. The subclasses are storage agnostic, so the backing could be sqlite, mysql, postgre, an xml file, or an array. (I create in-memory “database” classes using an array as backing.) Each subclass has very simple methods that just call base class methods with the correct field names and values. I used a code generator to write the subclasses. No hand coding involved.

@Norman Palardy It would seem that you’ve been down a similar path before…

<https://xojo.com/issue/56378>

Factory Design is what I’m trying to do.

Yes. This is what I’m doing as well. ARGen also provides an automated code generation to avoid hand coding. Still not good in a modern, object-oriented programming language.

that this is so fundamental to how the language already works I REALLY doubt they’ll make such a change

they havent in the 20 years I’ve been using the tool

Properties are this way as well

I’ll organize the protest march… I just needed to know what to write on my sign.

<https://xojo.com/issue/60924>

[quote=496583:@Kristin Green]I’ll organize the protest march… I just needed to know what to write on my sign.
[/quote]
Have at it
Friendly advice - Dont hold your breath waiting for it to happen :slight_smile: