× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Steve,

A reflection API would allow querying of an object to retrieve it's
interfaces and the parameters for those interfaces.  For example I can
retrieve a list of all procedures exported by a service program using the
List Service Program Information API.  However, there is no API that lists
the parameters of an exported procedure.  Without that list a program can't
make a blind call to it.  In your example I'd like to be able to call an API
to find out what GetGlobalVariable was going to return.  A packed decimal
nine digits long with two decimal places?  A C style null terminated string?
A date?

One example of a use for a reflection API:  Generate a Command/OPM program
proxy pair for any service program procedure.  At the very least this would
be useful for testing the service program.

Another useful example:  Get rid of seperate prototype definitions as a
requirement for using a service program.  Generate a prototype source member
for all exported procedures 'on the fly' with a precompiler.

Java supports this.  I can make a call to a procedure on a java object
without even knowing the name of the procedure or the types of it's
parameters.  It's all done through a reflection API.  Very cool.  A lot of
functionality in Java relies on reflection.

I agree that exporting variables by themselves is a 'bad thing'.  As you
described you'd want to export getter and setter procedures for the
variable.  But it would be better if the variable type required by a getter
or setter procedure was also exported as part of the procedure export.

Paul

-- 
Paul Morgan
Senior Programmer Analyst - Retail
J. Jill Group
100 Birch Pond Drive, PO Box 2009
Tilton, NH 03276-2009
Phone: (603) 266-2117
Fax:   (603) 266-2333

"Steve Richter" wrote
>
> what are the reflection APIs?
>
> on the broader topic of exporting of variables, isnt it always better
> for a module to provide a set of exported procedures that allow
> controled access to a global variable in a module?
>
> Such a procedure, like "GetGlobalVariable" would make the global
> variable accessible to any other procedure or program.  not just to to
> procedures within the same service program.
>
> -Steve




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.