Skip to main content
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:36 AM UTC

Uniface 9: naming conventions

naming conventions

Author: i2stiller@gmx.de (istiller)

So, now I'll start a survey Laugh Is out there any preferred naming conventions of operations? As in other languages I named an operation which does some display "DISPLAY" and another one printing will named "PRINT". So an activate looks like: activate v_INST."DISPLAY"(...) or v_handle->"DISPLAY"(...) But the disadvantage is, that UnifAce editor highlights this like any other "display" statmenent. So I thought about OP_DISPLAY, OP_PRINT, OP_xyz, ... And as will all know, one drawback of UnifAce is, there is no overloading of functions. Say, there is the need for two PRINT-Operations OP_PRINT(a_parameter_typ1) and OP_PRINT(a_parameter_typ2) Okay, the only solution so far in UnifAce is two write two Operations OP_PRINT1 and OP_PRINT2   So the survey is:

  1.   how do you name operations in general?
  2.   how do you name such overloaded functions?

Any hint / comment is appreciated Smile Ingo

11 replies

Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:36 AM UTC

naming conventions

Author: i2stiller@gmx.de (istiller)

So, now I'll start a survey Laugh Is out there any preferred naming conventions of operations? As in other languages I named an operation which does some display "DISPLAY" and another one printing will named "PRINT". So an activate looks like: activate v_INST."DISPLAY"(...) or v_handle->"DISPLAY"(...) But the disadvantage is, that UnifAce editor highlights this like any other "display" statmenent. So I thought about OP_DISPLAY, OP_PRINT, OP_xyz, ... And as will all know, one drawback of UnifAce is, there is no overloading of functions. Say, there is the need for two PRINT-Operations OP_PRINT(a_parameter_typ1) and OP_PRINT(a_parameter_typ2) Okay, the only solution so far in UnifAce is two write two Operations OP_PRINT1 and OP_PRINT2   So the survey is:

  1.   how do you name operations in general?
  2.   how do you name such overloaded functions?

Any hint / comment is appreciated Smile Ingo

istiller said Hi Zdeněk, hi Gianni ... BUT But what about handles and structures? One can't pass handle and structs as part of a UIL, as UnifAce do not proper convert between string and handl/struct. ...

Hello Ingo, we don't use handles. :-) We have tried, but there are too many problems with them. So we keep using named instances, which is string and it's very easy to pass them as parameter. I don't see any benefit in handles over named-instances. All in all its always just "handle" to a component instance and since our application is quite "old", it's impossible to change everything to handle... and it's much easier to have only one approach. And as for structures... well... we don't use structs. :D We use them maybe in 2 components? Since it's quite easy (and the only way) to convert data from Uniface to json for example. But internally, we use lists and id-lists. The situation is quite similar to handles. Don't see much benefits. As long as structs has limited usage (for example it can't be passed to a 3GL component), there is no reason to use them. So, all in all... our "handles" are strings and "structs" are in fact idlists, so strings, too - we have no problem passing this as parameter to anything (be it Uniface component or 3GL or Oracle SQL or PL/SQL or anything). Kind regards, Zdeněk Socha


Author: sochaz (zdenek.socha@fullsys.cz)