Monday, June 21
by Martín Salías
9:30 - Distributed Application Architectures in .NET and Visual FoxPro
Beth Massi
As I commented in yesterday's report, there are a few sessions in the conference around the same topic of distributed and tiered applications, bringing different approaches and conceptual overviews, but all of them agreeing in a consistent paradigm. This was another one of them.
Beth started by stating that distributed apps, no matter which language or platform, are based on a model of user interface tier, business logic tier, and data access tier.
She also mentioned the pros and cons of this model. The cons: slower performance for small groups of users, taking longer to write and test, and being harder to deploy. The pros: scalability, flexibility, easiness to add several UIs, system integration, and data maintenance. I think this is generally fair, although many of the cons could go away once you have a proper framework running and a streamlined methodology.
This architecture makes you also take some design choices like agreeing on a common contract (methods, interfaces, data schemas, etc), access mechanisms (DCOM, .NET Remoting, messages only trough Web Services or other).
She did a brief explanation on those access means, pointing some of the problems with COM/DCOM. She did a funny story about having to reboot a server in a 24/7 setting due to memory leaks, showing some comedy skills. She makes her sessions easy to follow by moving around and shooting little jokes many times.
Then she did an overview over Remoting, pointing at its advantages, while still keeping some of the DCOM ideas behind, and finally arrived to a quick explanation about the scenarios in which Enterprise Services (COM+ for .NET) is required.
And she finally arrived to Web Services, the preferred communication today. She made some detailed explanation about its advantages over DCOM and Remoting, too long to cover here, but the main points are that they are available on any important platform to .NET, Java and even VFP, they are better to support smart clients en do B2B communication, they use HTTP so they are easier to connect, and so on.
Then she made some explanations and demos using VFP and .NET complementing the ones she did in yesterday's session. This one was more conceptual and went to the alternatives and benefits of several approaches, and gave ample information about all of them. Both session were very good and made very clear the main issues and best practices about this topic.
11:00 - Using Visual FoxPro to call .Net Web Services for Data Access
Rick Strahl
What can I tell you about this session? For one, it was really great. Beside that, it confirmed my vision that we all are talking basically the same here, but it is good because every speaker is adding more and more information around the same strategies and practices, and people are indeed taking advantage of that, and getting a deeper understanding of what the new world of services oriented architecture is about, why most components have to be stateless and support asynchronous calls, and why we're not in Kansas anymore.
I wouldn't enter in great detail about the session because, as usual, you can go to the amazing collection of Rick's white papers at http://www.west-wind.com/Articles.asp and read about most of the topics presented here.
All in all, many of the points Rick targeted were similar to the ones Beth talked about in the previous session, but this time, he used some alternative approaches and went more to practical examples and -as usual- a few clever utilities he developed to make things easier, and which you can get right from his site, in most cases as freeware.
He basically showed some examples about building a Web Service in .NET and calling it from VFP using the SOAP Toolkit, and showed some of the good and the bad features. Some of the bad ones are lack of Intellisense if you don't get to the chore of registering the wsdl on Intellisense every time the service changes, and some excess of data conversion if you don't make things in the right way.
To make it good, the best way to return data is to avoid returning XML strings that produce a lot of overload on SOAP packets because they need to be encoded and decoded, and get in and out of DOM objects. Instead, you have to make the Web Service methods to return datasets right away, and what the SOAP Toolkit gets to you is an XML DOM Node list. This is something quite easy to handle once you know how, but as doing it every time can become a bit heavy, Rick just wrote a class to deal with this easily.
And in fact, he implemented several tools to abstract all that process in the same way a business object class abstracts you from the details of data access. Basically, the class calls the Web Service and returns to you cursors. Nothing else to do. Also, writing this once he had the chance to put there most exception handling and other basic stuff.
Something cool about using ASP.Net Web Services, even from Visual FoxPro, is how easy is to trace them. He set a breakpoint, went to VFP, made the call, and the debugger popped up stopped on the breakpoint.
He then went to the updating part, using diffgrams and sending them back to the Web Service to be used with a dataset to update the data on its corresponding layer. But you should know this at this point.
Something very important he noticed is that you have to think different about the functional design of your client application. You can't just deal with data entry the same way as you did with local data. Updates should be scarce and rapid, and you can't pass too much data over the wire, so you have to design to minimize all this.
To make things really easier, he presented a tool to create wrapper classes around web services, providing abstraction, Intellisense, and much more. Look for them at the West Wind site.
Tips over the session:
- Remember to always set the UTF8encoded property on your XmlAdapter to TRUE when dealing with datasets. I have this property set in my base XmlAdapter subclass, by the way.
- Want to know what's going by the HTTP pipe when you use Web Services? Take a look at Fiddler Http Debugging Proxy (www.bayden.com/fiddler/help/)
13:30 - Extending the VFP 9 Reporting System, Part I: Design-Time
Doug Hennig
In this session Doug gave the audience a deep inside in the inner workings of the new report engine from the designer perspective. Here are some of the highlights, although you'll got plenty of information about this later in different magazines and community sites, so I'll not cover all he did in his presentation. It is just too much.
The main goals the VFP Team had when revamping the report engine were: simplifying and improving the UI to avoid the current bunch of clicking and modal-dialog surfing we are accustomed to; adding new features (we'll see many of them), and make the whole thing very extendable.
First of all, they added a lot of design-time events to the report designer, so the ability to hook on them and customized it all has explosive consequences. The new _REPORTBUILDER variable points to an application (the one shipped is called ReportBuilder.app) which takes care of handling most of the design-time events, and implements many of the additional features in plain xBase code and VFP forms as dialogs.
Of course, you can write your own report builder application, or you can just use it and extend it trough a series of provided mechanisms. This would be, most probably, the preferred way, as it still leaves you plenty of room to handle almost every aspect of the designing process.
In this way, you create your own handlers for different events, which you can register by running ReportBuilder.app from the command window. When you do it, an option dialog appears with several other uses.
The things you can do at design time by using handlers are almost limitless. Doug showed a few examples as getting a basic report from a template each time a new report is created, and then even better, showing a dialog to choose what kind of template you prefer. But this is not like just copying an existing report, renaming and editing it. This used to left room for a user or developer to skip picking a template. This is automatically made when creating a new report.
You can do other things like preventing or controlling access to the data environment, creating your custom dialogs for fields (for example, letting the user pick them from a data dictionary or something like that), and lots of other cools stuff that VFP developers will quickly figure out in the future.
15:00 - Using VFP's SQL Commands in Europa
Tamar Granor
This session could have being dedicated to Joe Celko, a widely known SQL specialist who used to wrote the "SQL for smarties" column on DBMS Magazine years ago, an has a few books about the topic. And this is because much of the great enhancements on SQL syntax on VFP 9 have not immediately obvious examples.
Basically, one of the general topics around the whole SQL engine was take away most existing limits, while getting the semantics really closer to the SQL Server one. I know that most of these improvements are the work of Aleksey Tsingauz from the VFP Team, to whom I'm always in debt for his invaluable help on the Universal Thread forum. Tamar also expressed her acknowledgement to Aleksey during the session.
It would be difficult to resume the explanation behind every one of Tamar's examples, so I'll copy here most of them and let you appreciate the SQL power on VFP 9.
Nested subqueries:
SELECT iID, cFirst, cLast ;
FROM Employee ;
WHERE iID NOT IN (SELECT iSupervisor FROM Employee)
Derived table for aggregates:
SELECT Orders.Order_ID, Customer.Company_Name as Cust_Name, ;
Shippers.Company_Name AS Ship_Name, Orders.Order_Date ;
FROM Orders ;
JOIN Customer ;
ON Orders.Customer_ID = Customer.Customer_ID ;
JOIN Shippers ;
ON Orders.Shipper_ID = shippers.Shipper_ID ;
WHERE Orders.Order_Date = ;
(SELECT MAX(Order_Date) ;
FROM Orders Ord WHERE Orders.Customer_ID=Ord.Customer_ID );
ORDER BY Cust_Name ;
INTO CURSOR MostRecentOrders
Subquery in field list:
SELECT Customer.Customer_ID, Customer.Company_Name, ;
Customer.Address, Customer.City, Customer.Region, ;
Customer.Postal_Code, Customer.Phone, Customer.Fax, ;
(SELECT SUM(quantity*unit_price) ;
FROM Orders ;
JOIN Order_Line_Items;
ON Orders.Order_ID = Order_Line_Items.Order_ID ;
WHERE BETWEEN(Order_Date,DATE(m.nYear,1,1),DATE(m.nYear,12,31)) ;
AND Customer.Customer_ID=Orders.Customer_ID ) as YTotal ;
FROM Customer ;
INTO CURSOR CustomerTotal
Subquery in the SET portion of the SQL UPDATE:
UPDATE SalesByProduct ;
SET UnitsSold = (;
SELECT CAST(NVL(SUM(quantity),0) AS N(12)) ;
FROM Order_Line_Items ;
JOIN Orders ;
ON Order_Line_Items.Order_ID = Orders.Order_ID ;
WHERE MONTH(Order_Date) = nMonth AND YEAR(Order_Date) = nYear;
AND Order_Line_Items.Product_ID = SalesByProduct.Product_ID)
TOP n in an uncorrelated subquery:
SELECT cFirst, cLast ;
FROM Person ;
WHERE iID in ;
(SELECT TOP 20 iPersonFK ;
FROM PersonToItem ;
ORDER BY dEffective) ;
INTO CURSOR OldestContacts
And there is much more than that. In many cases, performance really improved. For example, the LIKE operator and TOP clause are not optimized, so they are faster. Some other great thing is the ability to perform SQL statements over buffered data. As I see it, this makes a lot more useful the engine for anybody working mostly with remote data coming from relational databases.
Tuesday, June 22
by Martín Salías
9:30 - VFP 9.0 Form and Class Design Enhancements
Drew Speedie
Starting this session, the first thing Drew did was to log into the DevTeach web site and show everybody how to go to the evaluation forms to enter their opinion and rating for each session.
Then he dimmed the lights of the room to let the audience concentrate on the screen, and in fact, he just showed a couple slides and jumped right into the VFP IDE to show a series of improvements there.
There was no sample code at all, as almost all the session was based on IDE enhancements, basically around the Properties Window.
The most obvious change are icons in the properties, but now is also possible set the window font, and the colors for non-default, custom or Instance properties, beside the ActiveX which was already there.
One of the changes with more impact is the _MemberData property, which can contain XML metadata about the properties themselves. By its means, things like determining the proper capitalization of custom PEMs can be done. But as this is quite flexible, it is too complicated to edit this XML by hand, so VFP 9 Beta includes a MemberData Editor, written by Doug Hennig, which makes easier to set the extended properties, storing the values into _MemberData.
Among other things, this editor allows the setting of the favorite flag, which makes the property appear in the new Favorites Tab on the Command Window, and also to enter scripts (VFP code) which is run when the user clicks the ellipsis button appearing on the top of the Properties Window (as it always did to display the color picker in the color-related properties). This provides the ability to write code to set the selected property (or any other on any of the control currently on the editor). This opens lots of new possibilities for design-time extensions. The way to work with that is quite similar to write Builders.
Beyond the property sheet, enhancements to the internal menu system have been done allowing registering information on the Intellisense table (FoxCode.dbf) to trigger specific actions when menu options are selected. This basically gives you a way to intercept menu selections and change the standard behavior of the VFP IDE. For example, using this feature, Doug Hennig is preparing a customized version of the Add Property dialog which will make the definition of a new property handle MemberData right at the moment, avoiding several steps, making the process more efficient. In fact, it is probably for this to make it into the final VFP 9 release.
A couple great enhancements to the Task Pane are the ability to setup different Intellidrop classes for different projects, and the new Data Explorer, which is kind of an embedded Enterprise Manager that works with SQL Server and VFP databases, and has a some little features not found in its SQL Server cousin. Also, the Data Explorer can be run outside the TaskPane, making it a big new addition to the available tools.
11:00 - Creating useful user interfaces
Tamar Granor
This session was heavily based on the appreciation of many of the Quicken visual controls and interface. Tamar stated that the most useful UIs are in general the ones you don't notice at all. It's not about doing something fancy or clever, but something that is speeds the user tasks.
There were two main samples, the first one a data-entry form for employee information which used the new AutoComplete feature built into VFP 9.0, the already classical Tamar's QuickFill combobox, and a special DatePicker combo.
After discussing some usability issues, she spent quite some time explaining the AutoComplete feature, although it was lately made a point about the most appropriate situations to put it in use.
The session was very good, but disappointed me a little because I though it would be about deeper usability questions. I agree with Tamar about the AutoComplete having actually a very limited use, as in most cases, if you want the user to pick from a fixed list set, you've better use a regular combobox, or a special one like Tamar's QuickFill.
As for the Date picker combo, it was based on the Calendar ActiveX provided by the Visual Studio Common Dialogs. And here again, I really don't like very much how it behaves. It's true that writing your one Calendar in VFP code is a lot more work, but being the kind of things you write once and use all the time, it's not that really bad. And indeed, there are many of them already written that you can customize for your needs. So much, most of the explanation about how this Date picker works was based on tricks to overpass the weird ActiveX implementation.
The second part or the session was dedicated to other conflictive idea: Adaptive menus. These are the collapsible menus as used since Office 2000 and on; which hide the less used options, and add a chevron at the lower part to expand the popups when one wants to look at the entire option set. And most of the code and explanation went trough a smart use of GenMenuX drivers to produce all the complex code needed to handle this.
But then again, I'd never use this in my user interfaces. I think this is a confusing technique that is indeed covering poorly designed menus in the first place. As in the case of Word or Excel, I think the real problem is the applications are bloated and menus not very good organized.
This session provoked mixed feelings on me. For once, it was interesting to see some techniques that I've already used in other situations and get some additional ideas. But then again, while the goal was to talk about useful UIs, I think many of the methods presented are not that useful, but indeed quite debatable, as Tamar herself recognized at the start of the presentation.
13:30 - N-Tier: No more tears
Claudio Lassala
Well, if you've been reading this report for the previous days, you already know that Claudio and I had a few coincidences in the topics we presented, as well as other speakers, also. Indeed, we both thought that this session and mine were very complementary.
Basically, what he presented is the basic conceptual ideas behind my TierAdapter framework, so it was great to attend his presentation and look at his approach.
He started by listing the goals we seek when looking for N-tier architectures; basically, more customer satisfaction, faster means of customization and extension, and higher reusability levels.
Compared with the traditional monolithic application in VFP, we need a more flexible architecture allowing us to separate the responsibility of the components we develop, and the people who actually does this job, and be prepared for changes at different aspects, and fundamentally to grow together with our customers.
He detailed the typical three layers: UI, Business and Data, and explained each one of them, and then showed a few slides representing the monolithic app versus its tiered counterpart, explaining the pros and cons of each model.
For the n-tier architecture he pointed out the following advantages: Scalability (distributed apps), Portability (change dbs, change UIs), Separation of different skills (DB specialists, biz logic specialists, UI designers), and Maintainability.
One more I would add to the list and because I highly value is Testability. I know many time COM components are hard to debug, but what I'm referring to is that once you separate business logic from the UI, you can easily automate the business logic testing. While it is difficult to test all the possible combinations for an slightly complex form, you can programmatically instantiate a business component and put it into several nested loops to make it perform thousands of transactions in a matter of minutes. And this same simple test script can be run anytime a change is done on the component.
His VFP example was basically using the same techniques I use, passing XML data between tiers. The main differences were that he was relying in single-record objects and scatter/gather name to put the data there, then serializing them using Rick Strahl's wwXML class. But this was mainly due because his example was built in VFP 7 code, using XmlToCursor instead of XmlAdapters. This is not a problem, anyway, to explain the concepts behind the model. Indeed, this makes the samples easier to understand for this introductory level.
He ran out of time to show the complete details of his last sample involving the reuse of his business components from an ASP.NET interface, although it showed enough to make clear how easy it is to do it, and showed the actual interface using both VFP and SQL data, and VFP Windows and ASP.NET WebForm interfaces doing the same thing.
This session was really good, as always with Claudio's. It's not a strange that he always end up at the top of the speaker's ranking at this conference, even having such an impressive competitors.
15:00 - DirectX on the Managed Platform
Markus Egger
As Markus himself introduced this session, it was the last session of the conference, so, a cool topic was what we needed!
I learned a good deal about GDI+ management last year on a couple Markus presentations, so I won't miss this one, introducing a topic as interesting as DirectX. It was a long time since I last do something related to game development technology, but I've being watching closely the evolution on rendering technology, but without getting my hands on. So here was a good chance calling.
Just to wet our appetite, Markus began the session by playing a short video sample on DirectX with a couple race cars colliding in the middle of a futuristic aisle. It was pretty impressive, very realistic, and he explained it was completely rendered using DirectX.
Then he started talking about the Direct3D API, which basically is talking right to the Graphic Processor. DirectX is just the pipe to do this, and as such is able to talk with different GPUs, abstracting the developers from most low level tasks, and indeed, if the graphics card is not powerful enough, it solves the graphic using the main CPU, which is very slow and not efficient at all.
Something important he noticed is that this stuff is not just constrained to the game industry anymore, and its going mainstream basically because business applications are turning increasingly complex and in many cases is not enough with pie charts anymore. Also, the next generation of Windows, code-named Longhorn, will use DirectX as its main graphic interface instead of GDI+, basically leveraging all the power of the new graphics cards, which are already standard gear on every PC.
And another very important reason to learn this stuff is that… it's cool!
The version of DirectX supported by the current version of the .NET is DirectX 9, so it's important to upgrade if you want to try some of this. Also, to do anything serious, you go better for an ATI or NVIDIA card.
The good news is that you can do almost anything in managed code. It is not required to use C++ for this kind of things anymore. Indeed, as 99% of all the work is made by the GPU, there are not so much things requiring very low level management.
So, basically, it everything starts by rendering triangles. Markus explained that this is the basic unit for everything because a triangle is the simplest shape representing a plane. All other polygons are resolved by combining triangles over a 3D space. Then there are additional elements like lights, a camera, colors and textures.
Objects are located on a 3D space called its "world" which have a lot of properties, and delimits a 3-axys system. The camera is placed at some point over this world, and the intersection you determine from this view point to the actual object is the view plane, which is the frame you'll render on the monitor.
Something very important about DirectX is that, unlike GDI+ where you render an object and invalidate it if you need to redraw it (for example, when other object pass over it), here you are making a continuous rendering, meaning that the GPU is recalculating the frame all them time, from 25 times a second above, depending on your needs and the GPU power.
Each 3 points unit or triangle is called a vertex, and a lot of math is actually involved in all this, but fortunately, most of it is taken care by Direct3D and the graphic hardware.
Some other important concepts to keep in mind are vector points, which determine length and movement, and provide direction for objects. Also, matrix transformations are applied to handle movement and position, rotation and scaling.
To start a .NET project, the first step is to add a reference to the DirectX namespace, and then make a declaration to the hardware. This is done trough Manager classes, and you can make your application windowed or full-screen (as most games do).
There are quite a few details to watch out, like the SwapEffect, BackBuffer, 3DDevice, etc. This wasn't easy to track, and Markus white-paper is not yet available, but it is quite likely that you can find it later on the EPS website, if you want more details.
The samples were not as sophisticated as the cars video, but they provided a fair idea of the basics. He basically defined a triangle, rendered it in a few different ways, then made it rotate along one and then all its axes. Next step was go to apply materials instead of solid colors, which directly affected by light, and further on, use textures, which are basically bitmaps applied over the polygons.
For more complex objects meshes are used. They are basically vast collections of polygons composing 3D objects, like cubes, spheres, or teapots. Strangely as it sounds, there is a native mesh on DirectX for the classical 3D teapot. This kind of complex objects brings another problem, which is determining visible and hidden parts. To do that there are two techniques: back culling, or another called z-buffer. Finally, Markus talked a bit about available tools to create complex meshes without having to define them polygon by polygon.
As a final example, he showed a sample mesh representing a person with lots of different textures to form her clothes, hair and above all his face, which was the most polygon-dense part to model her features.
Overall, this is an exciting topic to start exploring. It is not the kind of thing you will be using everyday if you are a business application developer, but you can find cases in which this kind of approach can add value to your solutions, and beside that, this is the kind of things that keep us developers in good shape. A very good session to close this exceptional conference.
16:30 - Clossing Session
Even while many people left the conference during the afternoon, rushing to catch flights or buses on their way home, the ballroom was packed when our host Jean-René Roy climbed to the stage to talk with us for the last time this conference.
He did a brief recap about the event, thanked the speakers for their hard work and their commitment, and also the sponsors for their active support and contributions. He told us again that this is a conference for developers made by developers, and his words were very encouraging for everyone to keep advancing on our careers, constantly learning and sharing among peers.
Then our official magician, Maitré Pierre, who's also a developer (it couldn't be other way), did a short show for us, and he was truly amazing, It wouldn't be fun to try to narrate a series of magic tricks with a nice comedy level, so you'll have to come to Montreal next year to appreciate it for yourself.
After the show, Jean-René did a good raffle giving away a lot of high-value products. Here is the full detail: