When Prototype changes, can we use binder source?.

370 pts.
Tags:
AS/400
AS/400 Query
When Prototype changes, can we use binder source?. I mean when procedure prototype changes ( parameter list changes), can we use binder source?. I guess no, we have to recompile and update all programs uses that procedure. pleae confirm

Software/Hardware used:
AS/400
ASKED: May 28, 2010  10:15 AM
UPDATED: May 29, 2010  6:39 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

<i>…when procedure prototype changes ( parameter list changes), can we use binder source?</i>

Yes — maybe.

This is essentially what binder source is used for. This is a major purpose of binder source.

You would update your binder source to add an additional set of definitions with a new signature. When you update your service program, it then will have two signatures and two sets of procedure interfaces. You add one or more new procedures to your service program and these new procedures will handle the new parameter lists.

The old signature would connect your existing programs to the old procedure interfaces. If you change an old program to handle a new procedure interface and recompile the program, it will bind with the new signature to the new procedures. If you don’t recompile any programs, they will continue to use the old procedure interfaces.

Now, if you <b>replace</b> a procedure interface with a new one and the change involves adding, removing and/or changing parameter definitions, then existing programs cannot call that procedure successfully.

In that kind of case, binder source doesn’t always help. You changed the interface. You can’t expect programs to magically start passing different variables.

But let’s say you have a procedure named getAddress(). It accepts a CHAR(10) Identifier value and returns a CHAR(25) Address value. And now you need to handle CHAR(50) address values.

You can create a new proc named getLongAddress() that is copied from your original proc and has the new long Address parameter definition. You can also change the old proc so that it simply calls the new proc — it could return a truncated CHAR(25) value back to programs that call it. All programs that call getAddress() would continue to work; they just wouldn.t get the full Address value. Those programs could be updated over time to use the new proc.

Your old proc still works. It simply acts as a conversion step for old programs. Your binder source would keep the old procedure definition and you would add the new definition to an additional signature.

That’s one potential way of changing parameter definitions with binder source. You have to choose whether it can work for your programs or not.

Tom

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Alicsc
    Thanks Tom..
    370 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following