Search My Blog


Thursday, October 8, 2015

STD Foundation Classes - PowerBuilder to Java Interop!

** New Feature **

STD Integrated Framework

PowerBuilder to Java Interop!

    With the release of the new STD Integrated Framework for PowerBuilder and Appeon (version 2015.4.0.43 and higher), the framework was enhanced to deliver a new feature -  PowerBuilder to Java Interoperability. Now the ability of a PowerBuilder Classic based application to "consume" a Java class and call its methods is even easier than before and now encapsulated into the STD Integrated Framework for the PB developer!

    The PowerBuilder IDE since early 2000 has had the ability to call EJB (Enterprise Java Beans) due to the introduction of the Java based Application Server by Sybase named EAServer. With EAS came the ability to call a remote EJB in any J2EE based application server by using RMI (remote method invocation) that was exposed as the "Home" interface. The EJB Home Interface though can be either local or remote in nature. Thus when dealing with a native MS-Windows PB application that has Java classes deployed along side of it, we can use the local Home interface to interact with it from a PB application. This is, as long was we expose the Java application as an EJB (that is .. follow the EJB construction rules).

   When the Java developer creates a Java class, he/she can also create a Home interface or what PowerBuilder would refer to as an EJB "proxy". A Proxy is a Class/Method signature that allows PB to treat the Java application as a "bean". According to the generally accepted definition of a Java proxy is as follows: "A proxy class is a class that implements a list of interfaces". Since CORBA (Common Request Object Broker Architecture) support was added to PowerBuilder a long time ago - PB understands "proxies" very well. So if we can get your PB application a list of proxy classes it needs to deal with an EJB, it can then communicate with it. First of all, we can build a Java Class and then build a HOME interface for that using your standard development environment - even "notepad" for us poorer folk. Once completed, you can just compile the EJB class and its Home class using the JAVAC compiler, as follows:

  Now that we have an EJB and a Home class to serve as a "proxy" road-map for PowerBuilder, we can use the Classic IDE to build the necessary interfaces for us in a PowerBuilder Library (PBL) to use in our application. To perform this step, we need to call on the IDE's Project Painter to help us with this task. When creating a new project, we can then select EJB Client Proxy option. This will build a a PB Project object that can build all the necessary proxy interfaces for you. All we need to do is specify the Java Bean  class and its HOME (interface) class to the proxy painter. for example:

  Once the EJB Client Proxy project is properly configured, the next step will be to run the project, as follows:

    Now that we have the "proxies" required for the Java interface (Home) class, we can now instantiate the EJB by using its proxy in your PB Application. The only challenge beforehand, is loading the Java Virtual Machine (JVM) and activating its JNI (Java Native Interface) JDK to inter-operate with your Java EJB. Luckily, this is where the STD Integrated Framework steps in to help you. All you need to do is call a new "of_create_instance" method in the Application Controller supplied by the framework and it will perform all of the JVM the house keeping for you including: loading, reusing, unloading, garbage collection, etc of the PB to JVM infrastructure! So now the PB Developer can just concentrate on using the EJB's methods & processes, for example:
  To make this easier to follow, STD have created a working example of this PB to Java mechanism for you to examine, learn and move forward with your organizations Java interoperability within your PowerBuilder project. You can download the PB2Java example built from the STD Integrated Framework by clicking here!

  Coming soon ... Consume the same EJB methods in your PowerBuilder built Web Services using the STD WebService Framework and then extend your EBJ interoperability to both Appeon Web and Appeon Mobile applications as well!

Regards ... Chris


Wednesday, October 7, 2015

STD Foundation Classes - Application Performance Profiling!

** New Feature **

STD Integrated Framework

Application Performance Profiling!

    With the release of the new STD Integrated Framework for PowerBuilder and Appeon (version 2015.4.0.43 and higher), the framework was enhanced to deliver a new feature - Dynamic Application Profiling. The the Application Profiling feature has been available to native PB applications for many, many releases - but, only when running the application from the PB IDE or when a developer remembered to code the TraceXxxx () commands in their application. The framework's Dynamic Profiling feature though can be activated by the application user, developer, QA or Support specialist at anytime by selecting the keyboard CTRL+SHIFT+F2 keys in succession. The feature is also self contained and ready to use at a moments notice with no programming required by the developer what so ever!
    The Profiling feature can be activated by either: a) launching the frameworks DEBUG/SPY feature ( CTRL+SHIFT+F1 ) or b) using the direct short-cut ( CTRL+SHIFT+F2 ). In the case of the Debug/Spy, the application user will now notice a new command button located on the lower right-hand side named "Profiling...". When pressed, this command button will open the new Profiling dialogue: 
Example of starting Application Profiling from the DEBUG/SPY dialogue!
    The Profiling dialogue built into the Integrated framework contains all the options to fully engage all of the PowerBuilder Application Profiler options normally available from the IDE. Once activated, all the application user needs to do is: a) select what aspects of the application they would like traced; b) provide a name for the trace [which will appear on the various reports] and c) select/set a trace file name. Once these items are completed, Application Profiling can be started by selecting the "Profile ON" command button, as follows:
Example of the Integrated Framework's built-in Profiling dialogue in action!
    Once the Application Profiling has been requested, the Application Profiler dialogue will close but the framework will remember all the specific settings that were selected  prior to activation. Both these settings and the trace file itself will default to the application .EXE's current folder (unless a specific path has been supplied in the Trace File Name area - for example:  c:\temp\orderentry.pbp). The profiling session and thus trace will be automatically finalized and closed when the business application is exited or the application user can finalize the Profile Trace at any time by again pressing ( CTRL+SHIFT+F2 ) or launching the Application Profiler from the DEBUG/SPY feature. When presented to the application user with a trace in-progress, the dialogue will present the lower left-hand command button with the option "Profile OFF". Pressing this command button will immediately finalize the Profiling session and make the .PBP (PowerBuilder Profile) file available for processing - however, the application user may continue to run the business application further and even start more dynamic application profiling session in another part of the application!
Example of finalizing the Application Profile at any point in the application!

   When the Application Performance Profile file has been created & populated, the file can now be sent to the application developer. The PowerBuilder developer will then launch the PB IDE and run the Profile Reporting Tools by selecting File=>New from the IDE's main menu. In the corresponding dialogue the developer can now choose one of three Profile Viewing options:  Class, Routine or Trace, as follows:
Example of selecting an Application Profiling viewer!

    Once a reporting view is selected, the next step will be to: a) point the  viewer to the .PBP trace file and b) point the PB IDE to the application target used to manage the application source code for your application;s project, as follows:

    From this point onward, the PowerBuilder developer may now drill down through the various viewer options to "zero in" on the problem performance area of the application. The three viewers will contain a plethora of information about the application's execution. Here are some examples of the viewer reports that you may generate:

   Hopefully, this detailed performance trace information will allow the PB developer to pinpoint latent code and then optimize the application code for maximum performance and minimum user processing delay. The nice thing about building your PB Applications from the STD Integrated Framework is that the Application Profiling feature is always a keyboard stroke away - even in Production. Like the old American Express credit card commercials that said "don't leave home without it" ... the Application Profiling feature has a similar statement  ... "don't deploy without it" and "look ma, no hands (ahhh ... coding )!

Regards ... Chris

Tuesday, October 6, 2015

Web & Mobile Introspection - New Debug Feature!

** New Feature **

STD Integrated Framework

Web & Mobile Debug Introspection

    With the release of the new STD Integrated Framework for PowerBuilder and Appeon (version 2015.4.0.43 and higher), the framework was enhanced to expose the Debug/Spy feature that has been available to native PB applications for many releases. The framework's Debug/Spy feature is normally activated by the application user selecting the keyboard CTRL+SHIFT+F1 keys in succession. This key sequence informs the framework to display a dialogue that shows the application user the various PowerBuilder classes in vogue for the dialog in focus.

      In the Web Browser and especially in the Mobile world, the keyboard CTRL+SHIFT+F1 sequence is either not recognized or physically impossible on a virtual keyboard. The latest STD Integrated Framework has been enhance to work around these limitations. This feature of course is most valuable to the Application Developer and Quality Assurance personnel to introspect the active classes with a business dialogue. This can be key pieces of information in isolating what components are active within a problem area of an application. However, given hard to pin-point issues in production - even the application business user can be instructed to use this feature to collect critical information about a problem area in the application.

    For the Web and Mobile world, the first step in activating the Debug/Spy feature is logging into the AEM (Appeon Enterprise Manager) console for the related Appeon Server that is serving up the Web and/or Mobile application. Within the AEM, navigate to the Application => PB Features => INI settings area of the console. Once located, select your Web/Mobile application's INI file. This file of course will be the one you were supplied with by the STD Integrated Framework. Within the INI file, scroll down and locate the [DEBUG] section and within that area, the "Debug_Mode" keyword. Most likely, the current value assigned to this keyword is "N". You will need to change that value to "N", as shown:

    Once the "Debug_Mode=Y" value has been set, restart your Appeon Mobile or Web based application. You should now notice that the Integrated framework has automatically exposed two extra menu features: a) a new Menu Item entitled "Debug" located to the far right hand side of the horizontal text menus and b) a new "Debug" icon appearing to the far right-hand side of all related toolbars. Selecting either menu item or toolbar item will direct the framework to display the following Debug/Spy dialog:

     The Debug/Spy icon on the upper menu or its toolbar will direct the Debug/Spy to display the components involved around the Main or MDI "Controller" dialogue. The Debug/Spy icon on the lower menu or its toolbar will direct the Debug/Spy to display the components involved around the Main, Pop-up, Child or MDI_Child dialogue (depending on the application style being used) being displayed.

     On the Mobile Android or iOS equipped devices, the menu item text or their toolbar icons are displayed as drop downs available from the AWS (Appeon Work Space) shell when running your PowerBuilder application. Within the AWS, the new "Debug" and icon are displayed similar to the Web Browser above. Again, selecting either the menu text (debug) or its associated debug icon will engage the Debug/Spy framework dialog, as follows:

   Once the Debug/Spy dialogue is activated, the application user can copy, print and/or email the component diagnostics to the appropriate support personnel for further analysis. It should be noted though that the Tracing and Profiling (another new feature) are only available to native PowerBuilder applications and thus those options are disabled in the Web and Mobile environments.

    I hope that this new innovative framework feature is of significant help when trying to analyze problem areas of your PowerBuilder and/or Appeon applications.

Regards ... Chris

STD Foundation Classes - OrderEntry Application Updated!

** Hot News **

STD Foundation Classes

Example OrderEntry Application (2015-R2) Released

  The example OrderEntry application that is built from the Software Tool & Die PowerBuilder & Appeon based frameworks has been updated to use the latest version of the Integrated framework (v2015.4.1.45) and the latest version of the Web Service framework (v2015.3.1.52). With the two frameworks enabled, the OrderEntry application demonstrates how PowerBuilder and Appeon developers can fully extend the functionality of their business applications to support native, cloud, web and mobile development & use from one code-line!

  To download the latest example, please visit the STD Foundation home web site located in the SourceForge online community. Then select the OrderEntry application 2015-R2 latest release from here!

Note: Please read the "ReadMe.doc" file for specific deployment information.

Regards ... Chris