What are the advantages and disadvantages of using AE or SQR?

Summary:
What are the advantages and disadvantages of using AE or SQR?

Answer
AE advantages:

AE can be called by Peoplecode from a page.

Built-in tools (meta-SQL) allow you to write SQL statements that refer to “all the fields of this record” or “join all the keys shared by these two tables.” This is handy when record layouts change; you don’t have to edit every select or insert.

Built-in tools (temp tables) to run the same program many times on separate portions of your data. Processing takes less clock time.

Repeatability and restartability – this takes a special style of programming. If you do all your processing in temp tables, not only should your SQL run faster, but your output doesn’t reach your permanent tables until you’re sure the program was successful. So, if it abends, you don’t have to worry about half-updated tables. Using state records for your internal variables aids debugging abends and restarting in mid-stream after an abend.

You can write different versions of a section of code, and AE will choose among them based on current date, type of database, or market. This feature is obviously for developers at Peoplesoft Corp to ship the same products worldwide, but it could be useful for us.

Built-in debugger.

Easy communication with the process monitor using the message catalog.

AE disadvantages:

Programming technique is very restrictive. Think of Peoplecode, where you’re only supposed to do certain things in FieldEdit and other things in FieldChange. And it’s easy to access fields in the record of the Peoplecode, harder to access fields in other records or rows of the buffer, still harder to access data outside the buffer. AE can be worse.

You can only view one SQL statement or one block of Peoplecode at a time. It’s like programming or debugging through a keyhole. And be careful printing your program – the print routine leaves things out.

Because it’s awkward to use global variables and tempting to use meta-SQL, you’ll want to do as much as possible in each SQL statement. If you do, your SQL will get very complex, hard to understand and maintain, and potentially buggy. We don’t always remember all the effects of a join – not only do we bring in columns from other tables, but we also restrict our selection and/or multiply our rows based on the matches (0, 1, or many) from those other tables.

Awkward control structures make it hard to follow program logic.

SQR advantages:

Wonderful printing functions and barely adequate file I/O – both absent from AE.

Easy to use internal variables and even arrays.

The option to choose our own editor, source control system, etc. Control over the format of our code (AE editors tend to rearrange things).

If SQR runs on the client or the command line, it can communicate with the user in free form, including taking user input.

SQR disadvantages:

No debugger.

A program must be completely within its source file. Include files are merged in by the compiler. AE can call subroutines within other programs.

Great similarities and small differences make it hard to switch back and forth between Peoplecode and SQR.

*Questions excerpted from ITToolBox.com*

Disclaimer: Contents are not reviewed for correctness and are not endorsed or recommended by PeopleSoft-Planet.com.

Write your comment