Forum: Building VoltDB Applications

Post: Procedure naming

Procedure naming
kdombeck
Nov 2, 2010
I created a the following procedure

But when I call it from my Java code I have to use

client.callProcedure("UpdateCounter", .....);

which is not what I would have expected. I would have expected to use
the entire package name like the following instead

client.callProcedure("my.package.UpdateCounter", .....);

Is there a reason why when I call the stored procedure I do not have specify the fully package qualified name?
There were two options.
jhugg
Nov 4, 2010
With the qualified name, you can have identically named classes in different packages representing stored procedures in VoltDB.

With the simple name, you need to have unique simple class names across packages, but:

1. It makes the set of stored procedures that a VoltDB cluster exposes to the world much less implementation dependent. Via your stored procedure set, you essentially define a "Data API" to your clients that doesn't care about java implementation issues.

2. It cuts out a lot of boilerplate and reduces typing, often making code easier to read.
Whether or not you agree with the decision, those are our reasons. It could have gone either way.

As people start building more and more complex (and multi-tennant VoltDB) applications, we expect we'll need to introduce some kind of name-spacing or logical separation or procedures. It probably (but not 100% sure) won't look like java package names.