![]() |
![]() ![]()
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Advisor Media presents the Visual FoxPro DevCon 2003 conference. It includes three days of technical education. Learn from the top experts. Collaborate with your colleagues from around the world. Maximize your time and travel investment and get exactly the technical training you need. Be part of the original FoxPro Developer Conference. Don't miss the Visual FoxPro Developer Conference 2003, the annual gathering of FoxPro developers from around the world. Visual FoxProDevCon is essential technical education for serious FoxPro developers. DevCon puts you face-to-face with the leading FoxPro experts, members of the Microsoft Visual FoxPro product team, and FoxPro professionals from around the world.
Sunday, June 15
Andrew MacNeill's Advisor JumpStart: Web Services
by Christopher Bohling
According to Andrew MacNeill, web services are very much like FoxPro functions. In fact, they can be VFP functions, as long as those functions are wrapped up in a COM object, the COM object is published to a Web site along with WSDL and WSML files, and the SOAP client (known as the WHOLEBODYWASH client in Southern California) is installed on the web service "consumer." In addition, Web Services messages are carried in XML over HTML on the Internet (which itself uses TCP/IP as its network transport mechanism.
This is not the end to what Andrew described as "acronym hell." XML files use the DOM, XML Document Model. The DOM can be used in combination with schemas internal to XML documents to find just what the document contains. According to Andrew, these properties (including collections) and methods are the keys to interpreting schemas and the XML data they define:
For Andrew, learning the ins and outs of the XML DOM is of paramount importance in becoming proficient with Web Services.
He also made other important points:
Andrew closed on a positive note, paraphrased here: The most important thing is to learn the XML DOM.
When asked about the session, Erik Trutner of Oakland, California, said, "As a novice concerning Web Services I found Andrew’s presentation to be very informative and undoubtedly will be a great basis for my future work in Web development."
Ted Roche's Advisor JumpStart: Visual FoxPro Development
by Christopher Bohling
This reporter rushed to cover this session when it became clear that a group of other speakers had formed a baked goods terrorist
group known as Al Cake-a that was intent on making Roche celebrate his birthday. After receiving his cake joyfully, Roche spent the
last two minutes of his session presenting an exhaustive analysis of project management. (Parts of this story are made up.)
Rod Paddock's Advisor JumpStart: .NET for VFP Developers
by Christopher Bohling
Having established himself as a leader in the VFP realm, Rod Paddock is doing more work in .Net, including presentations. Paddock made a half-day seminar at the Essential Fox conference in Kansas City in April. (Note: my employing company sponsors that conference.) I had to miss that seminar because a client of mine had an issue that turned out to take four hours to resolve. Fortunately, I got to see Rod’s two hour presentation here at DevCon.
Those interested in .Net should also be sure to read Evan’s report on Kevin McNeish’s presentation, below.
Rod thinks that there are a lot of advantages to using .NET and the Visual Studio.NET editor. The error checking built into the VS.NET compiler is better, in part because variables are strongly typed. Debugging can go a step further than any VFP developer might try. Visual Studio can “attach” to a running a executable, even remotely, and monitor the executing code.
VS.NET contains more default controls, like the calendar control and a slider. Fewer controls need to be dug out of the depths of the Windows system.
Installation of the .NET runtime will enable a client machine for what is pretty much a copy and paste install of the DLLs created by the .NET compiler.
While FoxPro contains a mix of objects with “unaware” constructs like memory variables, in .NET everything is an object. This means that even variables contain their own properties and methods. Assuming that y is a numeric variable for which you want a character equivalent, instead of coding x = STR(y) in the VFP style, a .NET developer could use x = y.ToString. More methods could be added to the list, as well, such as a trim function. (For example, x = y.ToString.Trim. Best of all, each one of the available methods will appear in an Intellisense list.
More functions can be made available by adding a project “reference” to a solution. Many references can be retrieved from the Global Assembly Cache (GAC), but they can also be from a custom project or third party tool.
Just before break we learned that Rod is engaged to Jessica Wills. (See the picture archive for a photo of them together.)
After break, Rod demonstrated how easy it was to build Web forms with VS.NET with very little code. Controls can be dragged and dropped onto Web forms just like Windows forms. VS.NET will even debug Web forms just like Windows forms.
Though skeptical of new technology, Rod said that after using Web Services he decided, “I will never build another application again that uses data on the Internet without using a Web Service.” .NET enables Web Services by allowing methods to be tagged as “Web Methods.” These methods are exposed to the Internet.
Finally, Rod discussed ADO.NET and data sets. Those attending will get access to utilities that he routinely uses in working with data set objects.
Cathy Pountney's Advisor JumpStart: Visual FoxPro Report Writer
by Christopher Bohling
Cathy Pountney's credentials as the leading VFP report guru include a book on the subject (edited by Dave Aring, my coworker and friend), numerous published articles, a long track record of presentations, and six months working with the Fox team at Microsoft.
Cathy first reviewed the report wizard. Two of the most pertinent points were 1. the wizard can create an index without you knowing it and 2. the RptStyle table is the place to add customized styles. But, if you do create a new style, base it on an existing one. VFP expects styles to contain certain items.
After the wizard, she shifted attention to the report designer. The best news from this discussion was that VFP 8.0 includes a Reports tab on the Options form where report defaults can be set. There were several other items discussed that it might be useful to read about in Cathy's book. However, if you know the maximum number of bands a report can have, you are at least 0.03% there.
Then came the discussion of data sources, data sessions, and the data environment. Cathy pointed out that data entry systems work best with normalized data, whereas reports are easier with denormalized data. Reports lose this fight and there are inevitable questions about how to prepare data for reporting. Two tips worthy of considering are to set the AutoOpen and AutoClose properties of cursors in the data environment to false. This way a cursor can be used during development that will not need to exist under the same name at runtime. Also, the BeforeOpenTables and OpenTables methods can be used to manipulate data.
The BeforeOpenTables event can serve as the location of code to change the relative paths that the data environment adds for tables.
Cathy also discussed report objects, including controls, report variables, running reports, and distributing reports. Two points to keep in mind are to always remove printer information from the .FRX file (which is done with a menu choice in VFP 8) and that the "Release After Reports" option does not work for report variables.
She added a handy tip for selecting labels easily for editing: highlight the label and type Ctrl+E.
There was much more to this session. If you want to run VFP reports, and you have not checked out Cathy's work, it would be well worth your while.
Kevin McNeish's Advisor JumpStart: .NET Development by Evan R. Pauley
It’s too early for late-night developers like myself. My heart hasn’t starting beating yet. Nevertheless, here I am. I’ve had my first caffeine injection (I take my caffeine cold, so it’s Vanilla Coke instead of Starbucks), and I’m in the first "JumpStart" pre-conference session of the day, the session on .NET development being taught by Kevin McNeish of Oak Leaf Enterprises in Charlottesville, VA. Kevin is well-known in the VFP world as the architect of the Mere Mortals development framework, and has also written an excellent book on UML modeling. The session has about 20 attendees. I’m not personally knowledgeable in .NET, since most of my clients currently don’t require this knowledge. All my further comments will, therefore, contain my personal "spin" on Kevin’s comments. Kevin has tailored his presentation, obviously, to VFP developers moving to the .NET initiative. One of the major advantages of .NET is the single learning curve for developing both desktop and Web applications (and also for handheld or mobile devices, if necessary). There’s also no interoperability layer, such as COM, between the different .NET languages, which eases compatibility issues between modules written in these languages. .NET handles the creation, release and "garbage collection" of objects considerably more efficiently than VFP, which greatly reduces application "memory leaks" and applications that run slower as they get older. Kevin also touched early on the fact (well known to everyone here) that Microsoft is strongly marketing .NET to their entire development community and has anointed .NET as "the future of software development at Microsoft". This means that persons with both VFP and .NET skill sets are an extremely HOT property right now. Kevin stressed that while VFP is not going away ANYTIME soon, and VFP still reigns supreme when handling large amounts of local data, the market for VFP is definitely diminishing. This doesn’t mean VFP is completely out of the mix, however; VFP COM components can easily be called by .NET applications.
There are three primary .NET languages: C# (known as ‘C-sharp’), VB.NET and C++. C# was the language used to author the .NET framework itself. Since C# is a new language specifically designed for .NET, the C# team is focused entirely on advanced OOP and *performance*. If you’re not already a VB programmer, Kevin believes that the migration path for VFP developers to C# will be much smoother than the other languages. For Java developers, C# is very similar to Java – 41 of the same 43 operators, 38 of the 50 keywords (46 if you count the synonyms), and ALL the same flow of controls statements. C# is also less verbose than the other .NET languages, and memory access is less "dangerous" since memory locations are normally accessed by reference rather than with pointers. C# has a growing community in the VFP world, and about 25% of the C# developers are former VB developers. VB.NET, on the other hand, is focused on RAD (think "builders"). VB.NET has more of a "pretty facade" which hides the way .NET works. It’s more like VFP in that it is a higher-level declarative language. VB.NET is also non-case sensitive, and has a "background compilation" scheme that catches errors earlier (which is great for small projects, but slows larger projects down considerably). It’s best for shops with some current VB familiarity. All the classes (also known as "types") in the .NET framework inherit from the Object class (known as "the mother of all classes"). Since two developers could easily name a class identically, "namespaces" give you a way to provide a "whole name" to your classes and allow you to categorize those classes. For instance, the "System" namespace (provided by MS) contains the fundamental classes and base classes that define commonly used value and reference data types, events and event handlers, interfaces, and so forth. By contrast, the "System.Data.OleDb" namespace encapsulates the OLE DB .NET data provider (which still inherits, ultimately, from the Object class mentioned above). Because of .NET’s strong variable typing (variable types must be declared when the variable is created), and because *everything* in .NET comes from a class (and is, therefore, an object), creating a variable in .NET provides complete IntelliSense capability in the Visual Studio editor. Entering string test = "Hello .NET World" and then entering test. provides a complete list of not only the properties of a string variable, but also the methods/functions available to that string variable. less than 80 total lines of code, was constructed in less than 45 minutes to the delight and approval of the approximately 80 attendees. This evening has nothing scheduled, other than the music jam session in the bar. I think I’ll just look out over these beautiful grounds for awhile before the music starts. Also, since .NET is strongly typed, compiling your code will produce an error if, for example, you assign a string value to an integer variable or pass an integer value to a method expecting a string (mistakes which no VFP developer has EVER made before –bg-). This will catch a considerable number of "bugs" before the application ever runs.
.NET allows what are called "overloaded methods", or multiple methods with the same name. A good example is the MessageBox class of .NET. The Show() method of the class has twelve different "overloads", or ways to pass the necessary values (think of a CASE statement that accepts whatever parameters the user might pass and issues the correct call regardless). Source code in .NET is compiled *twice* -- first to a pseudo-code level (called MSIL for Microsoft Intermediate Language) and then to machine code at run-time by the CLR. This is different than VFP, which interprets the code at runtime. This is important because the .NET "just in time" runtime compiler can then determine the specific CPU on which the code is running and take advantage of that processor’s special features. Code that runs under .NET is known as "managed" code. C++ can also create "unmanaged" code, which runs outside of .NET (VFP code would also be considered unmanaged). "Unsafe" code is managed code which directly accesses memory using pointers and stack-based arrays. Kevin’s presentation, which lasted almost three and a half hours with a break in the middle, was concise and communicated a large quantity of valuable information for those wishing to learn more about how .NET and VFP can coexist in the same development environment. As always, Kevin showed a strong command of his subject matter and an easygoing, conversational style. After the session, I met up with our other reporter, Chris Bohling, and another speaker, Ted Roche. Most of you know Ted as the co-author of the excellent Hacker’s Guide series of books, which no VFP developer should be without. Jim Duffy's Advisor JumpStart: SQL Server for Visual FoxPro Developers by Evan R. Pauley 1:00 PM On to the SQL Server for VFP Developers session and the
always entertaining Jim Duffy from TakeNote Technologies in In a file-server environment such as VFP, large amounts of data are transmitted between the server machine and the client, and all the processing and selection of the data is performed on that client. In a client-server environment, the only thing that is transmitted between the server and client is the request and the data fulfilling that request -- all the processing and selection of the data is performed on the server machine. Jim advocates that ALL applications should be developed with "real" databases, such as SQL Server, Oracle, DB2 and Informix. These databases should have integrated security, integrated scalability, integrated corruption recovery and other features missing from file-server database products such as VFP, Access, and FileMaker. Several members of the VFP community have criticized Jim for attacking VFP as a product. Jim addressed this directly with the attendees; he stated that he writes VFP applications every day, just without using VFP databases or tables. Jim defined a "client-server" application as an application where the data not only resides on a single (server) machine, but is also processed on that same machine when other machines make requests for the data on the server. Server applications are fully scalable, easier to maintain
in large enterprises, allow for scheduling tasks at non-critical times, and
reduce network traffic – regardless of whether the application is used by a
single workstation in a single location or by thousands of simultaneous users
worldwide. Server applications also have
a large selection of development tools, such as VFP, VB, Client-server applications do have some disadvantages. Server software is more costly; application design needs to be rethought (removing record-by-record navigation, revising forms, revising reports, etc.); and basic server administration techniques and database-specific querying dialects must be learned. Most of these are standardized and well documented. Jim’s presentation continued through defining various client-server terminology, such as connections, queries, result sets, stored procedures, and triggers. He then proceeded to describe and demonstrate techniques, including advantages and disadvantages, for connecting to server data through remote views (not recommended unless data must be joined from several different data sources to an existing user interface), SQL pass-through (recommended for all queries which return data), and ADO command objects (recommended for all operations which insert, modify, or delete data). The final hour and a half revolved around an overview of SQL Server 2000 and its various tools, followed by the explanation and construction of a basic "data object" which, when instantiated by a client, encapsulates all the necessary functionality for a single result set, including inserts and updates. This generic data object, encompassing less than 80 total lines of code, was constructed in less than 45 minutes to the delight and approval of the approximately 80 attendees. This evening has nothing scheduled, other than the music jam session in the bar. I think I’ll just look out over these beautiful grounds for awhile before the music starts.
Keynote Presentation, Report 2 of 2 by Evan R. Pauley There’s a crowd of about four hundred or so in the hallway waiting for the keynote to start. Most are reviewing their conference materials or reading the newspaper. The conference also has a wireless high-speed network available (thankfully). While I don’t know the actual attendance yet, this conference seems even smaller than I had expected. Normally, by now, I’ve run into at least half a dozen former co-workers (or employers). I’ve only seen one so far.
John Hawkins, the CEO of Advisor Publications, greeted the attendees. A series of video outtakes from the VFP team’s work location preceded the arrival of Ken Levy, VFP Product Manager, and Alan Griver, Visual Studio Data Group Manager, to begin the keynote address. Ken began by highlighting the productivity enhancements in VFP 8, including the Task Pane, the Toolbox, the Empty class, TRY/CATCH/FINALLY structured error handling, event binding, the enhanced View Designer, and others. Ken spoke more at length about the new XMLAdapter class and its capabilities for updating data over HTTP, the new CursorAdapter class, the new data features (subclassable DataEnvironments, the BindControls() form property, etc.), and the increased performance of VFP 8 regarding object creation and release (VFP 8 is about 50 times faster in this area than VFP 7). Next, Alan discussed the increased interoperability between VFP 8 and Visual Studio .NET. The .NET design initiative is to produce software for connecting information, people, systems, and devices. Visual Studio .NET 2002 was the first version of the .NET framework, including the new C# language. The new 1.1 version of the .NET framework is now included with Windows Server 2003, and includes side-by-side execution with the first framework version, code access security and mobile controls for ASP.NET, and native Oracle support. The upgrade to VS.NET 2003 only updates the project file; no existing source files are modified. There are also a wealth of productivity enhancements and language enhancements to all of the .NET languages and related tools, far too extensive to mention here. There are also two new certifications: MCAD (MS Certified Application Developer) and an MCSD track for the .NET framework. Ken returned to demo VFP 8 working with VS .NET 2003. His demo was too extensive to duplicate here; however, after the session, conference speaker Ted Roche informed me that he had “blogged” the entire transcript of the keynote on his site (many thanks, Ted !!! ) Please go to Ted Roche’s Blog to view this transcript. Ken also mentioned several resources that are or will soon be available to VFP developers. An updated VFP 8 OLE DB provider will be on the MSDN site in about two weeks. The VFP Toolkit for .NET is on the GotDotNet.Com/Team/Vfp site, along with a VFP 8 case study template available for download. CoDe Magazine also has a special VFP 8 issue. Two new whitepapers, addressing the Toolbox and Task Pane of VFP 8, are also available on the MSDN site. Advanced SQL Server Development for VFP Developers by Evan R. Pauley Anyone who knows Jim Duffy of TakeNote Technologies in One of the first questions asked during a conversion or migration to SQL Server is “how do I get my data over to SQL?” There are three primary ways: 1) the bulk copy program, or BCP, which is a command-line utility usually run from the Windows Command window; 2) bulk insert, which provides BCP-like capability in a Transact-SQL command which can be run from the Query Analyzer (or VFP, for that matter); and 3) SQL’s Data Transformation Services (DTS), which is a programmable “data pump” complete with a wizard and stored “packages”. BCP, while a command line utility, can utilize a “format file” which is a text file that stores the necessary parameters related to the data copy. A DTS package (basically a batch file for DTS) is normally built using the Import/Export Wizard built into SQL Server. The package uses OLE DB or ODBC connectivity to move data, both directions, between SQL and various products including VFP, Oracle, and DB2. The package can also perform type conversions during the data moving process. When copying data into SQL, most of these conversions are implicitly performed. The SQL Profiler’s job is to watch the server and “keep track” of what the server does. Users can log all or selected items which occur on the server and debug Transact-SQL statements/stored procedures. Users can also capture events on a production system and replay them on a test system (a VERY cool feature). Profiler can additionally be driven by one or more templates, and can save its “tracer” information for auditing purposes. UDF’s can return values OR tables. UDF’s can call other
UDF’s. UDF’s can be called recursively. UDF’s cannot, however, use built-in
functions that can return different data on each call (such as NewID(),
GetDate(), Unlike VFP, SQL allows as many triggers as the user desires for a particular table. Inside each trigger, there are contained INSERT and DELETE tables that can be used during the trigger (this is extremely helpful when building an audit log from a trigger, which is where that action should take place). The user does not, however, have much control over the ORDER in which the triggers fire (except for the first one, of course).
Building a Data Access Layer with VFP 8 by Evan R. Pauley Toni Feltman from F1 Technologies in The new data classes in VFP 8 are the DataEnvironment, Cursor, CursorAdapter, and Relation classes. Where previously these were tightly coupled to forms (and, in some cases, were not available from VCX-based forms), these can now be subclassed independently from forms and used in other locations. The Cursor class requires only a database (if you are using VFP data) and the name of a data source. The CursorAdapter class is used to connect to non-VFP data via a SELECT statement and return that data into a VFP cursor (think “remote view on steroids”). The Relation class is used for VFP relationships (think “SET RELATION TO and SET SKIP TO in their own class”). The DataEnvironment class is a container class that is designed to hold Cursor, CursorAdapter, and Relation classes and handle the opening and closing of its contained data controls. DataEnvironment classes also can specify their own DataSource and DataSourceType properties, which are used as defaults for any contained CursorAdapter instances which have their UseDeDataSource property set true. To user the new data classes, create a Cursor and any desired Relation objects (for VFP data) or CursorAdapter (for non-VFP data) for each desired table (for CursorAdapters, the provided builder is the best way to do this). Next, create a DataEnvironment object and populate that object with the previously created items. There are three ways to then associate this DataEnvironment with a form. The normal methodology is to populate the DEClass and DEClassLibrary properties of the form, which at runtime adds an instance of this class to the form and names it with the name of the class. This enables drag-and-drop capabilities for the DE – however, this does not provide a handle to the DE in the form (for instance, you cannot use syntax on the order of THISFORM.DataEnvironment.MyCursor.Name). An alternate methodology is to simply drop the DE on the form as a member, just like any other VFP control. This provides for object-oriented syntax, on the order of THISFORM.dteMyData.MyCursor.Name, but removes the ability to drag-and-drop items – and the form does not instruct the DE to auto-open any contained items (you must code this behavior yourself if desired). The most flexible way is to manually instantiate the DE in the Init() of the form. This is similar to dropping the DE on the form as a member, but allows the instantiation of DE’s that exist on another location, which might be the case for N-tier development situations. When designing a data access layer, your goals should include a simple yet reusable class structure that will migrate to N-Tier with as little effort as possible. Implementing MSDE-based Applicationsby Evan R. Pauley After lunch, the first session on the afternoon schedule
dealt with implementing MSDE-based applications. Once again, Jim Duffy of
TakeNote Technologies in All kidding aside, MSDE is a free SQL Server database for a developer’s smaller clients who might not need or be able to afford a full SQL Server license. It supports up to two processors, and states that it runs on Windows 95 or above (in reality, it should be run on Windows 98SE as the least common denominator). MSDE includes no development tools like Enterprise Manager or Query Analyzer, database size is limited to 2 gigabytes (there’s no limit to the number of databases, however), and is optimized for five *concurrent* queries – based on throughput, NOT on the number of physical connections to the database(s). MSDE also can not perform transactional replication. Apart from those (fairly minor) qualifiers, MSDE *really is* SQL Server. The entire “rest of the feature set” from SQL Server is supported, including views, stored procedures, DTS packages, user-defined functions – everything. When the developer’s client needs more concurrent queries, or reaches the database limitation, they purchase the full version of SQL Server – and their entire database, code and all, attaches without further incident or difficulty. Applications written to query MSDE data function with NO CODE CHANGES, eliminating the need for separate code bases between scaled versions of the application. MSDE is included with many Microsoft products, and may be distributed with developed applications at no charge. A complete package for installing MSDE is available from the MSDN web site. Indexing SQL Server for Performanceby Evan R. Pauley The final session of the first afternoon concerned the indexing
of SQL server to enhance performance. Chuck Urwiler of EPS Software Corp. in The primary tools for optimizing SQL performance are the SET STATISTICS IO command, the Execution Plan, and the Profiler. Lesser used, but still valuable, tools include the DBCC SHOW_STATISTICS command and the DBCC SHOWCONTIG command. SQL Server stores information in “pages” of 8K each. These pages are requested as necessary in groups of eight pages called an “extent”. The efficient usage and manipulation of these pages in memory by SQL Server’s optimization engine control the performance of SQL queries. The SET STATISTICS IO (that’s “io”, not “to”) command is normally used to monitor the page count, or number of pages accessed to execute a query. The “scan count” shows the number of pages touched, the “logical reads” shows the number of pages *in memory* needed by the query, and the “physical reads” shows the number of pages read from disk during the query. As physical reads increase, the more “memory starved” the server becomes and the slower queries operate. Execution plans show, either graphically (the norm) or textually the “cost” of the query in units. These units have no meaning other than to measure against other cost unit measurements from other queries, and have no relationship to time, disk space, processor speed or any other known unit of measure. Each operation performed as part of the query is documented, along with its cost; to see the total query cost, save the output of the execution plan as a cursor with SET SHOWPLAN_ALL ON. The DBCC SHOW_STATISTICS command views the density of index keys by showing an entire histogram of rows, and the DBCC SHOWCONTIG command shows the fragmentation of the pages across the disk. The “scan density” shows the amount of fragmentation as a percentage; the closer to 100 percent, the less fragmentation exists. The larger the number of rows in the table, the more tolerance SQL queries will have with fragmentation. To defragment a table, rebuild its clustered index with the “drop” option. Chuck recommends NOT building clustered indexes on primary key fields as a general rule. The Profiler shows each statement of the query executed, with statistics on each statement. Statements can be grouped by a number of properties, including duration. A period of activity can be saved as a “workload”, which may be played back at a later time or used by the Index Tuning Wizard (don’t let the term “wizard” fool you, this is an *excellent* tool). Other performance factors include the structure of query/search arguments (known as SARG’s), the existence and usefulness of indexes, the availability of statistics, and the CPU usage factor. Covering indexes are indexes which have all of the necessary search information in the non-clustered indexes. There is no equivalent to this type of index in VFP. Chuck then demonstrated, using almost identical queries, techniques for applying proper types of indexes to increase speed and control the types of joins which SQL performs on submitted queries. All three types of joins (nested, merge, and hash loop) have their pros and cons. Nested joins, the default, are helped by non-clustered indexes. Merge joins take advantage of “sorted” tables (those with a clustered index) and are very efficient. Hash loop joins, while efficient, require LOTS of memory. Evening Keynote Presentation: The Future of Visual FoxProby Evan R. Pauley We’ve been officially “welcomed” now (the normal Sunday night “welcome session” was postponed until this evening) and most of us have migrated to the main conference room for a special “bonus session” about the future of VFP, Visual Studio .NET, and the new Visual Tools for Office. The goals for Visual Tools for Office were to integrate the .NET development environment with the long-known object models for Office. The CLR loader will be part of Word 2003 and Excel 2003 as long as the users have CLR on their machines (Office won’t ship with the CLR). There now exists a document on MSDN detailing the plans for this technology and additional plans for Office 2003 and Visual Studio .NET interoperability. Ken Levy demonstrated some of the new features of Visual Studio .NET 2003, including the ability to edit while in the debugging window (Ken, rather jokingly, stated this will only be available in VB.NET and not C#), and the ability to more smoothly add data sources and bind them to controls (sort of like VFP already has). Randy Brown, the lead designer and architect of VFP, then launched a discussion of some of the proposed new features for the next version of VFP, code-named Europa (yes, it’s a moon of the planet Jupiter). The VFP team’s goals included basing enhancements on the UT wish list/customer feedback, maintaining backward compatibility, enhancing the database language and types, significantly enhancing the Report Writer (FINALLY !!!), and extending interoperability with XML, .NET and SQL Server including more designer hooks for third-party extensibility. The proposed enhancements to the report writer include the ability to output to various additional formats, objectifying and opening the architecture, and the ability to plug in external components – all without losing the developer’s current investment in FRX report designs. Support for international fonts, English/metric measurements in the grid scale, design-time labels, protecting reports from modifications, design-time events, and two new system variables called _REPORTBUILDER and _REPORTDESIGNER are all in the design stage. At runtime, the report writer will allow object-oriented syntax, increased flexibility for chaining reports, and processing events while the report is executing. Randy then proceeded to play several videos of Calvin Hsia, one of the lead VFP developers, as he demonstrated the new “background compilation” feature, which attempts to compile a line as it is being entered and changes the color of the line if a problem is detected. The 65K limit on array size has been removed (limited now only by available memory), as has the 65K limit on the size of a procedure inside of a PRG. SQL changes include no limit to the number of joins, subqueries, unions, tables, and arguments inside of an IN() function. Multiple subquery nesting is now also allowed, as are GROUP BY in a correlated sub-query, sub-queries in a SELECT list, ORDER BY clauses using a field name with a UNION clause, and UNION commands inside an INSERT. Europa will also add some new data types and data functions, including Timestamp, VarChar, the CAST() function (just like SQL Server), the *very cool* ICASE() function (an “immediate CASE” that works like an “immediate IF”), and binary indexes (these can be over 30 percent smaller in size than regular indexes). No new version of VFP would be complete without UI enhancements. Forms are now dockable, along with most IDE windows. There are new properties for “anchoring” form windows with auto-control resizing, including both absolute and relative anchoring in containers. Separate text and picture alignment, along with word wrap, is now allowed in command buttons and check boxes. Collections can now be assigned as a RowSourceType in list boxes (and, hopefully, combo boxes and grids as well), along with the ability to dynamically rotate labels. A new property of lines and shapes called PolyPoints allows creation of many different lines and shapes with fill colors and patterns. PRG’s can now be opened in the Class Browser, which is also now dockable. The Expression Builder now supports syntax coloring, and default values may now be entered in the New Properties dialog for a form or class. The new _MemberMeta property would contain XML declarations of attributes for a particular property or method in the Property Sheet (including capitalization). As Doug Hennig, from Stonefield Systems Group in
VFP and .NET Working Together by Evan R. Pauley 2:00 pm Another .NET session – this one about VFP and .NET working together. Cathi Gero from Prenia Software and Consulting in Redmond, WA begins her session by warning that Kevin McNeish might be heckling from his session next door (which drew immediate chuckles). The advantages of VFP 8 when working with .NET include greatly enhanced XML support with the new XMLAdapter class, which allows multiple tables with relationships to be output into a single XML stream or document, the ability to work with XML DiffGrams (which work with only the modifications to the data rather than the entire table. Additionally, the VFP OLE DB provider has been enhanced for ASP.NET Web forms and Web services, along with .NET Windows forms. When using VFP 9 with ASP.NET, remote access to VFP information through HTTP is available. Since ASP.NET scales well across Web farms and is platform-independent, your VFP applications can now support non-Windows users. In addition, since ASP.NET auto-generates HTML based on the client type, using ASP.NET not only handles transparently different browsers and browser versions, but also opens your applications to mobile device clients such as Pocket PC and Web-enabled mobile phones. Cathy stated that ASP.NET utilizing XML Web Services is the best solution for IIS web configuration, scales better across Web farms and multiple servers, and has a smoother interface than VFP for IIS/HTTP interfaces. Cathy then proceeded to demonstrate the design of an N-tier medical application, using an XMLAdapter class in the VFP-written business (middle layer) object. This was the same application which Ken Levy demonstrated in Monday morning’s keynote address, only more in depth. Pushing the VFP 8 Report Writer to the Limit by Evan R. Pauley 3:45 pm On now to a somewhat tender subject with most VFP developers: the Report Writer. Ever since VFP 6 came out, most have been begging for some improvements in VFP’s report handling capability. Cathy Pountney from Optimal Solutions in Grandville, MI is the foremost expert on this subject, and this intensive session was chock-full of tidbits, tips and tricks which had everyone in the room reaching for note pads and pens. Cathy first showed some of the design-time improvements, including the new Printer Environment check box which (thankfully) removes the need to manually clear the hard-wired printer information that is stored about the default printer on the developer’s captions* (where before, you were required to add a label control), and the new default values on the Reports tab in the Tools/Options dialog for saving the printer environment, using DBC field captions, and the default report font. Cathy then moved on to the actual task of executing a report. There are two ways to auto-maximize the Preview window; one, stuffing the keyboard with Ctrl-F10, works the first time – but, since that keystroke is a toggle, and is stored in the FOXUSER resource file, the next execution of the report will un-maximize the window. Cathy’s smoother solution: place a ZOOM WINDOW “Report Designer” MAX statement in the Init() method of the DataEnvironment (no tables are required in the DE to do this). You can suppress the “Printing …” dialog with the NODIALOG clause of the REPORT FORM command – but this should NOT be used in a COM object. If you are using this clause with either the PROMPT or PREVIEW clauses, the NODIALOG must be after the PROMPT clause and before the PREVIEW clause to correctly operate. You can determine whether the user is previewing or printing the report by checking the SYS(2040) function. This function returns a *character value* of “0” if no report is being executed, “1” if the user is previewing, and “2” if the user is printing. You can “chain” reports by using the NOPAGEEJECT clause (to keep the print job open) and the NORESET clause (to keep page numbers from resetting after a report). If you are chaining reports in a SCAN loop, you must manually close the print job – to accomplish this, execute a dummy report with no output and neither of these clauses. You can use the new _PAGETOTAL system variable to get the total number of pages for a report, which allows you to print “Page X of Y”. This forces a “double pass” through the FRX. The first pass is only to set the system variable; if UDF’s are being called, the developer needs to be certain that these only fire on the second pass (to accomplish this, check for _PAGETOTAL > 0 before executing the UDF). When combining fields in a single control (ie, Address1 + Address2 + City + State), it is not necessary to check each field for emptiness or ALLTRIM() each field. A semicolon between two fields says “add a CR if one of the fields isn’t blank”; a comma between two fields trims the fields and adds a space if one of the fields isn’t blank. If your labels don’t stay even with your “floating” fields, add a line control with a white color between the controls you wish to keep “level” with each other. This will force the labels to be maintained at the top of the floating field to which they reference.
Using Event Handling in VFP 8 by Evan R. Pauley 8:00 am Markus Egger from EPS Software in Houston, TX presented the first session of the day on the new event handling features of VFP 8. Marcus, among many other things, is well known as a several-time Microsoft MVP in VFP and is also the architect of the Voodoo Web Controls. In an object-oriented methodology, an event is some occurrence that asynchronously “happens”. The event itself is referred to as a “delegate” (think “pointer to another piece of code”). Events can have “signatures”, or various parameters which are passed to that piece of code. An “event handler” is, then, simply a method that reacts to an event. All VFP controls raise events, and have their own event handler methods. However, event handler methods are NOT the same as the events, even though they may have the same name (for example, the Click() method of a command button is not the same as the Click event; the method is the event handler). In VFP 7 and before, you could not alter which piece of code the event used as its event handler. VFP 8 can now attach *any* piece of code to any event with the BINDEVENT() function. The piece of code will fire *in addition* to the previously bound event handler, and the developer, using properties of the function, has a certain amount of control as to the order in which these pieces of code fire. The UNBINDEVENTS() function reverses the process and detaches all event binding added by the developer (the native VFP event handler is left intact). To determine what is firing when, the AEVENTS() function returns an array information about the last event that fired. The RAISEEVENT() method fires all the attached event handlers in the specified order. Deploying your VFP Applications with InstallShield Expressby Evan R. Pauley 9:45 am We’ve been learning about how to write apps; now we get to learn how to install them. Andrew MacNeill of AKSEL Solutions in Canada has the next session, Deploying VFP 8 Applications with InstallShield Express (interestingly enough, he has subtitled his session “I already paid for one tool – I don’t want to pay for an installer too”). If you never need to deploy an application, you don’t need to learn about an installer (smile). But, since most of us must deploy our work to users occasionally, and since XCOPY just doesn’t seem to do the job in the Windows world anymore, the Windows Installer was born about halfway through the development process for VFP 6 (six). Windows Installer makes use of “merge modules” which tell the installer about all the necessary files to include in the installation, and tracks the files being used to reduce the chance of deleting a shared file. Unfortunately, the Installer interface for creating a merge module was overly complicated to use and maintain, and used the Setup Wizard (which most developers hated). Starting with VFP 7, InstallShield Express 3.0 (ISE) replaced the Setup Wizard. ISE 3 was a “customized for VFP” (read: ”limited”) version of the actual ISE 3 product, which was a limited version of the professional version – basically, a wizard of a wizard. This was considered “two steps forward and one step back” by most VFP developers, especially when they discovered the limitation of not being able to run any specialized code after the setup had been completed! Additionally, since ISE uses a scripting language (which can be somewhat arcane), using the tool required the developer to learn yet another syntax. VFP 8 includes version 3.5 of ISE, which is a considerable improvement over the previous incarnation. ISE’s interface allows the developer to control MOST (but not all) of the properties of the Windows Installer merge module that ISE builds. Andrew proceeded to describe the organization of ISE, how to add features and install COM objects along with your application, how to specify which operating systems on which your application will allow itself to be installed and in what locations, what additional software shortcuts are desired, and how the target system should be configured. Database Performance with VFP 8 and Windows XPby Evan R. Pauley 2:00 pm The final “content” session of the day concerned VFP 8’s performance with large databases, presented by Mac Rubel of EPS Software in Houston, TX. Mac has a long history and excellent reputation in the VFP world performing these type of benchmark tests with VFP and its data performance. Mac’s test machine was a 2.4 GHz processor with one 40GB and one 80GB hard drive and a 100 Base-T network card. Mac’s benchmarking methodology attempts to minimize as much as possible the Heisenberg principle (which states that the act of observing changes the conditions of the test, and therefore alters the results). Before each test, Mac wipes the 80GB drive and restores from another drive the exact image in the exact order.
The SYS( 3050, n ) function (everybody knows this one off the top of their head, right?)(mmm-hmmm, that’s what I thought) returns various “amount of memory available” values. VFP slows down precipitously when the operating system “tricks” VFP into thinking that it is working with real memory, when in fact the OS has allocated “virtual memory” (read: disk space). This doesn’t happen often, since VFP is reasonably smart about these things, and usually only occurs when several applications are running simultaneously or several large data sets are being handled at the same time. Mac’s databases sizes for testing bump up against the 2GB file size limit imposed by VFP. Mac demonstrated that as table size increases (and therefore the use of memory increases), VFP has enough intelligence to maintain a consistent, flat curve in its speed of indexing the table. Surrogate keys are ALWAYS better than meaningful keys for business purposes, and integer keys will ALWAYS perform about 7% faster than BINTOC() keys, about 22% faster than character keys, and about 25% faster than numeric keys regardless of the table size. Mac also showed that increasing CPU speed does not necessarily show a corresponding increase in execution speed. In fact, increasing processor speed only provides a small percentage increase (usually 5 to 15 percent); increasing disk size, speed and/or throughput is better, but only slightly. When comparing local access vs. network access to a LAN server, SQL SELECT statements are faster on the server because of the more efficient caching on the server, regardless of the speed of the network. Indexing, however, varies based on the speed and the topology of the network (switches are faster than hubs, and so forth). Both LAN scenarios vary widely depending upon what other network usage tasks are being performed. Memory size causes the most variance in performance. When indexing 1 million records, there is a large drop in speed when available memory is increased from 128MB to 256MB, but the curve is almost perfectly flat with greater memory values. Above 512MB of memory, few if any performance benefits are achieved.
62 Rue Doucet, Petit-Rocher, New Brunswick, E8J 1L3 Telephone: 1-506-783-9007 Email: mfournier@levelextreme.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||