ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Arrays as parameter in RPLGE

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: Arrays as parameter in RPLGE

    Originally posted by BenThurley View Post
    You make that sound easy but it can be a pain if you've got hundreds of programs calling your procedure. All of the programs become inextricably linked making go-lives pretty laborious and suceptible to mistakes. This is known as "high coupling" where different modules have a high dependancy on one another. It is the opposite of "low coupling" which is the more desirable.

    1) It is easy

    2) Changes that only require recompiles are exponentially easier than having to make changes to eash program.

    3) I pointed out that a third parameter could be added that would negate the need for any recompiles in the second program, even if new fields were added to the data structure of the first program.

    4) The example you give misses the initial problem. The problem isn't getting the original data into the array. It is dealing with a list of data already in the array, and passing that list of data to another program.

    5) You do realize that the original post you made on this requires a program modification if something has to be changed, like the number of entries in the array? Otherwise, your program requires a recompile, just like whaat I posted. I'm not sure why you would post something that sets up a program maintenance nightmare, then go on a long tirade about how laborious recompile only designs are.
    Last edited by MichaelCatalani; August 25, 2010, 10:26 AM.
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

    Comment


    • #17
      Re: Arrays as parameter in RPLGE

      Originally posted by mjhaston View Post
      I wouldn't say it sounds easy if it takes 5 posts to explain it
      It took 5 posts due to a size limitation of each post. That can happen when dealing with posting code.
      Last edited by MichaelCatalani; August 25, 2010, 10:27 AM.
      Michael Catalani
      IS Director, eCommerce & Web Development
      Acceptance Insurance Corporation
      www.AcceptanceInsurance.com
      www.ProvatoSys.com

      Comment


      • #18
        Re: Arrays as parameter in RPLGE

        Originally posted by MichaelCatalani View Post
        5) You do realize that the original post you made on this requires a program modification if something has to be changed, like the number of entries in the array? Otherwise, your program requires a recompile, just like whaat I posted. I'm not sure why you would post something that sets up a program maintenance nightmare, then go on a long tirade about how laborious recompile only designs are.
        Have a read of the thread again and all should become clear.
        1.
        regu400 asks if it is possible to have an array of records as a parameter.

        2.
        I effectively posted that it is.

        4.
        I highlight some of the drawbacks of the solution I posted in 2

        5.
        You say that it's no biggie and you should just recompile everything.

        13
        I reply to you and explain why relying on recompiles isn't always a good idea and provide an alternative method. You are correct in saying that the example is doing the opposite in retrieving an array rather then sending one but I think the example still serves it's purpose. You could write a similar API to send the array, although depending on what is actually going on you might choose to do it differntly e.g. save one record at a time. Only the original poster will know that for sure.

        14
        I explain another benefit of encapsulation.


        All of the points I make are based on personal experience. If you read them again you should find they are not contradictory but more a case of the short answer followed by a bit of advice.

        Man are you easy to wind up!
        Ben

        Comment

        Working...
        X