Sponsored by Powered by
Moving at the Speed of Change May 2015
Charlotte PowerBuilder Conference
Getting started with the
"Integrated" STD Foundation
Classes
For PowerBuilder, Appeon Web & Appeon Mobile
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Email: [email protected] • Blog: http://chrispollach.blogspot.ca • PBDJ: http://chrispollach.sys-con.com • LinkedIn: http://ca.linkedin.com/in/chrispollach • SourceForge: http://sourceforge.net/projects/stdfndclass • STD: http://www.softdie.ca
2 Quick Start
Framework Workshop Tour!
By Chris Pollach – President: Software Tool & Die Inc.
Ottawa, Canada
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
3 Framework Architecture Goal
PB / Appeon based Application
or PB Classic Web Service (Developer stays focused on:
Business Functionality, Requirements,
Maintainability, Usability, Human Interface,
Flow, etc)
Encryption Transaction
Management Connectivity eMail
Performance Recovery Error
Handling Logging
Deb
uggin
g
Num
erical
Exten
sions
Ad
van
ced
Co
ntr
ols
Dev
ice
Co
ntr
ol
Framework
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
4 1992 – The beginning
Refactored for
IIs Web
Services
Refactored for
WebForms,
Winforms & WPF
Refactored
Code & open
sourced
Refactored
Code for
Mobile
PocketBuilder
Distributed PB
Initial version
(Free with
PowerGuide)
R1
1992 1995 1998
2000
R2 R3
EAServer
2003
R4
Appeon Web
Refactored
Code for
Web
2007
R5
R1 R1
R1
R1
R2
Refactored Code
for EAS 6.x &
Application
Server Plug-In
2008 2014+ 2013
R1 Appeon
Mobile
2012
R1
Core
EAS
IIs
Web
Mobile
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
5 Moving Forward Future…
New release - IIs
Refactored Code for
Appeon and PB
Classic (only)
2013 April June Q3
R6
2015 2016+
Core
EAS
IIs
Appeon Web
Appeon Mobile
(PocketBuilder)
Integrated
March
REMOVED
Webforms
PocketBuilder
WPF (PB.Net)
Appeon 6.5
Mobile 1.5
2014
Appeon
2013
Appeon
2013R2 Appeon
?2016?
PB ?15?
Classic
? WCF ?
PB Classic - Web Services
New release EOL
PowerBuilder .Net + Classic Appeon
2015
R1
R2
R1
R2
R5
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
6 Hosted on the SourceForge website! http://sourceforge.net/projects/stdfndclass
Download Statistics for 2014
• Frameworks, Examples, Utilities (all up) – 4,022
• Framework downloads
• Integrated – 1,486
• Web Service (IIs) – 526
• Examples – 1,412
• Utilities – 598
STD Foundation Classes
Old Frameworks: • PB Classic – (Integrated framework)
• Appeon Web – (Integrated framework)
• Appeon Mobile – (Integrated framework)
• PB.Net – (discontinued 2013) - 64 downloads 2012/13
• EAServer – (discontinued 2013) - EOL
• PocketBuilder – (discontinued in 2011) - EOL
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
7 STD Integrated Framework
Feature Highlights 1. Integrated Core Code
2. Performance Monitor (System Console)
3. Support for Appeon Mobile 2.0
4. Support for Appeon Web 7.0
5. New Logging options (AWS)
6. CPU Binding (Multi-core)
7. New Example applications (iOS)
8. Updated documentation
(via Visual Expert – Thanks Novalys!)
9. CLF Web support
10. And …. Much, much more!
Availability
1. Integrated GA version (Sept 16, 2013)
2. Integrated Service Pack #1 (Jan 12,
2014)
3. SourceForge:
http://sourceforge.net/projects/stdfndcl
ass
4. Contact: Chris Pollach …
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Download the “Integrated” Framework from SourceForge • Unzip the contents into a separate work area) • Migrate the Framework (PB 12.1) to PB 12.5 or 12.6 (if
required) using the default WS & Target. • Create a new development folder for your PB Application! • Create a new WorkSpace for your PB Application! • Copy the compete Images folder to your work folder. • Copy PBL’s from the framework work area to your WS. • Copy the INI from the framework work area to your WS. • Copy the WorkArounds PBL from Appeon Developer.
Note: Make sure that you have the correct PB version!
8 Getting Started – WorkSpace
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Create a PB Classic (native) Target Application
• Include the following minimum Libraries: STD_FC_PB_Base.pbl
STD_FC_PB_Base2.pbl
STD_FC_PB_Base_e.pbl
STD_FC_PB_Appeon.pbl
9 Getting Started – Win32 Target
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• ap_ - Application class • dw_ - DataWindow Object class • fn_ - Function class • mu_ - Menu class • ns_ - Standard Non-Visual User Object class • nc_ - Custom Non-Visual User Object class • vs_ - Standard Visual User Object class • vc_ - Custom Visual User Object class • wn_ - Window Object class
10 Library Introspection?
Note1: Base2 library is for native PB applications only - not Appeon!
Note2: Base_F/S are for French & Spanish support respectively.
Note3: STD_FC_Appeon library is only to allow the Appeon code to compile!
(fake shell)
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Add a new target to your workspace! • Use the existing Application object! • Include the following minimum Libraries: STD_FC_PB_Base.pbl STD_FC_PB_Base_e.pbl Appeon_Workarounds.pbl
11 Readying for Appeon Mobile / Web!
Do not include: STD_FC_PB_Base2.pbl
STD_FC_PB_Appeon.pbl
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
For example: German
• Copy English extension PBL (Base_E) to BASE_G
• Rename classes in BASE_G PBL to xxxxxxx_G
• Translate the text in the BASE_G classes
• Add the BASE_G library to your PB Target(s)
12 Supporting more Languages! ∞
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Replace all your Application class’ Instance variables with Framework equivalents: SQLCA => ns_tr_master
SQLDA => ns_dda_master
SQLSA => ns_dsa_master
Error => ns_error_master
Message => ns_message_master
13 Mapping your Application to Framework!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Declare Application Controller as a Global Variable nc_app_controller_master go_ac go_ac = Create nc_app_controller_master (open)
• Redirect all events from your Application Class to the Controller’s go_ac.event oe_open (commandline) go_ac.event oe_close ( ) go_ac.event oe_idle ( ) go_ac.event oe_systemerror ( )
14 Instantiating the “Controller”!
Must use
this name!
Demo: Run App
& Check out the
.LOG file!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Inherit from nc_app_controller_master • SaveAs what ever name you like
ie: nc_ncpbug_controller
• Change your Application class to instantiate new Controller! • Let review the Controller’s properties!
Change Display name Change DW Title name Change Release # & Date Use Logon / Splash MDI Yes/No etc
15 Building your Controller!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
16 System Console (Performance Monitoring)
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
17 Environment Tracing & Logging
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
18 Hiding the infrastructure
ApMgr
Window
Resize Linkage
State
Registry
Your
App
PFC
Controller
Window
Logging Debug
State
Update
STD FC’s
Need to know the components
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
19 Framework Comparison
+ PFC + STD FC’s
Your Application
007
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
20 Originally written in 1992 but with five major releases since then!
Like the PFC but ...
Service/Feature PFC STD
Linkage Yes No
Resize Yes No
System to System No Yes
DNA Checking No Yes
SMTP No Yes
FTP No Yes
Active Directory No Yes
Property Programming No Yes RAD
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
21 And the Innovation continues!
Framework Comparison - Continued
Service/Feature PFC STD
MIMD No Yes
Web CLF No Yes
PowerShell No Yes
Multilingual No Yes
Mobile No Yes
TCP/IP No Yes
Multithreaded No Yes
Logging No Yes
Debugging No Yes
… CTRL+SHIFT+F1
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Inherit from wn_controller_master • SaveAs MDI, MDI_Help or MAIN window type Supports SDI, MIMD or MDI interfaces Add a language suffix – “_e/f/s/?”!
• Revise the Application Controller to use your Controller window! Make sure you set the Images folder name in the Application
Controller! Note the “oe_documentation event”!
22 Building your Controller Window!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Inherit from mu_controller_master
• SaveAs what ever name you like
• Revise the new Menu descendant to your needs. Hide menu items you will not need
Add menu items to that will drive your application's functionality!
Note the “oe_documentation” and “oe_postconstructor” events!
Associate your Controller Menu to your Controller Window!
23 Building your Controller Menu!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Create an Appeon Project
Use the Appeon Developer Wizard!
Point to your Appeon PB Target
Use the DEMO Database
Map your INI file
• Deploy!
24 Deploying to Appeon Web & Mobile!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
Ap
peo
n D
evel
op
er
PowerBuilder
Classic
IDE
Window
Control DataWindow
Menu User Object
Library
PBL
Application
C++
Win32
EXE
C#
.NET EXE
Deploy ...
Bu
ild
/Test
No
PB
VM
(ru
n-t
ime
DL
L’s
)
C#
Web
Service
C#
Web
Service C# .Net
Web Service
IIs Application Server
PBVM Required!
C# .NET
Assembly
PBVM Required!
WWW
O/S
Native
25 PB / Appeon Ecosystem
AWS HTTP
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Inherit from the base Sheet “wn_main_master”.
• SaveAs whatever name you require – plus “_e/f/s/?” (for example) a Product List window.
• Modify your default “MDI Menu” to add a new menu item that will open use the fn_open_sheet_window () method! Note: Try not to use the traditional PB Open / OpenSheet /
OpenUserObject / etc methods. Instead, use the framework “fn_” equivalents ()!
26 Creating a Data Enabled Window!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Add any Framework control that starts with VS or VC! Do not add standard PB controls to your Window / User Objects!
• Lets add a DataWindow Control (vs_dc_list_master)! • Build a Product list DW Object & attach to the DC. • Add code to Connect, Retrieve & Resize Use the Frameworks methods for this! Use the “” method to validate!
• Introspect the DC’s properties! • Deploy to Appeon Web & Mobile and test your application!
27 Adding Framework controls!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Copy the “dw_messages_e” DWO from the “STD_FC_PB_Base_e.pbl” library into
your Application’s PBL . • Add a new Message Number & Text.
ie: “Welcome to the NCPBUG application!” Use “of_messagebox” method to deliver your message! (hard coded approach)
• Use the Application Controller’s methods for your message text! of_get_message () (dynamic approach & language independent!) of_messagebox ( )
• Passing Message Values Structure “sr_pass_data” (For passing in substitution values!) Change message text to “Welcome to the %S1 application!”
28 Creating & Using your own Messages!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Add a new Message Number & Text to “dw_messages_e”. ie: “The NCPBUG application logged user ‘%S1’ in from device:
%S2!”
• Use the Application Controller’s methods for your message text! Structure “sr_pass_data” (For passing in substitution values!) of_get_message () of_write_log ( )
29 Creating & Using your own Logging!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Create a Product Update Window Inherit from “wn_main_master”
• Create a Product Update Menu • Inherit from “mu_main_master”
SaveAs your Product Update menu Enable/Disable menu items as required Add code to the “oe_postcontructor” event as need Add new menu items as need.
• Create an updatable DW Control Use “vs_dc_detail_master” Check out its properties
• Use the Parent window’s transaction Management Check out the “of_set_updatable” method to register a DW/DS for automatic updating! Note: Register the DW/DS’s in the order they need to execute (2nd parm of “of_set_updatable” method)!
30 Utilizing Transactional Data!
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
• Check out the OrderEntry example application! • When utilizing any framework object class – check out all of its
properties! • Use the built-in INI support - not the registry - for fully
application environment transparency! • Check out the Multi-Threaded example application! • Check out some of the PB utilties built from the framework • Stay tuned for PBTV and Educational videos coming soon!
31 Going Further Into the Framework
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
32 Web look & feel - supports CLF
GOC - Common Look & Feel Standards …
http://www.tbs-sct.gc.ca/ws-nw/index-eng.asp
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
33 Complimentary Environments
Web Service
Command Shell
OCR Imaging
Web Service Framework
Log
Spell
Check
WSDL
Win32/64
WDSL (proxy)
Integrated Framework
PDF ??? ...
Application Server
Appeon
Web
WDSL (proxy)
Integrated Framework
Appeon
Mobile
WDSL (proxy)
Integrated Framework
LDAP
Integrated Framework + Web Service Framework =
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
Framework Summary & Future!
Summary
• Like the PFC • Light weight • Fast • Stable • Designed for RAD+ with production
stability & performance in mind. • PB & Appeon Web/Mobile friendly • Small foot print! • Always advancing with technology
Future
• More RAD features • Neat O/S tricks • More integration with the Web Service
framework • Emulate new Controls (ie: Ribbon Bar,
Collapsible Panes, etc) • Web Extensions • Mobile Extensions • Support for new PB & Appeon features • …
34
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
Questions?
35 Q&A Session
Charlotte PowerBuilder Conference Moving at the Speed of Change May 2015
Have you hugged your DataWindow today? 36