Saturday, October 20, 2007

Southwest Fox - Day 3, Session 2

Rick Strahl - Introduction to AJAX with Visual FoxPro

Rick started out by telling us what AJAX Asynchronous Javascript and XML (although very little of it uses XML)

In a traditional HTML page any time you need to go back to the database you need a complete redraw of the active page in the browser. AJAX attempts to update the active page without a complete redraw. Rick says AJAX is really Remote Scripting.

Google Maps really started the trend. Many of the web-mail clients use AJAX to display a more windows like interface.

If you have a postback type of page, you can take advantage of AJAX to pull a small piece of data within the context of the active page. One of the things I didn't realize, which is now obvious, is that you can use AJAX to make a plain HTML page dynamic.

In response to a question Rick said that it would be his recommendation to initialize the page with as much data as makes sense instead of for example sending a page with a bunch of empty combo boxes that use AJAX to get the data as the user works through the page.

AJAX is not a replacement for ActiveX or plug-in architectures like Flash. We still can't use AJAX to do things like accessing the local system or uploading files.

Rick mentioned that JavaScript libraries are very important. Rick rolled his own because there wasn't anything reliable when he started getting into this stuff. He mentioned that there are lots of libraries out now and he currently likes jQuery.

Rick then showed us an ASP.NET app that uses VFP COM to demonstrate these concepts. We looked at the HTML and JavaScript used in a simple example.

I had a lot of trouble with my tablet in this session so my motes aren't very complete. I came to this session to get a better understanding of AJAX. I've understood the general concept but didn't really understand how it is implemented. Although we don't have any immediate need to use AJAX with any of our VFP applications, we can probably use it in one of our ASP. NET applications in the very near future, making this session even more valuable.

As always, Rick gave a great session.

Labels: , , ,


Full Story

Friday, October 19, 2007

Southwest Fox - Day 2, Session 2

Rick Strahl - ASP.NET COM Interop with Visual Foxpro

Rick started by giving a general overview of the issues related to developing concurrently in VFP and ASP.NET and an illustration of how applications interact with each other when using ASP.NET and VFP COM components. He pointed out that this is "gateway" technology, not a strategic technology. He thinks that this approach is a way of bridging the gap until such time as an application is completely rewritten. He said that it wasn't his purpose to recommend one or the other, but to recommend that you use only one - VFP or .NET

Rick created a simple Hello World demo just to show us how to create a basic COM object. He then showed us how to create a VS project that will consume our little com object. He pointed out that we want to create an ASP.NET web application.

One of the little tidbits I really appreciated was the OS command "IISRESET" which can be used to - what else? - reset IIS? Rick mentioned this because you need to reset IIS to release you COM component as you're developing it and creating new iterations.

Rick talked about how the Session object creates a good environment for COM components -except that it causes trouble sometimes when dealing with data. So instead he creates an ASPBASE class based on CUSTOM and then marks as protected most of the VFP members that have no meaning in this context.

He then showed how to use COMATTRIB to create a property and give it strong typing for the type library. Oh, yeah, he also pointed out this this only works with VFP 9, SP2.

Rick pointed out something that might not be obvious, but when you're developing applications in this fashion, you have to realize that it is a multiuser application and you have to be aware of that as you're writing code. His simple example was just a little incrementer, but he explicitly made sure he could lock the record before he changed the data.

Rick went into a good level of detail showing us different ways to interact with VFP COM from ASP.NET and showed us a couple different ways to get data into ASP.NET web pages.

I frequently got so wrapped up in paying attention to Rick that I forgot to take notes to share here. As always, Rick gave a great session.

Labels: , ,


Full Story