Presentation is loading. Please wait.

Presentation is loading. Please wait.

©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021

Similar presentations


Presentation on theme: "©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021"— Presentation transcript:

1 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.comsales@basis.comwww.basis.com Language Objects Dr. Kevin King, Chief Information Officer Brian Hipple, Quality Assurance Supervisor BASIS International Ltd.

2 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 2 Overview ► Object-oriented Business BASIC ► TechCon2006 workbench ► Retrofitting legacy code into Objects ► Event Objects ► Type checking ► Memory management ► Autorun

3 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com Why Use Objects? ► Objects closely model the real world Customer object models an actual customer Inventory object models an inventory item ► Self-contained Each object carries both methods and its internal state Building blocks for constructing larger applications ► Controlled access Interaction is through defined methods Internal data is hidden Internal implementation can evolve over time

4 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 4 Object-Oriented Languages ► Java ► C++ ► C# ► Visual Basic BBx

5 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 5 Introduction to Object-Oriented Programming (a Primer) ► Reusability ► Compartmentalization ► Encapsulation ► Readability ► Scoping

6 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 6 New Custom Object Keywords ► CLASS – Marks the beginning of a class definition ► CLASSEND – Marks the end of a class definition ► Access Modifiers PUBLIC – Accessible from all PRIVATE – Accessible only within the given class PROTECTED – Accessible within the given class and derived classes STATIC – Makes field values and methods persist across all instances of a class within an interpreter. An instance of the object is not required to utilize. ► FIELD – Class member or data variable, can be another class

7 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 7 Red Class class public Red field public BBjString RedString method public void RedMethod() print "RedMethod!" methodend classend

8 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 8 Blue Class Class public Blue extends Red field public BBjString RedString field public BBjString BlueString method public void RedMethod() method public void BlueMethod() print "BlueMethod!" methodend classend

9 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 9 Black Interface interface public Black method public void BlackString() print "BlackString!" methodend interfaceend

10 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 10 Green Class Class public Green extends Blue implements Black field public BBjString RedString field public BBjString BlueString field public BBjString GreenString method public void RedMethod() method public void BlueMethod() method public void BlackMethod() method public void GreenMethod() print "GreenMethod!" methodend classend

11 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 11 Code Completion Vignette

12 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 12 Techcon06 Workbench Demonstration

13 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 13 Object-Oriented Workbench ► Points to ponder ► Steps to success ► Reasons and rationale ► Benevolent benefits ► Accurate architecture ► Features and functions ► Pinning performance

14 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 14 Object-Oriented Workbench Points to Ponder ► Object-oriented vs. procedural ► Relate functionality and data ► Base classes – reusable code ► Extended classes – reduce code ► Interface classes – flexible code ► Time Value Readability Usability Maintainability

15 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 15 Object-Oriented Workbench Steps to Success ► Create MDI host ► Create Toolbar, AppTree, SourceViewer ► Create extendable infrastructure BBj 5.031 and 6.0 Visual PRO/5 Third party ► Document and publish classes

16 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 16 Object-Oriented Workbench Reasons and Rationale ► Structurally similar to human thinking ► Similar to Java, C++,.NET, Visual Basic, etc. ► Gives developers code-completion ► Reduced overall bugs ► Reduced coding time ► Reduced debugging time ► Reduced documentation time

17 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 17 Object-Oriented Workbench Benevolent Benefits ► Provided written and tested extendable classes ► Provided common code interface ► Provided common look and feel ► Provided common features and functions ► Provided access to BACKGROUND processing

18 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 18 Object-Oriented Workbench Accurate Architecture

19 Object-Oriented Workbench

20

21

22 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 22 Object-Oriented Workbench Features and Functions ► MDI ► Virtual desktop ► Toolbar ► Tree ► Source view ► Application monitor

23 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 23 Object-Oriented Workbench Production & Pinning Performance ► Single parsing of class definition ► Never checked for Changes Deletions File reference changes ► Unpin options Programmatic  BBjAPI->BBjAdmin->BBjAdminEnvironment->unpinAllPrograms() Manual  Enterprise Manager ► See the speed…

24 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 24 Enhanced Performance of Pinned and CALLed Programs in BBj 6.00 Demonstration

25 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 25 Benefits of Custom Objects ► Code reusability ► Code readability ► Data encapsulation ► Variable scoping ► Code-completion ► Modern programming architecture ► Intuitive programming ► Simplified debugging

26 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 26 Retrofitting Legacy Code Into Objects ► CUI READ RECORD from console channel No event loop ► GUIBuilder READ RECORD from SYSGUI channel Receives all events per event mask ► BBjAPI PROCESS_EVENTS Receives only events registered for Event Objects

27 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 27 CUI – READ RECORD Demonstration

28 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 28 CUI – READ RECORD Source Code

29 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 29 GUIBuilder – READ RECORD Demonstration

30 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 30 GUIBuilder – READ RECORD Source Code

31 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 31 BBjAPI ProcessEvents Objects Demonstration

32 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 32 BBjAPI ProcessEvents Objects Source Code

33 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com Event Objects ► Object-oriented which contain event information ► Provide methods to access event information ► Created Automatically when event occurs Programmatically  BBjAPI::postCustomEvent, BBjAPI::postPriorityCustomEvent ► Accessed BBjAPI::getLastEvent() As a parameter to object based event handler

34 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com Event Objects Source Code

35 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 35 Type Checking Features ► Option for bbjcpl to enable type checker ► Can specify prefix via the command line or from a config file ► Verbs facilitate IDE code completion ► Optionally warns about unsafe uses of undeclared expressions to allow incremental code improvement ► bbjcpl options integrated into IDE compiler configuration

36 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 36 Type Checking ► Compile-time Command line – bbjcpl  Options -t Enables type checking -W Enables warnings about undeclared variables -P Specifies a prefix for files containing Custom objects -c Specifies a config file which contains prefix information BASIS IDE  Tools->Options->BBj Compiler Settings ► Runtime !ERROR=26 Mismatch ► Opt in strategy

37 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 37 Type Checking Types ► BBjNumber Numeric expressions Assignment compatible to boolean, Boolean, java.lang.Integer, BBjInt ► BBjInt Integer expressions Assignment compatible to Java integer numeric types, boolean ► BBjString String expressions Assignment compatible to java.lang.String and byte[] $ suffix

38 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 38 Type Checking Types ► Objects ! Suffix BBjAPI  Obtained by calling a BBjAPI() method mdi! = BBjAPI().getMDI() Java  Obtained by instantiating a Java object or method call states! = new java.util.HashMap() Custom  Obtained by instantiating a Custom object or method call workbenchMDI! = new WorkbenchMDI()

39 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 39 Type Checking DECLARE Verb ► Provides a contract between the developer and BBj ► Contract specifies that declared variable will never contain anything other than the declared type ► Example DECLARE java.util.HashMap a! a! = new java.util.HashMap() a!.put("dog", new java.lang.Integer(5))

40 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 40 Type Checking CAST Function ► Changes the declared type of an expression to a specified type ► Use sparingly ► Failure invokes error branch ► Example DECLARE java.util.HashMap a! a! = new java.util.HashMap() a!.put( " dog ", new java.lang.Integer(5)) a!.put( " cat ", new java.lang.Integer(6))... b = CAST(BBjNumber, a!.get( " dog " ))

41 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 41 Type Checking Benefits ► Detects potential runtime errors at compile time ► Improves code robustness ► Encourages good programming practices

42 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 42 Type Checking Command Line Demonstration

43 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 43 Type Checking BASIS IDE Demonstration

44 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 44 Autorun ► BACKGROUND replacement ► Auto starting daemon/service ► Programs run when BBjServices starts ► Configuration options Name of program config.bbx file Initial working directory User Set default values for all options ► Licensing infinite number of programs for one licensed user

45 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 45 Autorun ► Background processing Server process Listener processes Worker process Socket server Print server ► AppMonitor built into the workbench – Demo ► Basic sample writing out the starting of BBjServices - Demo

46 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 46 Autorun Source Code

47 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 47 Autorun in Enterprise Manager Demonstration

48 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 48 Autorun AppMonitor Demonstration

49 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 49 Memory Management ► Caching algorithm modified Programs Resources ► Performance improvements ► Fault tolerant

50 ©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021 sales@basis.com www.basis.com sales@basis.comwww.basis.com 50 Summary ► Object-oriented Business BASIC ► TechCon2006 workbench ► Retrofitting legacy code into Objects ► Event Objects ► Type checking ► Memory management ► Autorun


Download ppt "©1985-2006 All rights reserved. U.S. 1.800.423.1394 International +1.505.338.4188 Tech Support +1.505.345.5021"

Similar presentations


Ads by Google