Monday, July 10, 2017

4 Key advantages of Application Package over traditional Functional Libraries

Better Organization of Code

Through my experience they do not have any significant performance impact but they do add an additional layer of organization that funclibs cannot provide.
Assume you are developing a self-service application named ePromotion so this is how you can organize your PeoleCode using Application Package:
You can create one package named EPROMOTION for the whole project, and then add the classes within it as below:

  1. ePromoUtility
  2. ePromoConstants
  3. ePromoNotifications
  4. ePromoUserLists

Coding Practice

They enforce better coding practices. For instance, in regular peoplecode (funclibs, etc), variables are not required to be declared before using them, but in app classes they are - thus eliminating bugs introduced by typos. Variable scope is much more explicit and easier to understand / follow as well. 

Avoid Redundant Code

Also an App Class can extend an existing App Class thus allowing you to leverage the original code without copy / pasting it. All of this is part of the advantages of Object Programming. 

Portability is another aspect, being able to pull up the App Package and go through it without having to dig through Component Record Field PCode or Record PCode. Just import your package/class, instantiate and call. Keep all the grunt work in the app package.

Think Time PeopleCode

Biggest advantage is that it is think time PeopleCode versus "regular" PeopleCode which is run time. As an example, if you have functions in a funclib record and you call a function in your PeopleCode, at run time (when you go into a component) and run a trace, you will find that 1) Your function is being brought in and 2) All the other functions are being brought in even though they are not going to be called. In an App Package, the code is imported, but no call to the code is made unless needed. That means that as you go into your component, The App Package is not brought in until called. You can construct code so that you only instantiate your app class and code as needed. Ex., If True then &Variable = Create AppPackage:AppClass(); &Variable.DoSomething(); else end-if; If true then we bring in PCode else we do not. 

Another way to visualize think time versus run time PeopleCode is to go into a component / page. Make a change to regular PeopleCode and save. Now if you navigate or try and save the component, you will get a data integrity error and have to re-navigate back to where you were. With think time, you go into a component / page. Make a change to your app package PeopleCode and save. No data integrity error on your page as the code is brought in at think time and thus no error.

You can gain in-depth knowledge on Application Package with a live example by just paying below amount

I have a complete session in two parts which explains:

  1. Advantages of using application packages over functional libraries
  2. Elements of Application Package and how to write PeopleCode using them
Below are the links to videos in YouTube.

App Package Part 1
App Package Part 2

Click here to know how it works

However, if you want to save money by purchasing whole module instead of in parts then visit this page to get more details PeopleSoft Functional and technical online training


  1. This comment has been removed by the author.

  2. videos in youtube were remove

  3. Hi Jakson,

    Videos are there but they are private and you get access after purchasing them