PBNI - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

PBNI

Description:

PBNI is a standard programming interface that allows ... C IDEs/Compilers. Visual C (6.0 and .NET ) Borland C Builder. GNU gcc. Include Directory ... – PowerPoint PPT presentation

Number of Views:185
Avg rating:3.0/5.0
Slides: 23
Provided by: cory54
Category:
Tags: pbni | ides

less

Transcript and Presenter's Notes

Title: PBNI


1
PBNI
  • Using the PowerBuilder Native Interface to Extend
    Your Applications

2
Whos in the Audience?
  • PowerBuilder Developers
  • 7.x
  • 8.x
  • 9.0
  • C Development Experience
  • Windows
  • Visual C / C Builder / gcc / Open Watcom
  • MFC / ATL / WTL / Managed C
  • Watcom C Class Builder (PB4 EE)
  • Unix

3
What is PBNI?
  • PowerBuilder Native Interface
  • PowerScript
  • PBNI is a standard programming interface that
    allows developers to extend PowerScript with C
    classes
  • This feature targets Client / Server and thick /
    rich distributed client applications
  • PBVM Anywhere
  • PBNI also enables the embedding of the
    PowerBuilder VM in C applications and either
    run complete PowerBuilder applications or invoke
    selective PowerScript functions
  • This feature will allows for the deployment of
    PowerBuilder NVOs in 3rd party application
    servers

4
PBNI-gtPowerScript
  • Advantages
  • Performance
  • True machine-code execution
  • Convenience
  • Ability to return strings and arrays instead of
    passing by REF
  • No need to pre-allocate memory using Space(n)
  • No need to declare complex structures
  • Auto-generated PBD just add to your library
    list and code

5
PBNI-gtPowerScript
  • Considerations
  • Complexity
  • Solid C knowledge required, as PBNI uses
    advanced C concepts like templates and traits
  • Functionality
  • Properties can only be exposed via Get/Set
    methods, which, while common in C/Java, are
    less prevalent in PowerScript (uses instance
    variables)
  • Debugging
  • C debugger required

6
PBNI-gtCode Examples
  • PBNI implementations available today
  • XML/XSLT API
  • PBDOM, Xpath
  • Java and .NET interoperability
  • PB2Java, EJB Client, PDF Encryptor
  • Web Services
  • SOAP Client
  • Complex API wrappers
  • Callback functions (DBTools, Win32 enumerations)

7
PBNI-gtCode Examples
  • PBNI implementations available today
  • PB-friendly COM wrappers
  • Event support
  • Visual objects (sub-classing and owner-drawn
    controls)
  • Utility classes
  • Bitwise operations
  • SMTP
  • Base64
  • STL collection classes (map, list, queue, stack)
  • CPU Information

8
PBNI-gtCode Examples
  • PBNI Power Pack
  • .NET PDF Encryptor
  • XPath Evaluator
  • Callbacks
  • Visual Controls
  • SDN CodeXchange http//codexchange.sybase.com

9
What is PBNI?
  • PBNI exposes 4 core C interfaces
  • PowerScript
  • IPB_Session
  • IPB_Value
  • IPB_Arguments
  • PBVM Anywhere
  • IPB_VM

10
PBNI-gtPowerScript
  • IPB_Session
  • An abstract class (structure) that provides a
    low-level interface to PowerScript
  • Defines functions for
  • Accessing PowerScript data
  • Calling PowerScript functions
  • Catching and throwing PowerScript exceptions
  • Setting marshaler class objects
  • Marshalers act as conduits between PowerBuilder
    and other component models like EJB.

11
PBNI-gtPowerScript
  • IPB_Value
  • An abstract class (structure) that provides a
    high-level interface to PowerScript
  • Analogous to PowerScripts any data type
  • Provides some protection from coding many
    operations that could cause crashes (e.g.,
    assigning a long value to a string variable)

12
PBNI-gtPBVM Anywhere
  • IPB_VM
  • An abstract interface that enables 3rd party
    client and server applications to load the
    PowerBuilder VM into their process and run a
    PowerBuilder application/component

13
What is PBNI?
14
PBNI-gtPowerScript
  • PBNI classes can inherit from
  • NonVisualObjet and its descendants, e.g.
  • Connection
  • Error
  • Exception
  • Transaction
  • UserObject and its descendants
  • PBNI extensions (PBXs) can expose
  • Object-level functions and events
  • Global functions

15
PBNI-gtGetting Started
  • Setting up a developmentenvironment
  • C IDEs/Compilers
  • Visual C (6.0 and .NET )
  • Borland C Builder
  • GNU gcc
  • Include Directory
  • INCLUDEC\Sybase\PowerBuilder 9.0\SDK\PBNI\includ
    e
  • Library Directory
  • LIBC\Sybase\PowerBuilder 9.0\SDK\PBNI\lib

16
PBNI-gtGetting Started
  • Header Files
  • pbext.h contains structures and interfaces used
    to implement PBXs
  • pbni.h contains structures and interface
    definitions for core PBNI
  • pbnimd.h contains machine-dependent (Win32) type
    definitions
  • pbarray.h contains template classes for creating
    and accessing arrays
  • pbfield.h contains template classes for creating
    and accessing class variables
  • pbtraits.h contains template structures used in
    pbarray.h and pbfield.h
  • pbevtid.h contains constants for PB standard and
    custom event IDs
  • Library Files
  • pbni.lib

17
PBNI-gtGetting Started
  • Every PBNI class should include ltpbext.hgt
  • You should not include any other PBNI header
    file in your class
  • Every PBNI class should export the following
    functions
  • PBX_GetDescription()
  • always (used by pbx2pbd90.exe PBD generator)
  • PBX_CreateNonVisualObject()
  • PBX_CreateVisualObject()
  • PBX_InvokeGlobalFunction()

18
PBNI-gtGetting Started
  • Visual C 6.0 AppWizard
  • C\Sybase\PowerBuilder 9.0\SDK\PBNI\wizards\pbext.
    awx

19
PBNI-gtGetting Started
  • Visual C .NET AppWizard
  • http//www.teamsybase.com/roy.kiesler/downloads.xm
    l
  • CodeXchange

20
PBNI-gtTomorrow
  • PBNI implementations to look for in the future
  • PBSAX XML Parser
  • Generic .NET
  • NT Services
  • Windows Hooks

21
PBNI
  • Seeing the Technology in Action

22
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com