0

I'm (re)writing an SQL Database Management System ( DeveelDB ) oriented to the .NET and Mono frameworks. Being a standard SQL-99 database system, it also provides functions and procedures.

The old implementation of the system resolved functions only against their name, assuming function names were unique (a shortcut) and delegating to the function object the resolution of arguments at Run-Time.

In the new version I'm allowing the dynamic definition of functions and procedures and their resolve against a combination of name, argument number and argument types.

Anyway, I feel the algorithm I'm using now is pretty bad and I'm looking for a better one. In fact, SQL Functions allow the definition of DETERMINISTIC types (eg. Dynamic types resolved at run-time). Furthermore, they allow UNBOUNDED last parameter (eg. params notation in C#), which allows an unlimited number of arguments to be provided.

Programming languages such as Java and C# have a fast function resolving, and I'm wondering if are there generic algorithms that I can study to implement the code needed for such resolution.

Thank you all!

Antonello
  • 1,326
  • 2
  • 16
  • 23
  • So you don't want an answer in C# or Java? Java performs the lookup in native code and caches it, which is why it is fast. – Peter Lawrey Apr 29 '14 at 14:51
  • Peter, thank you for the clarification. Actually, I'm looking for a .NET solution, since the library is written in C# and the functions will still be .NET objects (those statically created by the system and those defined by users). In fact, I was more asking for the conceptual algorithm, rather than code... but if you can provide also some code (or reference) that'd be great – Antonello Apr 29 '14 at 15:02
  • You can read the code for Java in the source i.e. OpenJDK – Peter Lawrey Apr 29 '14 at 15:48
  • My knowledge of the Java internals is limited: could you point me out to the source of the function resolver entry point? Thanks :) – Antonello Apr 29 '14 at 17:18
  • You can start with the getMethod() in Class http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/lang/Class.java?av=f – Peter Lawrey Apr 30 '14 at 07:32
  • Possible duplicate of [Method resolution order in C++](http://stackoverflow.com/questions/3310910/method-resolution-order-in-c) – Paul Sweatte Apr 19 '17 at 14:15

0 Answers0