Level Extreme .NET Magazine April 2008 issue

Universal Thread Magazine March 2007 issue

2008
2007
2006
2005
2004
2003
2002

2006
2005
2004

2007
2006
2005
2004

2007
2006
2005
2004
2003

2007
2006
2005
2004
2003

2007
2006
2005
2004
2003

2004
2003
2002
2001
2000
1998
1997
1996
1993

2003
2002

2003
2001

2003
2002
2001

2003
2001

Visual FoxPro 2001
Visual FoxPro 2000
Visual Studio 2000

West Wind 2002
Double Impact 2001
FoxTeach 2001
Jam sessions
Technical Guidelines

Universal Thread documentation

About
Acronyms
Contact information
Troubleshooting
Time zones
Web Service
Terms & Conditions
Copyright

Manage your account for the messages area options, your subscription information, your invoicing, youir banners and your pictures Subscribe to the Universal Thread and get all the benefits related to the messages area A corporate subscription is needed for companies that have more than one developer Access the Universal Thread store to purchase your subscription, corporate subscriptions and banners The Universal Thread is covering several conferences per year. On site, reporters cover the technical aspect of the conference as well as making interviews, taking pictures and videos and other related content. Get all the reports from our coverages site. Universal Thread home page Level Extreme .NET Magazine, a newly published online magazine by Level Extreme about Microsoft .NET technology and its community Universal Thread Magazine, a magazine dedicated to the Visual FoxPro community DevTeach 2003

DevTeach offers a new breed of conferences. Sessions will include both presentation material and hands-on training. Traditional conferences had session leaders present material using a PowerPoint presentation, usually with some preprinted take away material. DevTeach sessions will add, whenever possible, hands-on training conjointly with the presentation. Attendees, equipped with their own laptop and wireless access card, will be able to try and test the concepts presented at the time of the presentation. This new concept is designed primarily for developers, but will not distract the others who may not be at that level. This conference will promote the latest Microsoft developer's tools.

Date: 
Location: 


Rick Strahl's training
Pre-DevTeach event on Thursday

Trade show
Saturday during preparation

Welcome reception
Sunday night

Jean-René, YAG and Ken
Before lunch on Sunday

Lunch
Sunday

Trade show
Sunday afternoon

Trade show
Sunday afternoon

Chuck Urwiler
Monday

Doug Hennig
Monday

Claudio Lassala
Tuesday morning

Claudio Lassala
Tuesday morning

Guy Barrette, Eric Moreau, Martín Salías
Tuesday lunch

Speaker's picture
Closing session

Carl Franklin playing guitare
Closing session

Overview

by Michel Fournier

Welcome to our report of DevTeach. DevTeach presents a new breed of conference. Sessions will include both presentation material and, whenever possible, hands-on training. In spring, the developers community will meet in Montreal for this international event. Our report will be the offical coverage of the event. As usual, we will bring you coverage on various topics such as conference sessions, keynote, roundtables, panel discussions, bonus sessions, closing session and Trade Show. For our first coverage of DevTeach, our team will include me, Claudio Lassala and Martín Salías. Claudio has already worked on two coverages so far and Martín will do his first. Both have strong experience in writing and we look forward to bring you the best of this conference.

 
Michel Fournier, Level Extreme Inc. 
Michel Fournier is the owner of Level Extreme, designer of the renowned Universal Thread. He specializes in using Visual FoxPro and .NET as Internet resources as well as the development of Visual FoxPro desktop applications. His expertise has been used in feasibility study, prototyping, analysis, development, training, development team integration, standards implementation and testing. His consulting services have been given to clients in Montreal, Toronto, Quebec, Bathurst, Moncton and the United States. In the last years, he has given various training and consulting related to Internet and Visual FoxPro for user groups and companies while having published various articles for different sources. You will find the biggest Internet product achievement he has done by accessing the Universal Thread. He has been using Visual FoxPro since 1988 and .NET since 2002. He has been a Microsoft MVP in 1997, 2002, 2003, 2004, 2005, 2006 and 2007.

Saturday, May 10

SQL Server Development for VFP Developers – Jim Duffy

by Claudio Lassala

This pre-conference session, presented by Jim Duffy, from Take Notes and Red Matrix, provides the attendee the basics information about client/server software development, using VFP and SQL Server, showing some of the options to write VFP code to access data, basics SQL Server features, and also the creation of a data class from scratch, based on his DataClass product.

Jim stated very clearly that he would be focusing on the development using “real” databases; which means no databases like VFP native database, Access, Paradox and so on. Taking for example the VFP native databases, it is in reality only a “file-based” database, which means that what it does is only data storage. “Real” databases, on the other hand, provide some built-in capabilities that make them robust solutions for data, as live backup, security, no data corruption and so forth.

He also emphasized the importance of using MSDE. MSDE is a “desktop engine” database, which is actually SQL Server’s data engine without the administration tools. One of the most important aspects here is that MSDE is free, therefore the developer can use the full SQL Server product during development (in order to benefit from the administrative tools), and then ship his application to clients who really don’t need to buy SQL Server licenses right away.

By doing that, the developer can build the application using a client/server architecture from the beginning, even if there will be only one user for that application, and he’ll be prepared to scale very easily at any time, following the growing process of his customers.

MSDE has a “5 simultaneous queries” limitation (what’s different from a “5 users” limitation, as several people usually think). That means that in a scenario where you have 20 connections, for example, it most likely be quite good for a high number of scenarios, since each query usually executes pretty fast, therefore the limitation should not impact at all. Another limitation includes de 2 Gb for tables (which is the same for DBF files), so that’s something to keep in mind if the client has the need of storing big amounts of data.

Once again, the important point here is that MSDE is a free product, and therefore we can start building client/server applications from the beginning, and once we’ve got to the time to scale up our app, it’ll be just a matter of the client buying some licenses for the enterprise version of SQL Server; no changes to your application shall be made.

Talking a bit more about the advantages of using SQL Server rather than DBF files, it was mentioned the following features of SQL Server: Security, no data corruptions, easier maintaining in large enterprises and scheduling jobs.

As far as security goes, Jim told us that in DBF files, everything has access to them: we can just open up a DBF file in Excel, update it, and that could potentially mess up with or application and data. In SQL Server though, it’s like if we give the key to our house to someone else. This person could enter our house (our database), but it could do nothing more than that if we didn’t give the keys to another places of our home (our tables, stored procedures, and so on). That means that we actually have a great level of granularity as far as security goes for “who” can access “what” in our database; from the entire database, passing to stored procedures, tables, fields, etc.

Another great feature is the possibility of doing live backups, which is doing backups without the needing of close the tables and database and that kind of thing.

All that’s been said so far was about the administrative side of SQL Server; the programming side came following that.

Basically, we can get SQL Server’s data from VFP sending SQL statements to be executed by the server, or calling Stored Procedures that are available over there. There are some advantages of using Stored Procedures (this is Jim’s preferred choice, by the way): first, the Stored Procedures are compiled, so that leads to a faster execution, since that SQL strings sent to the back end are going to be compiled at runtime, and that takes time to get it done. Second, when we are creating the Stored Procedure in SQL Server, it will validate our code, looking for any kind of syntax error; on the other hand, when we’re building a SQL string on the VFP side, it’s impossible to catch syntax errors since VFP’s compiler can’t determine (all it sees is strings, which are fine for it).

Moving on, Jim mentioned that we can access the database by using either DSN or DSN-less connections. The first one means that we have to create a ODBC DSN connection on every client, which is a cumbersome task. But with DSN-less connections, we can build the connection string on-the-fly, therefore we don’t need to create anything on the client. This is by far the preferred choice to accomplish the goal of establishing connections in our programs.

Among the techniques available that we can use in VFP when programming client/server applications, Jim showed: Remote Views, SQL-Passthrough and ADO (the first two being built-in in VFP and ADO being the COM-based Microsoft solution for accessing data).

We had a briefly speech about Remote Views (Jim doesn’t like them that much): between the pros of this approach it were mentioned the capability to attach remote views to the data environment of the form, the built-in support to updates, and a few other aspects. As for the cons, there’s the fact that a DBC file is required in order to store the view definition, the lack of support for calling stored procedures and the fact that only DSN connections are available (meaning that we always have to create the ODBC connection in the client).

Now, about SQL-PassThrough (SPT), this is the technique that provides better control on how we get data: we use the SQLConnect or SQLStringConnect to establish a connection to the database, then the SQLExec to send SQL commands to the database (there are a few other functions for SPT, but they were not covered in this session).

When we use the SQLExec function, it will return the results as VFP cursors. That’s great for binding the results to the Grid control or other controls, for example. This cursor is read-write (we add rows, change them, delete them), but they’re not updatable (the changes are not sent back to the database). Through some coding we can make those cursors updatable, but Jim preferred to use a different approach to send changes though.

We then entered the ADO part of the session. The ADO is a collection of objects that we can use to access and handle data in an object-oriented fashion (for instance, using methods to perform actions, and properties to access data).

Jim explained a little bit about ADO’s RecordSet, which is kind of an “objectified cursor”; that is an object that has rows and columns. This is nice because we can pass data through layers, what can not be done with VFP cursors.

However, Jim emphasized that the main focus would be ADO’s Command object. This is an object used to send commands to the backend. The main approach demonstrated was the ability to populate a collection of parameters in the command object (those parameters must match the parameters that the stored procedure is expecting to receive), and then call the stored procedure: the command object takes take of rest.

Then we got back to the administrative side of it, exploring the basics of SQL Server’s Enterprise Manager and the Query Analyzer. The Enterprise Manager is the tool that we use to manage our databases, by creating brand new databases, tables, stored procedures, triggers, defining security roles, jobs, and so forth. The Query Analyzer tool is used mainly to run SQL statements and analyze execution plans.

Among recommended data design techniques, Jim made it very clear his opinion about a topic that’s been always controversial: Primary keys – when should we create them? In his point of view, we should ALWAYS create primary keys (and they always should be surrogate keys – meaningless values). Yes, for every single table, no matter what, always create a primary key.

After all of that, Jim started writing from scratch a simple data class: this class have some simple methods like Save, AddNew, Delete, FindKey (which looks for a given PK in the table), and so forth. The basic architecture in his class is: for getting the data, use SPT, given its capability of returning VFP cursors; for updating the data, use the combination of ADO’s Command object and SQL’s Stored Procedures. That’s an interesting approach, and according to Jim and Rod Paddock (who’s the main architect behing the DataClass product), they reached this conclusion after had testing a whole bunch of ways to accomplish the goal of client/server programming.

Another technique built-in in VFP 8 to access data, the CursorAdapter class, wasn’t mentioned at all during the session, than I raised the question at the end, whether they were planning to use it at some point in their DataClass product. The answer was that their classes have been so thoroughly tested through all this years and had been proven quite solid, so it doesn’t make much sense in insert yet another technology (a new technology that’s just arriving) in an already mature product.

I have to say that you should take a look at RedMatrix web-site and find out more information about this DataClass; it’s at a minimum a very good way to learn a nice approach for client/server developing.

Although this was a 4-hour long pre-conference session, I can tell you that it was pretty interesting and the hours passed by very fast because of the highly interesting topic, and the very good speaker that’s Jim Duffy (he could be invited to SNL sometime…).

 
Claudio Lassala, EPS Software Corp 
Claudio Lassala is a Senior Developer at EPS Software Corp. and a part time Universal Thread Consultant. He has presented several lectures at Microsoft events such as PDC and various other Microsoft seminars, as well as several conferences and user groups in Brazil and North America. He is a multiple winner of the Microsoft MVP award, holds the MCSD.Net certification, and is also a columnist at MSDN Brazil. He has articles published at several magazines, such as MSDN Brazil Magazine, FoxPro Advisor, CoDe Magazine, UTMag, Developers Magazine, and he is also the author of several training videos that can be found on the Universal Thread.

Visual Studio .NET Fundamentals, by Rod Paddock

by Martín Salías

This was my first session at DevTeach, right after I arrived to the Chateau Champlain Hotel with Michel, who brought me from the Montreal Airport together with Ken Levy.

Rod is a great speaker. He obviously did this kind of presentation many times, and even as this was an introductory one, it is really a challenge to pack so much information in so little time.

He explained the basic .NET concepts, explaining the number of components and technologies behind the whole thing. He started with the Common Language Runtime (CLR). The CLR is a runtime (much as Visual Basic or Visual FoxPro's ones) but a really huge one, and with a highly structured architecture behind: the .NET Framework.

The CLR doesn't really execute any other language than Intermediate Language, which is the one all the .NET languages compilers generate. Some of the languages currently compiling to IL are: Visual Basic.NET, C#, J#, C++.NET, Eiffel, Cobol, and many more.

The .NET Framework is the other major component, and it exposes most of the operating system's functionality, and a host of external things like devices, databases, and more. All of this is structured in a hierarchy that includes literally hundreds of classes, including, for example:

The developer user interface for all that resources is Visual Studio .NET. As Rod calls it, it is .NET's shell. It is and Integrated Development Environment (IDE) that has all the needed tools to create, manage an deploy Visual Studio .NET applications.

Development under .NET brings up a quite novel approach to programming: ASP.NET Web Services. While XML Web Services is storming the development world, Visual Studio .NET provides an incredible interface to develop, test, debug and deploy Web Services, always trough the same IDE, in a highly integrated fashion.

And, of course, you can still developing Windows Forms, but also Web Forms with much the same methodology, without needing to delve deep in all the petty details of traditional web programming.

The first "hands-on" part of the sessions started entering the Visual Studio .NET Shell. This is a dreamed IDE with lots of useful features and development shortcuts. It's main functionality includes:

  • Creating VS.NET projects
  • Debugging applications
  • Integration with Visual SourceSafe
  • Deploying Web Projects

The first step you have to do to develop with Visual Studio .NET is to create a new project. The Shell provides a nice interface to do this, which is organized by language and project type.

(Disclaimer: The screenshots are taken from my own laptop, where I have Visual Studio 2003, while Rod was showing VS.NET 2002, but the images I'm showing don't have much differences. If you see some silly name or type, is my contribution, not Rod's <g>)

Visual Studio Project type selector

Some of the projects types that can be created are:

  • Windows Forms Application
  • Web Forms Application
  • Web Services
  • Windows Services
  • Deployment and Setup Projects

And again, much more, plus combine all this with the language of your choice. As Rod said many times: "Pretty cool, uh?".

One of the first IDE features he showed were Explorers. VS.NET Shell does extensive -and efficient- use of the hierarchical navigation system so well known by any developer or Windows user. You have explorers to access projects, database servers and objects, windows services, etc. Here is a small example:

Solution Explorer

One thing we all take for granted that every development IDE has to do is an Editor. But Visual Studio .NET editor is simply fantastic. It sports a great number of nifty features as block selection, an excellent Intellisense implementation, intelligent auto-indentation, collapsible views for the different code levels, and much more. Of course it has color coding, language syntax checking, and all the other usual features, but even more intelligent than in any other editor we have seen.

The Task Manager allows you to add special comments to the code, from the Task Manager itself or right in your code. For example, Rod added a special TODO comment and it automatically showed in the Task Manager. There are also shown compilation errors, and in any case, a double click there will get you right to the related position in your code.

Visual Studio .NET has so many configuration options, that the option dialog seems almost a whole application. Take a look at it in the following screenshot:

Visual Studio.NET Options Dialog

Visual FoxPro 8.0 developers looked each other with a suspicious smile remembering VFP new Task Pane, because the interface is so similar. Of course, it's not a coincidence, but VS.NET was the first.

So we finally got our hands dirty in code when he started showing a sample Windows Form application. For most of the examples, and just for the matter of simplicity, Rod used VB.NET. He polled the audience to see how many were Visual Basic or Visual FoxPro developer, and his decision was proven wise. Nobody felt uncomfortable about the syntax.

Windows Forms has a nice set of controls known as the WinForm Classes which provides almost anything you need to create rich windows applications. Rod recalled how do you have to depend on a lot of third party controls and many dangerous dependencies in VB, and how Visual Studio is more like Visual FoxPro in this sense, as it has a complete set of powerful controls incorporated. Indeed, a lot of controls, with a great deal of flexibility.

While showing some of the sample code, Rod showed how easy is to write it thanks to all the information available all the time trough Intellisense, and the guidance of the editor, always keeping us in the good track respect to syntax issues. He explained that .NET learning curve is not related to languages, but to the immense Framework class hierarchies. There is where anyone will spend most of the time while learning and mastering .NET.

Something you have to get accustomed to at the very beginning is to how .NET events are handled. While in VB or VFP events are directly related to an object or control, in .NET they have their own existence, and you decided to which control it will be attached.

Take a look at this simple example. He dropped a couple text boxes and a couple buttons on a form like this:

Then he double-clicked the first button and entered something like:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
 Handles Button1.Click
   Me.TextBox2.Text = Me.TextBox1.Text.ToUpper.Replace("A", "123")
End Sub
We learned a few things from this tiny piece of code: first, he's referring to the form as Me, because this code actually belongs to the form, not to the button. Button1_Click is just a name. Second, everything in .NET is an object, and you can use all it's method in a chain, like in this case, ToUpper and Replace. And, again, finding out where those methods are as simple as scrolling around the Intellisense list, and look at the parameter details.

In this example, he just took the text entered into the first textbox, put it in upper case and replaced any a letter by the string "123" (pretty weird example, he admitted). Here's the result after clicking the first button.

But then he changed a single character in the code. He replaced the "Handles Button1.Click" at the end of the event declaration by "Handles Button2.Click", ran it again, and now the second button responded, not the first. This shows how independent events are from its handlers.

Other funny things he did to show us how actually everything is an object was:

Me.TextBox1.Text = "DevTeach".ToUpper()
Yes. As a string (even a constant) IS an object, you can issue a method just like that. And of course, all object consistently share a great deal of common methods. For example, every variable type has the ToString() method (except the string type, of course).

He went on showing great features as the ability to debug a running executable if we build it with debugging information. It's quite cool to be able to set breakpoint over an executable, isn't it? Well, you can even do this remotely with an executable running on another machine!

After showing a couple more WinForm things, Rod switched to ASP.NET. For everyone that developed web applications in any other environment, this is something incredible. You paint controls on the page and write event code as you do with WebForms applications. There's almost no difference. Of course not under the hood, but ASP.NET takes care of almost everything.

Controls seem to be stateful, but they are not. Rod showed that if look attentively to the browser status bar, there is a roundtrip to the server when you submit anything, but you don't have to take care about this, nor session control, etc, in your code.

And you have a very rich set of controls, considering the limitations of HTML, which is the underlying technology behind all this: Labels, Textboxes, Buttons, and all the usual HTML stuff, but also a nice DataGrid, a Calendar, an AdRotator, Validators, etc.

Did you write validation code to check for mandatory fields in a Web form? If you did it in ASP or something else you'll remember it used to take a few lines of code. In ASP.NET, you just drop a RequiredFieldValidator control on your page (for example, under the given textbox), and fill up its ControlToValidate property (of course, you don't have to remember the textbox name; you just select it from the list in the properties windows).

When you see the page in your browser and click any button, the page will refresh with the Validator control visible (by default, in red letters). Lines of code involved = 0.

However, you do have control over all the particular things that a web page actually has. For example, you have a PageLoad() event which fires every time a page is rendered, whether for the first time or in any refresh, but if you want to take some specific action in one of these cases, you have the IsPostBack() property of the page that tells you how did it get refreshed.

After a coffee break, Rod get us into the hot Web Services topic. He explained what they are in a simple way: "A Web Service is a set of function that you call over the web". That's crystal clear for me.

He showed us how simply is to create a basic Web Service. Just create a new ASP.NET Web Service project, switch to the Code View, and you have a Hello, World web service commented out ready to try it.

<WebMethod()> Public Function HelloWorld() As String
   Return "Hello World"
End Function
Can you imagine something simpler than that? What this sample code teaches us is that we have to precede out function with the <WebMethod()> clause to make it accessible trough the web service. The we just need to return some value, and we're finished.

Of course, we can make things a little more sophisticated. Rod added some parameters, put a couple more functions, and showed several things to have in mind when programming Web Services. For instance, there's not, by now, any specific security method. The most common approach is to add a username/password parameter pair to each function call, and you can also use HTTPS to communicate, as you do to secure access to a web page.

Something good about developing Web Services with Visual Studio.NET Shell is that it generates a nice environment to test them. You don't need to write code to check them. When you run the project, a web page is generated showing each one of the functions you wrote in, an when you click on some, another page ask you for its parameters, and after confirming it, it displays the result set.

Consuming Web Services is just as easy. Rod showed how to do it over some of the previous Win Form and Web Form samples he had just wrote.

Rod showed how we should add a Web reference to a web service in a Win Form or Web form project, and he had to enter the Web Service location manually, but said that in the new version the Add Web Reference dialog is improved to make it easier. It is. You can look it in the following screenshot how you have direct access to Web Services located in different places:

After you added the Reference, choosing a name for it, you call it as simply as any other function or method:

Dim oWS As New luke.Service1
Me.TextBox1.Text = oWS.HelloWorld()
Rod warned us that we should be careful when designing the Web Service interface because when we make a change to it, we have to refresh all of our client's references. But we can try to make it flexible enough so you don't need to.

Also, Web Services are a good way to separate logic from user interface, thus separating tasks in a development team. I think that this have to do with the tier architecture rather than Web Services in particular, but it surely applies to them.

Jim Duffy (his partner at Red Matrix Technologies) entered the room during the session, and seeing what user interface Rod had on screen, he yelled: "What ugly!". Everyone laughed and Rod said that Jim's the one doing the artwork thing, and he takes care of the logic. This is task separation at work.

The next topic was about Programming Concepts, and it included a detailed explanation about strong typing, shortcuts like declaring and initializing variables in the same line, etc.

Dim x as String = "hi"
He also explained the concept of namespaces and how you can access the inner .NET Framework classes by including an Import clause (or just by using the whole namespace "path" in a given call).

He also explained the Try/Catch/Finally structured error handling mechanism, and a few hints abput the correct use of OOP in .NET, but it is too much to include all the details in this review.

Finally he arrived to Data, doing an overview of ADO.NET, and the new DataSet object. Basically, a DataSet is a Collection of RecordSets (you may know those from the old ADO control). Or you can see it also as an in-memory representation of a whole database, including all its tables and relationships.

Also, ADO.NET goes beyond from OLE DB providers, adding some additional and improved data access options, like direct access to some database engines al SQL Server, or Oracle.

Closing the session, after a few last questions, he recommended some books to get started, basically the Unleashed series, and the C# book from MS Press.

Overall, Rod Padock demonstrated why he is such an appreciated speaker. He compressed a terrible amount of information in just a few hours, and everyone at the session ended up with a clear understanding about what .NET is, and the fundamentals to start trying it. And indeed, he finished ten minutes earlier!

 
Martin Salias, Microsoft South Cone 
Martin Salias (Buenos Aires, Argentina) is currently acting as an Enterprise Architect for Microsoft South Cone. He has 25 years in the software industry working with several different platforms and languages, working for organizations ranging from the United Nations to Microsoft Consulting Services. He is Editor in Chief for Level Extreme .NET Magazine, a member of the Agile Alliance, and a Microsoft MVP.

Keynote

by Claudio Lassala

Jean-René, one of DevTeach’s hosts, started the keynote, saying that this was a project carried out by him and Richard Mertl, and they did their best to make it a great conference made by developers to developers, and also a great community meeting.

Very important, one of the biggest features of this conference is the high speed Internet wireless connection available in all of the conference’s room and at the tread-show. This good not just for people who had to keep doing any kind of work through the web or just check their emails, but also for some conference-specific items: for example, the evaluations of the sessions can be done online, as well as all of the sessions material is available online (PowerPoint presentations, sample code, white papers and so forth). That’s really an impressive feature.

JR (as he allowed us to call him, as that’s much easier to pronounce and remember the spelling), thanked the sponsors, who helped a lot to make this conference a reality: Universal Thread, EPS Software Corporation, CoDe Magazine, Formation 3-Soft, Analystik, dotBlox, F1 Technologies, Stonefield, West-Wind and Xceed.

Then JR presented Microsoft’s Yair Alan Griver (YAG) and Ken Levy. They’re both very known for the VFP community.

VS.NET 2003 and VFP 8

YAG took over introducing himself, saying that 9 years ago, Ken Levy used to work for him at some company, then Ken left it to go to Microsoft, and now YAG is back to Microsoft, with Ken working for him again. He made people burst into laughing by saying: “You see? Ken can run but cannot hide!”.

All joking aside, YAG said the main focus of the keynote would be the current and future versions of both Visual FoxPro and Visual Studio .NET.

Visual FoxPro 8.0

Ken took over to speak about VFP 8, that’s the newest version of the product. He mentioned about some of the new features, like the Task pane (a kind of portal where the developer can hang several sorts of things, from web-sites to XML data, passing also through VFP controls), the Toolbox (which is sort of a mixture between the old Form Designer toolbar and the Component Gallery), the Empty class (a lightweight class without any members), the new AddProperty and RemoveProperty functions, a Collection class, the Structured Error Handling (which provides us even another possibility to gracefully handle errors and exceptions in our code), Event Binding for native object (remembering that event binding for COM objects has been introduced in VFP 7), Enhanced view designer (fixing several bugs and providing two-way editing capabilities), VCX support for more classes, many new features for Grid control, Code References tool (which is a very powerful tool to look for code through folders and projects), XML Web Services enhancements, etc.

The XML Adapter is a great new feature. It goes beyond VFP 7’s XMLToCursor/CursorToXML, providing hierarchical XML support, XML diff grams, compatibility with ADO.NET and full control over the XSD schema.

Talking about XML, Ken stated that it is the “Universal Language for Computing”. Following that he showed a video with a few members of the Fox Team explaining how the XMLAdapter works: the big thing here was that each one of the guys in there spoke his primary language (giving the sense of an “universal” language): I was able to figure notice the Spanish, but the other ones I have no clue (well, maybe Russian and Indian?).

Another cool new class is the CursorAdapter class, which similar to ADO.NET’s DataAdapter. This class has programmable events, Stored Procedures control, access different sorts of data (native VFP data, ODBC, ADO and XML), everything using basically the same interface of the object.

Some other new data features that has been mentioned: DataEnvironment subclassing and builder, CursorAdapter class and builder, Form.BindControls property (used to delay the databinding for a form), VFP OLE DB Provider enhancements, VFP 8.0 and VS .NET interoperability.

It was said that VFP 8.0 is much better performance-wise in relation to VFP 7: according to Ken, a block of code that iterates 10.000 times creating and destroying an object that takes 24.5 to run in VFP 7, takes 0.45 to run in VFP 8.

There was great emphasis in how well VFP 8 and .NET can work together to produce several types of applications, by means of an enhanced XML Support, ADO.NET compatibility with the new XMLAdapter class, and the VFP OLE DB Provider (which lets ASP.NET Web Forms and .NET Windows Forms the capability to access Fox data.

The VFP toolkit for .NET was mentioned too: this is a set of classes which mimics over 250 VFP functions to be used in .NET. This is kind of useful because it provides wrappers to implement some operations in .NET that are not available natively as we have in VFP, like the FileToStr() or the GetDir() functions, just to name a few. It’s also very useful to learn how things are done in .NET, since all of the code is provided both in VB .NET and C#.

Ken finished this part saying that more than ever VFP and .NET teams are working together in order to provide better and more compatible tools.

.NET

YAG came back, showing a funny video meant to define .NET: by doing a brainwashing session, a guy is showing some images about .NET and the people seeing that cannot come up with good ideas about what could defining what they are seeing. Several hours after that, when they’re all leaving the place and the experts gave up hoping for any good idea, one of the guys just commented with a woman: “Hmm, that’s interesting: .NET is Software for connecting information, people, systems and devices.”. Of course that sounds funnier when you actually had seen the video, but I think you got the idea.

YAG stated that VS .NET 2002 came bringing the .NET Framework 1.0, simplified deployment, all languages under one roof, all application types under one roof, single development paradigm, language enhancements (fully object orientation – new to VB), enterprise lifecycle support (.NET Enterprise templates, Microsoft Visio for modeling), etc.

Then the .NET Framework version 1.1 came out increased bringing scalability and performance, side-by-side execution with .NET Framework 1.0, enabling no-touch deployment from the Internet, code access security for ASP.NET, ASP.NET Mobile Controls, Native ODBC and Oracle DB 7i/8i support, IPv6, and has been also included with MS Windows Server 2003 installation.

It’s been said also that we can build connected applications and do mobile development using both ASP.NET mobile controls (which will produce mobile web pages that are going to be viewed by the devices) or smart device programming (which will produce local code to be executed by the devices without the need of being connected to the web-site).

Then he said a bit about developer productivity enhancements in VS .NET 2003: startup time reduced, improved IntelliSense (most recently used commands will be defaulted when IntelliSense kicks in), dynamic help faster, object browser faster, the capability of running multiple versions of Visual studio side-by-side (VS 6.0, VS .NET 2002 and VS .NET 2003)

Enhanced “Add Web Reference” dialog, code editor enhancements, debugging enhancements, designer enhancements,

VS .NET 2003 also brings language enhancements for VB .NET, C++, C#, J#.

There are also features for the enterprise: the already know Visual Source Safe, Application Center Test (for stress testing Web services and Web applications), enterprise templates and policies (provides structures and guidance, reduces complexity).

VFP 8.0 working with VS .NET 2003

Finally, Ken took over once again to demo an application. He explained the scenario as being a VFP COM based application that had its components wrapped and exposed through an ASP.NET XML Web Service. This Web Service is then consumed by another application written using. .NET WinForms, another one using .NET WebForms, another one using a PocketPC, and yet another one using Cell Phones. XML is definitely the main mechanism that allows us to do that. The VFP component produces the data in XML format and then serves that to the Web Service, which is then accessed by all the other applications by means of XML-based protocols.

Beyond VFP 8.0 – an Europa Preview

Ken started then talking about what may come after VFP 8.0. Microsoft is currently working on the next version of VFP, code-named Europa. He made it clear that those are the features that they’re working on, but they’ll decide what is going to make to the final product according to the communities’ feedback (which is obviously something great to us!).

Among the features they’re working on are: Background compile for current line (which makes us detect syntax errors as soon as we hit enter at the end of the line), dockable forms (for user-defined forms), anchor properties for controls (similar to VS .NET), word-wrap for checkbox captions, arrays limit larger than the 65k, CommandButton Picture Spacing/Position, Intellisense available in memo fields, SELECTS supporting more than 9 joins, multiple nested queries, more designer hooks for extensibility and the long-waited significant enhancements to the Report Writer (not mentioning what those enhancements could be, though).

Ken pointed us to some VFP Resources, like the official web-site at http://msdn.microsoft.com/vfoxpro, that’s going to have some new information and content. It’s also coming soon a new VFP 8.0 Evaluation Guide, more VFP 8.0 white papers and samples and an updated VFP 8.0 OLE DB Provider (free).

For VFP developers working with both VFP and .NET, he said that a good resource can be found at http://gotdotnet.com/team/vfp, featuring the VFP Toolkit for .NET, a VFP 8.0 case study template download, a video about VFP 8.0 presented by Sr. VFP Eric Rudder. Still about resources he finalized by talking about a special issue of CoDe Magazine entirely dedicated to VFP 8, called CoDe Focus Visual FoxPro 8.0, which can be found at http://www.code-magazine/focus.

VFP Summary

In summary, we saw a little about the great new features, how it works great with SQL Server and VS.NET, the MS commitment to VFP and the community, and it was said that VFP 8 is the most stable version ever.

Beyond VS .NET 2003 – a Whidbey Preview

YAG came saying that the next version of .NET will have more integration with the new version of SQL Server (code-named Yukon), by allowing us to write Stored Procedures with either T-SQL or Managed Code, what I think it’s kind of nice, since we can use fully object-oriented languages to write code to the backend side of our applications.

There’ll be also an Office programmability, so that instead of using VBA will be able to use Managed Code.

They’re working on several RAD data enhancements, new controls (like an XP-Style list view, sound control, etc.), printing using intelligent API classes, XML Doc comments for VB .NET, edit and continue in debugging mode for VB .NET (VB developers cheered at this one), support for iterators in C# and support for generics in C# and VB.NET (there are some more official information about these features in some fully-dedicated .NET web-sites).

YAG said that the way to get VS .NET 2003 is either by an inexpensive upgrade: $29, or by MSDN Subscriptions (which will also ships with VFP 8.0).

About resources he stated that there are new certifications exams out there as well as new certification books.

Finally, YAG said that they’re trying to make members of the .NET team more involved with the community (like the VFP team is), in order to get feedback more closely with the end-users of this product.

He also said that good places to talk with experts are the Microsoft Community at msdn.microsoft.com/community and the Universal Thread, at www.universalthread.com.

Ken Levy finished the keynote by saying: “You guys have great DevTeach conference sessions. Enjoy it!”

 
Claudio Lassala, EPS Software Corp 
Claudio Lassala is a Senior Developer at EPS Software Corp. and a part time Universal Thread Consultant. He has presented several lectures at Microsoft events such as PDC and various other Microsoft seminars, as well as several conferences and user groups in Brazil and North America. He is a multiple winner of the Microsoft MVP award, holds the MCSD.Net certification, and is also a columnist at MSDN Brazil. He has articles published at several magazines, such as MSDN Brazil Magazine, FoxPro Advisor, CoDe Magazine, UTMag, Developers Magazine, and he is also the author of several training videos that can be found on the Universal Thread.

Sunday, May 11

by Claudio Lassala

Unit Testing .NET Applications - Scott Bellware

This session is meant to help the attendee getting in touch with XP (Extreme Programming), get some knowledge about unit testing, and also learn about some tools to accomplish the task.

Scott started by telling to the attendees what going on in the software development market, reminding us that we’re facing the adoption of a new platform (.NET), and that has a steeper learning curve, so the better we are able to unit testing our applications, the better.

Extreme Programming comes to the rescue providing agile methodologies, but it requires lots of discipline. Scott stated that the developer should make his mind in order to answer to changes to the requirements as “how’s that going to impact the schedule/budget of the project?” instead of “that’s going to break my code”.

Basically, if we do proper unit testing, we can change things and easily see if that broke something. If it did, it’s easy to straight to the breaking code, fix it, and test it again. Something to keep in mind is that tests must be written first, as that helps us to know what code should be written to fulfill the requirement.

A cool tip that has been given is that we should write code that works first; than clean up the code; that means, no optimized code should be tried right away (unless you can write it really fast) because that may not work and we may have to will have to change it.

Another tip: the developer should always remove what we don’t need in code: there is maintenance cost associated to any idle stuff.

Scott mentioned some third-part tools that we can use for unit testing in .NET. Among them, he pointed us out to NUnit (nunit.sourceforge.net), which is an open source tool written in C#, and it is great as a learning tool, where we can learn how to use reflection to query meta-data.

During the demos, he focused on a tool called HarnessIt (www.unittesting.com), also written in C#, that really does a pretty good job in testing .NET code. This tool is basically an attribute-based framework. That means that we precede our classes and method definitions with specific attributes that are going to be used by HarnessIt when we are running our application.

It’s really imperative to have good methodologies and tools handy for testing our applications as that’s one of the most important aspects that we should follow in order to provide our customers with high quality applications.

The System.XML Namespace – Don Kiely

.NET XML classes are not MSXML 4.0 or 5.0 or greater: MSXML could be used by means of COM Interop, but that wouldn’t make sense, since COM has been treated as “legacy” technology. The .NET XML classes are managed code, therefore they are optimized and tends to have better performance and resources.

.NET has a huge number of classes XML-related. The main namespace for XML classes is the System.XML. Despite of that, Don tried to cover the most important ones (the ones that we use all the time), like System.XML, System.Xpath, System.Serialization, System.Schema and System.XSL.

Although we’re going to use a number of different objects, it’s not so hard to get used to them as they abstract things like elements, attributes, writing content to an XML output or reading from a source, and so forth.

Don showed us how we can display XML in ASP.NET, by sending raw or transformed XML (in the case of transformation that could be done either on the client-side or on the server-side), by using the innerHTML property of a control, using the asp:XML server control, etc.

Moving on, we saw that there are two main approaches for the creation of XML documents: In-memory DOM tree and Forward-only streams. While the first one is the DOM that we’ve been so used to, the second one is better performance-wise.

We can use the XMLTextWriter class to create XML documents in a forward-only stream flavor. It has some nice features, for instance, we create the XML document in an approach that looks like string concatenation, with the difference that this class will take care of creating a well-formatted document.

Another cool feature is that although we have to start the document elements (by calling a method for that), we don’t have to remember closing the elements: as soon as we got to the end of the document, all we have to do is to call:

oXMLTextWriter.WriteEndDocument()

That will take care of closing all the opened elements: that reduces the amount of code and help us avoiding forgotten closing tags.

.NET uses both approaches to work with XML documents, and you can do the same: everything will depend on what you’re trying to accomplish. For instance, if you only want to scan through entire XML document, picking up some values, the forward-only stream option is the best one as it offers the best performance. On the other hand, if you want a finer control over the data manipulation in several levels in the hierarchy of the document, accessing different elements, attributes, and so form, the DOM tree is the most appropriate approach.

Calling .NET COM Components from VFP – Rick Strahl

Do you need .Net from VFP? Nope. There are many cool features, but most of than can be done without .Net. However, it’s good to get in touch with .Net, because we may need at some point to interop with a .Net application from VFP.

In order to use the cool features, we pay a high price for them. We have to install the .Net Framework, besides our own VFP runtimes and application. Using both runtimes at the same time is also very resource intensive (memory and processor-wise).

But how does this integration work? .Net can export Types (classes) information to COM, by exporting them using a runtime wrapper. When we instantiate the class in VFP, we’re not really instantiating our .Net component, but we’re rather instantiating this runtime wrapper, and it’s this wrapper that will instantiate the .Net component. The wrapper will also take care of translating the method calls between VFP and .Net.

What’s important to point out is that, in our .Net class definition, we should use the following attributes:

[ClassInterface(ClassInterfaceType.AutoDual)]
[ProdId(“DotNetCom.DotNetComPublisher”)]

The ClassInterfaceType set to AutoDual means that will be able to access that component either by IDispatch (late-binding) or CoClass (early-binding). The early-biding is very useful because that’s what will provide VFP with IntelliSense capabilities; without that, we would have to implement interfaces in order to benefit from IntelliSense. The ProgID attribute is useful for determining exactly what we want as a ProgID for that class.

Rick demoed he’s wwImaging class, which is a .Net class that wraps GDI+ features for being used from within VFP (Rick has white-papers on his website about this at www.west-wind.com).

By using the wwImaging class he was able to show several pitfalls that we must be aware of when calling .Net components from VFP. For instance, when the most basic “Hello World” .Net class gets instantiated in VFP, the .Net framework runtime will load 4 Mb in memory. From that on, that’ll get bigger and bigger as we start using those cool .Net features. So, when we start using ADO.NET, GDI+, or anything else, it’ll start increasing the space allocated in memory, and that can get really big. Then, when we instantiate that in VFP and release the object, we see that the memory doesn’t get cleaned. The reason for that is because it was not VFP who’s been holding a reference to the .Net object, but is the runtime wrapper (do you remember it?) who did it.

In one of the demos, Rick was showing how he uses the wwImaging class for creating thumbnails version of bigger image files. When the bitmap file is been handled by the .Net component, it occupies valuable resources of the memory. We have to make sure that those resources get released. The way for doing that is by calling the Dispose method of the object (that’s going to release all the resources used by the object, however it’ll not destroy the object, because of the way .Net’s Garbage Collector works).

Rick made it very clear (and demoed that) that we must take care of releasing resources allocated by the objects because that can be really an application killer.

In a nutshell, Rick showed that it’s easier to get .Net things from VFP, but the opposite is not true. .Net is a strictly strong-typed language, whereas VFP has been weakly-typed since its early days. When we call the .Net object methods in VFP passing parameters, these parameters are going to be sent as variants (no defined types, since VFP doesn’t really have the “type” concept that .Net does). To the .Net side, that’s a real bad thing because an object, for example, will be received as an Object .Net’s type, which’s the most general object in it, and it will not expose a single member of the passed VFP object. Because of that, the compiler will not allow a compilation of that code.

So how can we successfully use VFP’s objects in .Net? One option is by exposing every single class as an OLE Public class, creating COM components out of it, and that would create a Type Library that would be exported to a format which .Net could understand. That’s doable, but it’s a headache. Instead, we can query the object by means of Reflection: this is the mechanism to discover object type, members and other information during runtime.

Implementing the use of Reflection for this case is really not straight-forward, and the simple operation of setting or getting the property of an object’s property can get so cluttered that I’ll not dare to show you a sample code here (you can see that in Rick’s white-papers though). In order to make that easier, Rick came up with a class that wraps all the ugliness of the operation and offers a more human-readable approach to accomplish the task. It’s still not what VFP developers would like to see, but there’s no other work around this.

Overall, we reached the conclusion that, you should only call .Net components when you really need the features you’re going to use, and if you are going for that, pay a lot of attention to the memory related issues, because they can kill the application and the processor very easily.

I’d highly recommend you to take a look at Rick’s article about this subject. Once again, you can find it at www.west-wind.com.

Practical Uses for BindEvent() – Drew Speedie

Drew Speedie did a good job presenting this session about practical uses for Event Binding capabilities. With VFP 7 we gained the capability of binding to COM objects events. Now in VFP 8 we can do that also with VFP native objects.

Basically, this new capability is supported by four new functions: BindEvent, UnBindEvent, AEvents and RaiseEvent.

We could see this feature as kind of like “subclassing at runtime”: we can attach new behavior to objects on-the-fly. The easiest way to explain it maybe by using the _Screen intrinsic object in VFP. This object is the main window of VFP and although we can access its properties and methods, we can not subclass it. So what could we do if we want to run some code if a given event of this object fires, or if a property of the object gets changed? With VFP 8 we can bind to the event or property, delegating the execution of code to any number of methods of any number of objects.

Among his samples, Drew showed some interesting stuff like:

Controls “anchoring”: when resizing a form, we usually populate its Resize method with code that must implement the resizing and repositioning of the contained controls. That’s tight coupling, since we can easily break the code by simply changing the name of the control. By binding to the Resize event of the form, we can rather delegate that to some method of the control, and it can takes care of resizing and repositioning itself, in a much more encapsulated and reusable way.

Grids with the capability of changing ordering and providing search as the user types, by binding to the header controls and textboxes or any other control contained in the columns. That way we don’t have to create specific classes all the time just to implement the same thing, or where we should always remember to put some method call for a method that implements the actions.

Pitfalls in binding to events and having NODEFAULT on either the delegate or in the event itself.

Drew has also pointed out that we should be aware of situations when we are debugging and just can’t step into some code now because with event binding we may have a delegate being executed and doing something prior to the call to Set Step On, for example, and this is kind of hard to catch. So, if something is going on too weird, try using AEvents on the objects that may relate to the problem, and you may figure out where the bug could be.

What’s an Object? – Carl Franklin

This is a quite controversial topic because several times the developer may think that they know what’s an object, but on the reality the only thing that comes to his mind is a Command Button on a Form. That’s only one flavor of a “visual” object. In this session, Carl Franklin has tried to explain more about why it is so important to really understand what an Object really is.

He started up the session by reminding the attendees that Visual Basic has never been truly object-oriented until version 6.0 (inclusively). Although it had some features, it hadn’t maybe the more important one for a language being considered object-oriented: implementation inheritance (it had “interface” inheritance, but that’s another story).

Visual Basic .Net came to the rescue as a new truly object-oriented language. In its most basic aspects, class (whose instances are known as “objects”) can be simply defined by a Class statement.

Something important to know is about the difference between Value Type and Reference Type variables. Value Type variables are those stored in memory on the “stack”, and it has its data stored there as well. Reference Type variables are those stored on the heap, but what it has is the address (a reference) of the object that’s sitting on another area of the memory called “heap”. Examples of Value Type variables are: Booleans and numerics. Examples of Reference Type variables are any kind of object instantiated from any type of class.

Carl explained the concepts of passing variables as parameters both “by value” or by reference. When we pass the parameters “by value”, it is actual a copy of the variable that’s passed to the method, and if the method changes the value of this copy, the original variable will not gets changed. On the other hand, with we pass them “by reference”, any changes to the parameters will be made on the original variable. This is difference between “by value” and “by reference” is true for value type variables, but it’s not for reference type variables; reference type variables always work as if they were passed “by referene”, which means that will be always changing the original variable.

We have to keep in mind that Classe, Objects and Variables are three different things: Classes are like blueprints, that we use to build Objects, and Variables are the place where we store references to these objects.

More to the end of the session Carl talked briefly about method shadowing and overriding. Essentially, when we inherit methods, for example, we have the option to override the base class implementation, or hide completely the base class implementation and then only use the implementation of the subclass.

SQL Server Security for Developers – Chuck Urwiler

In this session, Chuck Urwiler, Senior Developer at EPS Software Corporation, showed us about the some basics and more advanced security features in SQL Server.

Chuck made it clear that using SQL Server only because it is aimed to be secure, but not using its features properly really doesn’t mean anything, meaning that we should just stay with more fragile databases as the VFP native database, Access, and so forth.

Mostly of the problems in regards with security in SQL Server are related to the fact that the appropriate settings haven’t been made, and that leaves leaks that could end up letting the server exposed to hacker attacks, or other sort of unauthorized access to the data.

Chuck passed through the different authentication modes, like the SQL Server mode or Mixed Mode. He explained that we should always try to get rid of the SA account, or if we really want to use it, set up a password to it, because it’s worldly known that several people leaves that password empty, and every single hacker worldwide knows that.

He talked also about Roles, and how they work. Roles are essentially groups of permissions that simplify permission management, and we can use four types of roles: Fixed Server roles, Fixed Database roles, User-Defined roles and Application .

In SQL Server we can set permissions in several flavors, passing through Objects in the database (tables, columns, stored procedures), statements (create, backup) and implied (roles, object owners).

Some point very emphasized is that “deny” permissions will always win, meaning that they will always take precedence over any other permission at any level.

This session was very interesting because most of the developers just install SQL Server and start using it as administrators, and that way they end up overlooking several security aspects because they can just to everything they want.

 
Claudio Lassala, EPS Software Corp 
Claudio Lassala is a Senior Developer at EPS Software Corp. and a part time Universal Thread Consultant. He has presented several lectures at Microsoft events such as PDC and various other Microsoft seminars, as well as several conferences and user groups in Brazil and North America. He is a multiple winner of the Microsoft MVP award, holds the MCSD.Net certification, and is also a columnist at MSDN Brazil. He has articles published at several magazines, such as MSDN Brazil Magazine, FoxPro Advisor, CoDe Magazine, UTMag, Developers Magazine, and he is also the author of several training videos that can be found on the Universal Thread.

Deployment Tests with VMWare Workstation 4 or Connectix Virtual PC, Guy Barrette

By Martín Salías

Universal Thread Magazine readers would surely know Guy Barrette for his monthly .NET Books Reviews. He'll also be attending to the upcoming TechEd 2003 conference, where he will also do the official coverage for Universal Thread.

In this session, Guy didn't talk about any specific development language or environment, but about two products related to software deployment and testing issues.

The session was originally focused just on VMWare Workstation, but Guy included information about Connectix Virtual PC at the last moment because when he knew that Microsoft has bought the company. This can probably mean that the service he described in his session can be soon part of the whole Windows family, so this is news that affects us Windows developers quite directly.

He started stating what the usual problems with deployment testing are: Need to asses the applications installs and runs well in different Windows versions, language editions, different web browser versions that can coexist, etc.

You can have several machines, but this is expensive, takes too much room, and it haves problems with backups, ghost images, and the likes.

The solution that VMWare and Virtual PC is offering is a very interesting one: running many different OSs in the same machine, or indeed, in different virtual machines physically locate within the same hardware.

Guy started showing an XP session running inside a Windows 2000 Professional session, and he then switched to a Windows XP Professional window running over a Linux session (all in the same notebook, at the same time).

Hardware requirements are not so high. At the host, is enough with a 400Mhz CPU (while multiple processors are supported), 100 Mb of disk space for each virtual machine (not in the same sense than a Java Virtual Machine, as Guy pointed out), plus the space that each OS requires; 256 Mb of RAM for the host OS, plus the needed RAM for each one of the guest OSs that need to be run at the same time.

Supported OSs for the VMWare host ranges from NT to XP Professional or Windows 2003 Server; and also Linux, but in a separated version.

Supported guests OSs are: al Windows versions, Linux, FreeBSD, and Netware.

The hardware available to each virtual machine is one CPU, up to 4 IDE disks, plus CD and DVD, all until 128 Gb of capacity. Something interesting is that CDs can be also ISO images, so you can keep setup CDs, for example, in your physical hard disk. You can also have 7x SCSI drives up until 256 Gb.

Something smart is that virtual disks are kept in a file that you can share, and it doesn't takes the space you defined, but what's actually in use.

You can create a snapshot of your guest OS after you installed a clean copy, so you then start testing your setup, and you can revert back to the snapshot any time you want.

You can also suspend the state of the guest OS, and resume it later on, from where you where, like you do in a laptop.

VMWare has really good documentation. There is a large PDF file you can download from their web site. There is a 30-days full-working evaluation version, and there is a great book covering version 3.1.

As Guy said at the beginning, Virtual PC has been recently bough by Microsoft, and the product is cheaper, at 230$ against $300 for VMWare. It has more hosts available, but as separated versions. It also supports OS/2 and MacIntosh, and more guests also, as OS/2, Netware 6, Linux and Solaris. It also has a 45 days evaluation version.

Then he did a short demo, explaining that it was not a comparison. He works with VMWare since a long time, and he knoes this one quite better. He started with NT, Me and Windows 2000 Professional guests at his VMWare console. There he made the Windows Me machine boot-up, as if it was a real PC. It even started scanning the disks, and played its opening music!

He opened Notepad, did a few things and suspended it. When doing it, it took a small screenshot of the state at the suspension time.

Then he showed how to create a new virtual machine, following a wizard. Then he installed a Windows 2000 Professional. He wrote the virtual machine name and physical location. You can specify the guest size, and this is a great feature because you can simulate your customers' PCs limitation (a given amount of RAM, for example). Then you can specify the kind of network connection to have. You can use the real network in the host, Host-only networking, or nothing.

Then you can create a new virtual disk or share an existent virtual disk. You can also use a physical disk, and then assign a given capacity. There you can allocate the actual disk space, and finally name the actual disk file.

And voila! He got a new virtual machine created. It had also a CD-ROM, floppy disk, audio adapter, and such. He showed a few options as Power-on features, Snapshots settings, etc.

Then he proceeded to install the actual OS from a DVD by starting the virtual machine. It booted, and the DVD booted with a bunch of OS versions to install. He started installing Windows 2000 Professional in Spanish.

He explained that both products come with no OS licenses, and you have to pay for each one as you will do with a regular PC.

The install process was pretty fast, and Guy even suspended the virtual machine in the middle of the process, and then resumed without a hitch!

To avoid having to wait the whole installation, he resumed another virtual machine with Windows 2000 Professional in French. Then he showed how you can drag and drop files between sessions, and even copy and paste between them.

Then he started an NT virtual machine. VMWare warned that the floppy was in use in another session. He showed how to run the session in full-screen mode and switch among them.

He told us that it's great for demos also. Microsoft people are great users of VMW (probably switching now…).

He then virtually pulled the plug of the French Windows and went back to his Windows Me. He deleted the whole Windows folder from a DOS window, and… Crash! He then reverted to the Snapshot. Everything was fine again.

He then showed a bit of Virtual PC. The interface is less jazzy, but it works, and does quite much the same things. The wizards to create new machines are more Microsoft style. Besides all that they are pretty much the same thing.

Those where some of the things explained in the final questios: You can share virtual images, because there are no hardware dependencies. Performance is not bad. It obviously is not as fast as a real machine, but it doesn't take all your resources, and if you have a decent machine it is ok. And you can't run OS X (Mac) on Windows, most probably due to hardware dependencies.

In conclusion, this is a great technology that most of us have to consider, and that it can become quite popular from now on, as Microsoft has become a player in the field.

Introduction to SQL Distributed Management Objects, Dan LeClair

Dan LeClair is a Senior Developer working for EPS Software Corp, from Houston, Texas, and he presented an interesting session about this components we have available in any SQL Server installation.

Distributed Management Objects are basically a set of COM objects that represent SQL objects, are they are the building blocks for Enterprise Manager and SqlNameSpace objects.

We can use them instead of performing SQL statements over the system tables, and basically, they have almost all the same features that you find in the Enterprise Manager, but accessible in a programmatic way. This is nice.

There are two main objects available, depending on the SQL server version you have installed, SQL Server and SQL Server 2. The later is just available for SQL Server 2000.

The object gives you basically most of the same features that Ent.Man or SQL QA gives, but programmatically.

Due to some integration issues, you just can use it the SQL Server 2000 version with Visual FoxPro easily.

The process is simple: First you need to connect to the server, so you use the SQL Server object. All the child objects are there: Collections for Databases, Linked Servers, Logins, etc, and some single objects like Configuration, IndexServer, etc.

He showed a couple samples in VS.NET and a couple more in VFP, but it was always the same thing as this is just a matter of going trough collections.

The main part is the Database Object. From it you access all the rest, and you can do things like executing T-SQL code, too. You can even work with results sets as collections instead as cursors or recordsets if you want. Dan didn't find it much useful, but its there.

He showed a small VFP program that looped trough the triggers objects, disabled them, made a batch update in a table, and re-enabled the triggers. Without the triggers working, the process took a lot less times, some ten times less.

In VFP, you have to register MS SQL Server DMO on Intellisense Manager to get Intellisense to help you typing..

Then he created a form with a listbox and fed the available databases into it. He added a second list and tried to got the tables from the selected database there. He also added an editbox to enter T-sql code, but the code didn't work at all, and he told us he would get it working and put it at the conference site later.

Then he showed an already made form -in development phase-, and took a couple minutes to show xCase, a database diagramming tool. He explained that as it is based on DBF tables, so it's pretty useful to access the data on the repository. But xCase is short on recreating User Defined Functions on SQL Server, so the form attemped to solve this issu by reading the xCase repository and doing the job. Actually the form was not working yet either, so he just showed pieces of the code.

In the code, he loops trough the UserDefinedFunctions Collection and get each one's Name, and Text (where the actual code is) properties.

He then showed us a series of demos that allowed him to create a new database. This is good when you have to recreate databases at a customer's sites.

Next demo went trough the Indexes collection, getting all the info to rebuild them, then it truncated data, loaded an existing DTS package to transfer new data, and reindexed all. Again, this is much faster that doing it with the indexes there.

Finally, he showed us how to programmatically Attach and Detach a database.

Overall, his explanations were very clear, and he's not afraid to say I don't know when it comes the time. It was a pity that many code didn't worked, or that he couldn't easily find some pieces of code he wanted to show us. He told me later that he had being working on a big project that took him many time, and he could not prepare the session as he wanted.

Anyway, we all got the idea of the power behind this simple objects, specially for making installation or administrations programs to facilitate application deployment.

Understanding Visual Inheritance in .NET, Markus Egger

I have to start saying that this one was one of the best sessions I've ever attended. Markus is very clear about the concepts he explains, he obviously master them, and he's funny, as a plus.

He began the session with a short resume of what inheritance is, and then he showed a little sample of non-visual inheritance just to make sure everyone was following him in the idea.

The sample was a fairly simple business object. It had basically a method that did a Select statement over a database table to populate a dataset, but it couldn't be reused because it was too specialized for that table, so he wrote an improved version in which the fields to select and the tablename were just properties.

Wit this generic business object he then created several subclases with very little code that performed the same thing, every time in a more specialized fashion, but reusing the same underlying code.

In C#, to call up the parent class code for a given method, you just issue:

base.MetodName()

Inheritance is a fundamental building block of .NET and it supports cross-language inheritance, even while debugging.

Then he proceeded with a WinForm demo about how inheritance can be handled for visual controls as well as abstract components.

When you create a WinForm, you are basically creating a class, so you can subclass it anytime you want. You do this from the Solution Explorer, right-clicking the over your project name, and selecting Add…/Add inherited form…, then selecting the form in which you want to base the new one. Now you have a basically identical form. Just change something in the class and the inherited form gets the changes, plus everything that belongs to itself.

That applies even to form's member. The original form had a button on it, and the inherited one also.

The Modifiers property let you control if you can change or not a member in the subclasses.

Visual inheritance is a bit difficult at first in .Net, because it is not well supported by the designers, but when you get that handles around it, it is not so terrible. And it pays to use it.

Markus repeated a few times that you HAVE to subclass every control, never using the standard ones provided that .NET, as -no matter if you don't change anything in your subclass- then you always have a place to apply some specific behavior.

That way, you can create Forms Frameworks, thus making your own class hierarchy, and having all the common functionality put on just one single place. He showed a diagram where he showed a basic form class that was subclassed to dialog forms, wizard-type, and such.

He then showed a simple example about adding a gradient fill to every inherited form, and showed a clever way to do it, by the way. This is a great feature on .NET because what you put in the form's instantiation code works at design time.

We can navigate the class hierarchy in the Class view anytime we want, so we can check how things are implemented in the parent classes, if we need so.

The following thing he explained was Events vs. Methods. Events are built-in hook operations. Events triggers in instances, while methods are easily subclassed.

The next step to make functional subclasses for every control, is to build business subclasses. He demonstrated a combo with customer data that actually showed the first client name at design time. This is quite good, although is not desirable in some cases, so there is a way to determined if you are at design or runtime, or you can just take care about where you're putting your code.

The session was really great. The only drawback is that Markus didn't uploaded any of his presentation's material to the conference web site, so I can't share much examples with you.

VFP and .NET working together, Cathi Gero

Cathi is a great personality in both VFP and .NET communities. She worked for the VFP 8 Team, but she has also wrote lots of articles, edited Kevin McNeish's book ".NET for VFP developers", and she has his popular .NET Tips monthly column at Universal Thread Magazine.

In this session, she showed in greater detail the same demo application that Ken Levy and Alan Griver showed at DevTeach's Keynote, and which she actually wrote.

She started from a very simple business object with both GetData and UpdateData methods that access a VFP database with some simulated hospital information.

GetData() takes a floor number as a parameter and shows all the patients at that floor. It accesses VFP tables and sends them as an XML Dataset up to the next tier, using an XmlAdapter. It creates it , sets the IsDiffgram property and add all three tables.

UpdateData() takes an XML string and returns true or false if succeded. It uses SET AUTOINCREMENT OFF to avoid errors if an autoincemening integer field is tried to be written.

She created another XmlAdapter and called the LoadXML to get the three tables back, then looped trough them and then used ApplyDiffgram to get the changes applied to the original data source. All inside a Try/Catch structure.

She pointed out that we can have more information about XmlAdapter in Code Focus issue, and showed the resulting XML file to illustrate how it is formed.

Then she opened VS.NET and created a VB.NET Web Service that consumes this business object, explaining how to add the reference to the COM component in the VS project with a simple dialog. Then she exposed a couple methods that replicates the business objects' ones. She ran the example and testes the Web Service in the ASP.NET test pages.

Later she created a common business object in VS.NET to be consumed by WinForms, Webforms, and Mobile devices.

She briefly reviewed the Dataset concept and proceeded to explain her code. There she showed the .NET equivalent of an XmlAdapter in VFP. She used it to complete her SendData method on the .NET side.

She skipped whole pieces of code to avoid entering into too much detail about specific .NET topics, as there are many other sessions do that. Her goal was to demonstrate just the integration capabilities.

She demoed a WinForm that consumes the .NET business object to get and update data. This business object uses the Web Service, who is actually using the VFP business object at the back end.

She briefly discussed each of the form methods and events. Then a WebForm was shown that did pretty much the same. Both are very similar to develop.

A PocketPC version was shown next, running on a Pocket PC emulator. The information was the same, just it was trimmed to the most important data, and displayed with much less format, to consume less screen real state.

Next step were Cell phones. It was basically the same thing, but with an even smaller format.

She finally showed a great real world application she wrote for Caterpillar with a VFP backend and ASP.NET as front end, using Adobe Acrobat to allow users to fill real forms that mimics hand-written forms, and a cell phone application used as a font end for an accounting system written in VFP. A large client with many stores allows to check stores sales figures in every part of the country trough a phone or small PDA. They can check sales, or inventory in quick way.

Business Objects in XML based distributed applications (a Visual FoxPro perspective), Rick Strahl

The point of Rick's session was to state that the technology to intercommunicate client and servers remotely using XML as a transport is already there, but that isn't the whole solution. There are a lot of things that you must to take care and that is not acceptable to handle them in each instance and piece of code.

So he presented several ways to communicate Servers with Clients, having FoxCentral as a working example.

There are more alternatives, but he picked the three that he has found more useful and he uses all the time:

  • Wrapper Classes for Web Services

    This is for him the most common scenario, where he uses Web Services trough a wrapper class that hides all the SOAP complexity, and a Client proxy acting as a client wrapper.

  • Remote Data Access

    This is some kind of SOAP-less Web Service, oriented to share data between applications that knows how each other is encoding information at both ends. It is usually a Business object extension.

  • Object Marshalling

    Probably the most sophisticated, allows you to pass whole business objects (including all of its children hierarchies), over the wire. It also allows client and server to share logic, and do offline data management through object state-keeping.

For the Web Service part, he highlighted that trying to publish an existing business object as a Web Service is not usually a good idea because they usually are not designed for that. For example, most business objects are stateful, while Web Services are not. Thus, he prefers to build a Web Service wrapper around the business object, that will probably call several methods and conclude a whole step when receiving a single call.

At the client side, you can do a wrapper around the SOAP connector, where you can ass additional logic, error handling (something that the SOAP toolkit doesn't natively provides), and also, you can just return a cursor right from the object, avoiding the need for the client application to make any further transformation, leaving everything ready for the User Interface to use.

He demoed some of this in action at FoxCentral, and also showed some of his tools that makes the process really simple, generating additionally real Intellisense scripts for the Web Service methods and parameters, much better than what's provided natively, just by passing this tool the related wsdl file.

Then he showed another class that mimicks the same object at the server side. As the previous level has already handled any SOAP error, we can just ask if an error occurred, and get the details. No crash situation there.

Back on the server side, it does all the house-keeping, user validation, etc, and then it calls the business objects to perform the actual task. This mechanism allows also to pass an object as a parameter and takes care of all the object XML serialization.

As for Web Data Access, you shouldn't do this right from your application. It needs to talk with the client trough a Proxy, sending a SQL statement that the server actually executes, returning back the XML result.

Rick has two set of classes to do that, one for native VFP and the other for SQL Server 2000, but the cliente usage is always the same, because the interface is always identical.

He showed a demo using his wwHTTPSQL component, adding authentication and parsing XML to get different elements as needed.

Object Marshalling is a powerful mechanism that allows you to send entire objects, including their inner collections and its members, over the wire, and recreate them at the other end.

It is basically based in the ObjectToXml and XmlToObject methods.

The demos were great, and even when at some time his wireless connection went down, Rick was able to go on over his local machine with just a few configuration settings. Pretty impressive!

Overall, the topic is quite advanced and hard to cover in a small report, so I'll recommend to read the complete whitepapers that Rick has at his web site www.west-wind.com, as well as downloading his freeware and shareware tools, that are also greatly documented, and ready to be put in action.

 
Martin Salias, Microsoft South Cone 
Martin Salias (Buenos Aires, Argentina) is currently acting as an Enterprise Architect for Microsoft South Cone. He has 25 years in the software industry working with several different platforms and languages, working for organizations ranging from the United Nations to Microsoft Consulting Services. He is Editor in Chief for Level Extreme .NET Magazine, a member of the Agile Alliance, and a Microsoft MVP.

Monday, May 12

by Claudio Lassala

Advanced OOP & Inheritance – Tom Eberhard

This was a good session presented by Tom Eberhard. He started with an explanation about architectural issues, including why a n-tier design is important, even for small applications that “weren’t” supposed to grow.

He passed through some samples on the various layers of the application, passing through the data layer, the business logic layer, the façade layer and the UI layer. He’s also showed some of visual inheritance in .NET. It’s possible to create visual controls totally from scratch; therefore your imagination is the limit.

By using GDI+ it’s possible to create really complex and interesting controls. And a cool thing is that the visual designer supports that, meaning that if you drop your control on a form, all the code behind that control will be processed and you’re going to see it as it’ll appear at runtime.

Tom also mentioned that RAD (Rapid Application Development) tools are not a good thing because they can really create applications rapidly, but the application must blow up on the next day. What we should use is what he calls “RAB” (Rapid Application Building), which means that we can build applications rapidly, however, using a reliable and scalable framework.

The content of this session has been mainly based on the book he co-wrote, which seems to be pretty good, and I’d say that it’s worthy you checking it out: “OOP: Building Reusable Components with MS VB .NET”, published by MS-Press.

Building TabletPC in VS .Net – Markus Egger

As usual, Markus has delivered another presentation on cutting-edge technology: application development for Tablet PC with VS .NET.

Markus first introduced his TabletPC, and gave us a pretty good explanation about why we may need a device like this and also what are the features in such thing. For example, although a TabletPC looks like a bigger PocketPC, it’s quite different. In a PocketPC you could make things by even touching its screen with your own fingers. The TabletPC on the other hand is smart enough to only respond to the pen touch. Also, it runs a full Windows XP with the addition of TabletPC specific tools and API, so, it’s like any other regular notebook, but much more portable and in some aspects more resourceful.

It is amazing seeing how that thing can recognize handwriting: it did a pretty good job recognizing Markus’ sloppy handwriting, which many of the attendees couldn’t even guess (maybe not even Indiana Jones would figure it out).

He showed how the managed classes for TabletPC can me used to develop TabletPC-enabled applications using VS.NET. Those classes are not hard to use (for some tasks it’s really simple), and they provide fine control over what’s the user is doing with the pen on the screen.

Markus demoed some samples of practical uses for it, like a Windows form that’s an “inventory” form, where the user can “write” the start characters of some product’s name, the application recognizes the handwriting, search for the data and populate the grid, and then the user can “write” down the quantity in stock. That’s a very simple use, that can give you the idea of what kind of thing we can do with that.

Markus stated that in his point of view, the TabletPC is not going to cause a revolution in the computer industry, but it will open several doors, given the many scenarios that we may find a good use for this device.

Architecting for the .NET Event Model – Kevin McNeish

Kevin McNeish was presenting this session for a local user group (which was a bonus session in the conference), and I can tell you that this was pretty interesting. Kevin presented several aspects in architecting applications, relying on his Mere Mortals for .Net framework.

As usual in his presentations, Kevin made it clear the importance of developing business objects. Business objects have been used in every professional application (from Microsoft’s Internet Explorer, Word, Excel, to big enterprise custom applications). With that, interface classes controls would only call the methods on Business Objects, no matter whether you have a Windows form, a Web form, a Web Service. That gives you all the power of reuse and extensibility.

He said how important is to program events in our objects, that can be fired on specific situations, and other objects can then subscribe to these events, running code necessary to accomplish related tasks.

A tip given by Kevin: when we create events, we should always create methods with the same name of the event preceded by “On” (as in “OnClick”, “OnDataChange”, and so forth). The reason for it is that we cannot override events; however we can override those methods anytime we’d like to accomplish such thing. This is something that Microsoft advises us to do and they’ve been following that strictly throughout the .Net framework.

In order to implement events, we also have to create Delegates, which are pointers to methods of objects that can implement the event. That way, we can have any number of methods that’s going to be executed any time the event gets fired (raised). Kevin showed a couple of samples were he uses events, like in data-entry forms, where events fire when data gets retrieved and then several operations of data-binding also gets fired.

I gotta tell you: I really enjoy attending to sessions where we can see good samples of a great architecture, using the most of object-oriented, best practices, and all that stuff. I wish every “procedural die-hard” programmer could watch and understand such session.

 
Claudio Lassala, EPS Software Corp 
Claudio Lassala is a Senior Developer at EPS Software Corp. and a part time Universal Thread Consultant. He has presented several lectures at Microsoft events such as PDC and various other Microsoft seminars, as well as several conferences and user groups in Brazil and North America. He is a multiple winner of the Microsoft MVP award, holds the MCSD.Net certification, and is also a columnist at MSDN Brazil. He has articles published at several magazines, such as MSDN Brazil Magazine, FoxPro Advisor, CoDe Magazine, UTMag, Developers Magazine, and he is also the author of several training videos that can be found on the Universal Thread.

Making the Most of the Toolbox, Tamar Granor

by Martín Salías

The new Toolbox is a replacement to the Forms Control Toolbar and the Component Gallery. And by the way, Tamar confirmed within the audience that nobody uses the Gallery. It is hard to handle it and to figure out.

After a little introduction, Tamar showed how to start the Toolbox from the Tools menu, and started showing it in action. This is a really cool feature that you'll get used to in a snap and will not abandon anymore.

The first and most common use is to drag and drop controls to designer or code windows. She created a form and dropped a spinner into. Being able to drag and drop from the there can be easier than using the form toolbar. You can also double click any item, and any way, things get into the selected container, without the need to select it first in the designer. No more Ctrl+click or right-click and edit.

It's great also handling member classes. You drag an option button, and it drops an Option Group instead. You drag a control into a column and it asks you if you want to replace the current. Stop doing weird clicking around.

You can drag a class and to a code window and it drops a CreatObject or NewObject call. It is a NewObject with the proper ClassLibrary parameter for custom classes.

Creating a new form based on a given class is also a lot easier, because you just select the class on the Toolbox and use the context menu to create the new instance.

And you can also get code in the middle to fully customize it. For example, Text Scraps are a kind of item that can be dragged and dropped to any text editor including external applications as Word. And you can include textmerge expressions into this text, like this:

* <<SUBSTR(SYS(0),RAT("#",SYS(0))+2)>>
* <<date()>>
* 

When you drop this item, you get a three line comment with your Username and the date. Great to document changes. Of course, you can do things a lot more complex than that. Tamar showed an example in which she executed an entire form to help her build subclass code with full documentation and the main skeleton ready to code methods in.

Items in the Toolbox are arranged in Categories that you can absolutely customize, creating more, rearranging them, etc. They can include any type of items inside, and they can be dynamic (such as including the content of a folder, or a whole class library), or fixed items.

All the items are intelligently handled. For example, if you drag a BMP item to a folder, an image control is dropped with the BMP as its Picture property. A cool type of category is Web Services. When you drop one of these items into a code window, you get all the needed setup code for this Web Service. You can use Intellisense for this, too. It's just a matter of preference, whether you're a keyboard or mouse user, and each method has its specific advantages.

There is a bunch of properties you can set for different item types in the Toolbox. For example, you can enter a specific Object Name to use when you drop it. You can also add some properties settings. As Tamar said, this is not a very good practice in most scenarios. If you found yourself setting a property to something so frequently, it's better to have a subclass for that. However, this has a really cool feature: the properties values can be expressions rather than hard-coded, magic values. For example, you can enter this expression in an OptionGroup Count property:

(InputBox("How many buttons?"))

And when you drop it on a form, the input box will ask you how many buttons to include. And just think that this is the simplest of its uses. You can do things similar to a builder that way, but this is much easier to do than builders.

The Customize Toolbox dialog gives you tons of options to tailor your environment. You can even control the list scrolling speed! Isn't that too much? Of course not for some people who always is looking for some other tip, like Drew Speedie, who was also attending this session. Having Drew at the audience is not easy, because his questions are always smart ones, but it surely is very funny. It was a plus for Tamar having him there.

Finally, if using the Toolbox as is great and gives you a lot of flexibility, you can go even further. As almost any other VFP tool, this is written in VFP code as Toolbox.app, and it's based on the Toolbox.DBF table, so you can modify it o rewrite it if you want (source code is there for you to learn by looking at that at learning some tricks, at least).

And while the Toolbox is running, you can have a reference to it with _oToolbox, and have access that way all of its properties or methods. And Tamar remarked that finally the people at Microsoft are doing things the way they told us to do it, because it actually is separated in an interface and an engine objects.

Comparing OOP in VFP to OOP in .NET, Claudio Lassala

I think I know this guy from somewhere else… <g>

This was not a simple session. This was basically an OOP session focused in comparing objects models to make easier to Visual FoxPro developers to figure out how to approach .NET programming.

We VFP developers are quite used to classes and inheritance, so it's easier for us to grab some .NET stuff than for VB guys, for example. Even that way, there are a few points that seem alien for us at first.

As the topic is quite extensive an complex, Claudio recommended to anyone interested in get further detail to check his whitepaper, available by now just at the DevTeach web site for attendees only, but which will be soon posted on the EPS website (www.eps-cs.com), so you can look forward to get it from there in a week or two.

The main difference between the two platforms is that in VFP we can write procedural code instead of OOP code. .NET doesn't allow us to do this. For example, in VFP you can write:

dDate = Date()
cName2 = alltrim( cName )

While in .NET you would write this as:

dDate = Date.Now()
cName2 = cName.trim()

Defining classes is almost the same thing. Take a look at these examples in VFP, C#, and VB.NET:

* VFP
Define class Customer as Custom
Enddefine

/// C#
Public class Customer
{
}

'VB.NET
Public Class Customer
End Class

Now, while in VFP every class is "public", even when defined in another application, meaning it can be called from anywhere else, in .NET we have much control over that. An "internal" class is just available to a single component (an assembly).

Instantiating classes is quite similar, too. See the samples:

* VFP
Local oBiz as Customer
oBiz = CreateObject( "Customer" )

///C#
Customer oBiz
oBiz = new Customer();

'VB.NET
Customer oBiz = new Customer;

In VFP we don't have the need to specify parameter or function types. It's good practice to do it now that you can (since VFP 7) so you can get this information in COM components type libraries and also in the Intellisense, but it's not required, and in fact is just merely declarative. Defining a parameter as some type doesn't implies any real checking.

In .NET we have to specify every type. In VB we have to include the ByVal clause, while in C# parameters are passed by value by default.

Properties are a really different animal in .NET. Discussing that is not easy, and it took Claudio awhile, so I'll skip this for the sake of brevity.

Something I like very much in .NET are chained method calls. In VFP you do this in a procedural way:

myString = altrim( upper( "blab la" ) )

Now in .NET you do it the OOP way, and with great elegance:

string myString = "blab la".toUpper.Trim()

Inheritance has the same fundamentals at both sides, but the syntax is a bit different.

* VFP
Define class Human
Enddefine

Define class Man as Human
Enddefine

/// C#
Public class Human
{}

public class Man : Human {} ' VB.NET public class Man Inherits Human End class

Further, if we don't specify a class from where inheriting, it does it from Object, which is th