[DGD] Terms and sharing utility code between objects

Petter Nyström jimorie at gmail.com
Wed Feb 7 23:39:55 CET 2007


Hello list,

I was thinking about the different ways you can share utility code
between objects in DGD, and was wondering if one was preferred over
the others. (By you.)

So first I should probably clarify what I mean by utility code.
Shortly, I mean pure programs that have no global variables. (If you
get what I mean, can you also tell me what is the proper term?)

The approaches I can come up with are:

 - #include the program into the objects that need its functionality.
 - Access the required functionality from the defining program with
call_other().
 - Inherit the program and access the functionality locally.
 - As a special case of the above, bag all utility functions together
and put them in the auto object.

What is your preferred method for getting utility functionality like
this into your objects?

I think I have used them all to some degree at different points.
Lately I have been trying to inherit the functionality I need. And
actually, something that I am even more interested in at the moment,
is if there are some official terms for inheritables that hold data
and those that do not? I have been struggling to find words to
differentiate the programs I inherit to make up the object dataspace
from the ones I just inherit to get access to some utility functions.
Any suggestions?

Regards,

Jimorie



More information about the DGD mailing list