Caché Core: Server-Side Programming
Total Page:16
File Type:pdf, Size:1020Kb
Caché Core: Server-Side Programming CACHÉ CORE : SERVER – SIDE PROGRAMMING COPYRIGHT NOTICE Copyright © InterSystems Corporation 1997-2002 All rights reserved NOTICE PROPRIETARY — CONFIDENTIAL This document contains trade secret and confidential information which is the property of InterSystems Corporation, One Memorial Drive, Cambridge, MA 02142, or its affiliates, and is furnished for the sole purpose of the operation and maintenance of the products of InterSystems Corporation. No part of this publication is to be used for any other purpose, and this publication is not to be reproduced, copied, disclosed, transmitted, stored in a retrieval system or translated into any human or computer language, in any form, by any means, in whole or in part, without the express prior written consent of InterSystems Corporation. The copying, use and disposition of this document and the software programs described herein is prohibited except to the limited extent set forth in the standard software license agreement(s) of InterSystems Corporation covering such programs and related documentation. InterSystems Corporation makes no representations and warranties concerning such software programs other than those set forth in such standard software license agreement(s). In addition, the liability of InterSystems Corporation for any losses or damages relating to or arising out of the use of such software programs is limited in the manner set forth in such standard software license agreement(s). THE FOREGOING IS A GENERAL SUMMARY OF THE RESTRICTIONS AND LIMITATIONS IMPOSED BY INTERSYSTEMS CORPORATION ON THE USE OF, AND LIABILITY ARISING FROM, ITS COMPUTER SOFTWARE. FOR COMPLETE INFORMATION REFERENCE SHOULD BE MADE TO THE STANDARD SOFTWARE LICENSE AGREEMENT(S) OF INTERSYSTEMS CORPORATION, COPIES OF WHICH WILL BE MADE AVAILABLE UPON REQUEST. InterSystems Corporation disclaims responsibility for errors which may appear in this document, and it reserves the right, in its sole discretion and without notice, to make substitutions and modifications in the products and practices described in this document. InterSystems™, InterSystems Caché™, DCP™, DTM™, DSM™, and DASL™ are trademarks of InterSystems Corporation. DSM DDP™, VAX™, VMS™, OpenVMS™, and DEC™ are trademarks of Digital Equipment Corp. Microsoft®, MS-DOS®, Microsoft Access®, and, Excel® are registered trademarks and Windows™, Windows NT, Visual Basic™, and Visual C++™ are trademarks of Microsoft Corporation. ORACLE® is a registered trademark of Oracle Corporation. For questions about any InterSystems products, contact our Worldwide Response Center: Phone: US: +1 617 621-0700 Europe: +44 (0) 1753 830-077 Fax: US: +1 617 374-9391 Europe: +44 (0) 1753 861-311 Internet: [email protected] FTP Site: ftp.intersys.com World Wide Web: www.intersys.com Documentation: cache.intersys.com/contactus/doc_action_form.html European BBS: +44 (0) 1753-853-534 Intersystems Caché Core: Server-Side Programming – Treinamento INDEX Module 1: Overview What is Caché?....................................................................................... 10 Completely Connected ............................................................................ 10 The Toolset ........................................................................................... 11 The Caché Cube ..................................................................................... 11 The Caché Program Group ....................................................................... 12 Caché Object Architect ............................................................................ 12 Caché Studio ......................................................................................... 13 Caché SQL Manager ................................................................................ 13 Caché Explorer ....................................................................................... 14 Caché Terminal ...................................................................................... 14 Caché Control Panel ................................................................................ 15 Caché Configuration Manager ................................................................... 15 Remote System Access ........................................................................... 16 The System Viewer ................................................................................. 16 Module 2: Getting Started Basic Structure ...................................................................................... 18 Databases ............................................................................................. 18 Routines ............................................................................................... 18 Globals ................................................................................................. 19 Namespaces .......................................................................................... 19 Changing Namespaces ............................................................................ 19 Creating a Namespace ............................................................................ 20 Connections ...........................................................................................20 ODBC Data Source ................................................................................. 21 Bi-Directional ODBC ................................................................................ 21 CSP Application ...................................................................................... 22 Management ..........................................................................................22 Error Handling ....................................................................................... 22 Exercises ...............................................................................................24 Module 3: Tour Example Application ............................................................................... 27 Classes and Objects ................................................................................ 27 The MenuItem Class ............................................................................... 27 The Order Class ..................................................................................... 28 Packages ............................................................................................... 28 Creating a Class ..................................................................................... 28 Editing a Class Definition ......................................................................... 29 Properties ............................................................................................. 29 The Name Property ................................................................................. 30 The Price Property .................................................................................. 30 The Quantity Property ............................................................................. 31 Simple Property Parameters .....................................................................31 More Property Parameters ....................................................................... 31 Parameters ............................................................................................ 32 Intersystems 3 Caché Core: Server-Side Programming – Treinamento Methods ................................................................................................ 32 Queries ................................................................................................. 33 Saving and Compiling ............................................................................. 33 Generated Routines and Globals ............................................................... 33 Compile Options ..................................................................................... 34 Class Definition Language ........................................................................ 34 Export/Import of CDL ..............................................................................34 Creating The User Interface ..................................................................... 35 Form Wizards ........................................................................................ 35 Using ObjectScript .................................................................................. 35 Examples of Using Objects ....................................................................... 36 Syntax Conventions ................................................................................ 36 Concurrency .......................................................................................... 36 Success or Failure .................................................................................. 37 OREFs and IDs ....................................................................................... 37 ID ........................................................................................................ 37 OIDs .....................................................................................................37 ObjectScript: Commands ......................................................................... 38 ObjectScript: Objects .............................................................................. 38 ObjectScript: Pattern Examples ................................................................ 38 Exercises ...............................................................................................40