Foxtalk Instances of Classes Become Objects

Foxtalk Instances of Classes Become Objects

FoxSolutions for Microsoft® FoxPro®Talk and Visual FoxPro® Developers May 1998 Volume 10, Number 5 1 Teaching OOP to FPW with Stored Procedures Dave Jinkerson Teaching OOP and Scott Malinowski 2 Editorial: No Good Deed Goes Unpunished to FPW with Whil Hentzen 6 Best Practices: Development Checklist: Object-Oriented Stored Procedures Design, Part 2 Jefferey A. Donnici 10 Reusable Tools: Dave Jinkerson Build Your Own Wizards and Scott Malinowski Doug Hennig 14 ActiveX and Automation Review: Automation from a VFP Perspective Many FoxPro developers would like to make the transition between FPW and VFP, John V. Petersen but they don’t know where to start. Dave and Scott will show you how to use your 18 Using AddObject current knowledge of FPW to build the bridge every programmer needs to cross Richard A. Schummer from procedural programming into OOP. In this article, they’ll look at an example 23 The Cutting Edge: that will help you move your procedural programming style one step closer to OOP It’s Never Too Late and, in so doing, begin the journey from FPW to VFP. Les Pinter 24 May Subscriber Downloads BJECT-ORIENTED programming (OOP) is a data-centered view of EA What’s Really Inside: programming in which data and behavior are strongly linked. The TableUpdate() Oproper way to view OOP is as a programming style that captures the in Visual FoxPro 5.0 behavior of the real world in a way that hides implementation details. With a Jim Booth language that supports OOP, data and behavior are conceived as classes, and Extended Article available at www.pinpub.com/foxtalk Instances of classes become objects. What many FPW programmers don’t realize is that, in a language that doesn’t support OOP, you can rely on EA Cool Tool: Clean Off Your Monitor with StickyNotes programming style and still create an OOP-like result. Whil Hentzen Extended Article available at ADTs with style www.pinpub.com/foxtalk A key factor in OOP is the creation of user-defined data types from the EA The Kit Box: Saving and language’s native data types. In languages that support OOP, user-defined Restoring Objects extensions to the native types are called Abstract Data Types (ADT). To create Barbara Peisch and Paul Maskens Extended Article available at an ADT, you must define a set of values and a collection of operations that can www.pinpub.com/foxtalk act on those values. But stop and realize that FPW programmers can create sets EA How to Sell Part of values (Tables) and collections of operations (Procedures/Functions) that of an Application can act on those values. Keep this thought in your mind; it will become a key Paul Russell piece in teaching FPW, OOP-style. Extended Article available at Continues on page 3 www.pinpub.com/foxtalk From the Editor FoxTalk No Good Deed Goes Unpunished Whil Hentzen EEPERS. Remember the opening scene in the TV With this onslaught of information and limited space, version of The Odd Couple where Tony Randall I’ve faced some tough choices. Should we cut articles? Jattempts to help an old lady across the street, and Well, I’d like to cover as many topics as possible each he’s greeted with a swinging purse-in-the-face by the little month, so that didn’t seem right. In fact, I have an ever- old lady, followed by a punch (albeit a rather effeminate growing list of topics, articles, and even potential effort) by the Boy Scout who then took Randall’s place columns—trying to slow down the horses just as we’re as the escort? starting down a long incline is at best impractical, and at Kinda feel like Tony Randall myself, these days. worst, foolhardy. Should we edit out material to reduce You’ve heard it said enough that you’re probably the length of articles? Well, we can cover a topic in less getting tired of it, but we’re not in Kansas anymore. space, but often people want more of the specifics. There’s an overwhelming amount of information needed We wanted to find a way to deliver more material to keep current with Visual FoxPro development—not within budget. FoxTalk is comparably priced to the just Fox, but all of Visual Studio, as well as bigger and competition, once you compare apples to apples. You more complex operating systems and delivery have access to the Subscriber Downloads/companion mechanisms. You need as much high-end, quality disks free with your paid subscription—not as an added information as you can get. It’s vital to your career. And charge, as some publishers do. More to the point, we offer for years now, FoxTalk has been the best place to get it. As the kind of high-end information that you just can’t get editor of this publication, I feel obligated to deliver as elsewhere. Still, we were committed to figuring out a way much in-depth information—on the widest variety of to give our subscribers even more of the information you topics—as possible. need while maintaining costs. Continues on page 22 Editor Whil Hentzen, Editorial Advisory Board Scott Malinowski, Walter Loughney, Les Pinter, Ken Levy, Publisher Robert Williford, Editorial and Fax Vice President/General Manager Connie Austin, Managing Editor Heidi Frost, Copy Editor Farion Grove Subscription 770-565-8232 Information FoxTalk (ISSN 1042-6302) is published monthly (12 times per year) purpose. Pinnacle Publishing, Inc., shall not be liable to the 770-565-1763 Mail by Pinnacle Publishing, Inc., 1503 Johnson Ferry Road, Suite 100, purchaser or any other person or entity with respect to any liability, 800-788-1900 PO Box 72255 Marietta, GA 30062. The subscription price of domestic loss, or damage caused or alleged to be caused directly or indirectly Marietta, GA subscriptions is: 12 issues, $179; 24 issues, $259. Periodical postage by this publication. Articles published in FoxTalk reflect the views of E-mail 30007-2255 paid at Marietta, GA and at additional mailing offices. USPS#005373. their authors; they may or may not reflect the view of Pinnacle [email protected] POSTMASTER: Send address changes to FoxTalk, PO Box 72255, Publishing, Inc. Inclusion of advertising inserts does not constitute Marietta, GA 30007-2255. an endorsement by Pinnacle Publishing, Inc. or FoxTalk. Pinnacle Web Site Copyright © 1998 by Pinnacle Publishing, Inc. All rights reserved. No Subscription information: To order, call Pinnacle Customer Service http://www.pinpub.com part of this periodical may be used or reproduced in any fashion at 800-788-1900, or 770-565-1763. Cost of domestic subscriptions: whatsoever (except in the case of brief quotations embodied in 12 issues, $179; 24 issues, $259. Canada: 12 issues, $194; 24 issues, critical articles and reviews) without the prior written consent of $289. Outside North America: 12 issues, $199; 24 issues, $299. Pinnacle Publishing, Inc. Printed in the United States of America. Individual issues cost $17.50 ($20 in Canada, $22.50 outside North America). All funds must be in U.S. currency. Brand and product names are trademarks or registered trademarks of their respective holders. Microsoft is a registered trademark of For European newsletter orders, contact: Tomalin Associates, Microsoft Corporation. The Fox Head logo, FoxBASE+, FoxPro, and Unit 22, The Bardfield Centre, Braintree Road, Great Bardfield, Essex Applies to VFP v5.0 Applies to VFP v3.0 Applies to FoxPro v2.x Visual FoxPro are registered trademarks of Microsoft Corporation. CM7 4SL, United Kingdom. E-mail: [email protected]. FoxTalk is an independent publication not affiliated with Microsoft Tel: +44 (0)1371 811299. Fax: +44 (0)1371 811283. 12 issues: £179 Corporation. Microsoft Corporation is not responsible in any way for the editorial policy or other contents of the publication. For Australian newsletter orders, contact: Ashpoint Pty., Ltd., 9 Arthur Street, Dover Heights, N.S.W. 2030, Australia. Accompanying files available online This publication is intended as a general guide. It covers a highly Phone: +61 2-9371-7399. Fax: +61 2-9371-0180. at http://www.pinpub.com/foxtalk technical and complex subject and should not be used for making E-mail: [email protected]. Web: http://www.ashpoint.com.au. decisions concerning specific products or applications. This publication is sold as is, without warranty of any kind, either express FoxPro technical support: Call Microsoft at 206-635-7191 or implied, respecting the contents of this publication, including (Windows) or 206-635-7192 (Macintosh). Applies specifically to one of these platforms. but not limited to implied warranties for the publication, performance, quality, merchantability, or fitness for any particular Send all other questions or requests via the options at right. 2 http://www.pinpub.com If you look at an ADT within VFP, you’ll find an Stored Procedures . abstract memory relationship (that is, class definition) Continued from page 1 between data types (properties) and operations Databases and stored procedures (methods). Conceptually, our example is no different: What is a stored procedure? VFP defines a stored The abstract memory relationship is created between procedure as: “A procedure stored in a database. The our runtime cursors. The properties between the data procedure can contain any commands and functions types are the data items and their corresponding values allowed in a user-defined function.” I don’t see anything within the survey. Finally, our stored procedures that here that can’t be done in FPW. will operate on these data items represent our methods. However, some VFP developers will dispute the fact Here’s the query from the survey definition table, that FPW has anything remotely similar to a “Database.” relevant to our example: Let’s not limit our understanding of the word “Database” select field_name, field_type, field_len, field_dec ; to imply a Visual FoxPro Database Container (DBC).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    24 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us