× 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.




Question - whether you change the number of parameters or the component of
a single parameter, surely ALL programs that call the single/multiple
parameter program MAY need to be retrofitted for the change - depending
upon what that change is? In other words, some analysis will need to be
done either way.

You're right, though I'd like to draw attention to the words "depending on the change" in your paragraph.

If you're careful to not change the attributes of existing parameters, and you're careful to always add the new parameters to the end of the list, and you're careful to make all new parameters optional, then you can avoid needing to recompile the callers (unless, of course, they require teh added functionality.)

Granted, you can do the same thing with a data structure as well, but you need meta information (either in the DS, or passed separately) that describes how long teh data structure is, so that the program that receives the parameter knows which version of the DS it needs to work with. That is, in fact, how IBM's APIs work.

However, my point (made in a previous message, but perhaps without due emphasis) is that it's EASIER to do that with single parameters rather than all parms together in one data structure, because you don't have to pass the extra meta-info, you can use the %parms BIF instead.

The other advantage to the single parm solution comes when you need to change an existing parm instead of adding a new one to the end. With the single parm solution, you can lessen the impact because only callers that actually use that parm are affected -- whereas with the DS solution, if you make a field longer or shorter, it changes the whole DS, and therefore impacts all callers.

The goal is to eliminate the need for retrofitting in as many circumstances as possible -- and that's why I don't like data structures as much as parameter lists. At least, as a rule of thumb.

There are exceptions to every rule, of course.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.