(This is the second half of my post from the first day of the first pre conference day at PDC 05)
The afternoon started off with some more discussion on data binding and on objects with a focus on business logic. At this point the session started to get more interesting, since now they were starting to cover the parts of application design where I still have some doubts and unclear issues regarding Smart Clients (or WAFDR applications, if you read my previous post). Here it also became apparent that Lhotka did put the business logic in custom objects on which he did data binding, which I was wondering about in my previous post. How to move the data between the client and the server was discussed at some length, with a jab at Juwal Löwy on the topic of whether to use web services, enterprise services or remoting (Juwal is fanatic about Enterprise Services, I’ve heard him preach on the subject in a number of presentations). Basically the point here was that using IIS is the easiest and Enterprise Services the fastest. So regardless of what the Enterprise Services Taliban says I guess at least I would recommend using the simplest solution available, as long as it still does the job. In many cases that means hosting your server in IIS.
Layers in a Smart Client
Next was the topic of layers and tiers, and why they matter when designing an application. This was pretty basic stuff, at least if you’ve worked on reasonably large applications. The “traditional” view on this topic works somewhat well in a Smart Client scenario, but since most Smart Clients need to work off line that adds some complexity to the picture and has an impact on the application architecture. Since the business logic needs to run on at least the client, and in many cases some of it has to run on the server, you need to slightly rethink how you structure you app. Lhotka was describing it through a data portal pattern, which was just a way of describing an architecture where you had a server that exposed a bunch of data-related services that were exposed to a client, where they were hidden away by a facade. The business logic accesses the data through the facade, without having to concern itself with from where and how the data is being produced. Pretty basic stuff, and I was happy to see that they were recommending some of the same solutions that we have been putting into our solutions for the past half year. The major of the remainder of this part of the session was spent on talking about which part of the business objects live in which layer, and where it exists as data and where it exists as a business object (the difference between business logic and data here is that a business object contains layer). The model Lhotka came off as recommending was one where the business objects exist both on the client and the server, so that you can have a situation where you don’t need to trust the client; the server can make its own choices on the data in the objects without assuming that the client has used the correctly.
I had been a bit worried about the risk of finding out a bunch of new and superior ways of architecting a distributed app for a Smart Client compared to the stuff I’ve been doing at work, but fortunately that was not the case. That could have resulted in some re-engineering in a bunch of customer objects, which I would prefer not to have to do at this point… There was a lot of nice details here, and it was good to get confirmation of the design choices we’ve been doing.
New stuff in Windows Forms 2.0
I won’t write about this in great length, it’s a topic that has been covered quite a lot in other blogs. I’ll just quickly mention some of my favorite things (I already mentioned the grid in my previous post). The first would be the two new layout controls (flow and table layout). This is basic stuff if you’ve worked with UIs in Java, but it’s new in Windows Forms. Hollis pointed out that in the Smart Client world you can’t make so many assumptions about what the user’s screen proportions and size are (consider Tablet PC:s for example), and therefore the layout controls can be very useful. I agree completely with this. Furthermore they help in making sure your UIs always look and behave the same. The next thing I’d like to mention are the new toolbars and menus, now they look like proper Office menus and toolbars, which is something I’ve missed in the standard controls. Basically we’ve had to use third party controls in all our apps, and I mentioned what I thought about that in my previous post… Finally the fact that you can tell your text boxes what kind of data you want them to accept (in the shape of format strings) is very nice and a great help in making it easier for users to enter correct data.
New language features in VB and C#
Why this was included in this session is beyond me. I won’t cover it here, except for to note that VB (which I don’t use) has a new keyword called “IsNot”. So you can write grammatically disastrous code along the lines of:
“If myVariable IsNot Nothing Then”
English is not my native language, but isn’t that a double negation? Shouldn’t it have been called:
“If myVariable IsSomething Then” or “If myVariable Is Something”?
The first alternative is a bit illogical (which would make it excellent for inclusion in VB), but I really like the second one. That would only have required that they would have introduced an alternative (or actually an opposite) of the already existing “Nothing”. Neat. That would have allowed you to write stuff like:
“If Something Is Nothing Then”
and of course, instead of writing “1 = 1” or “2 > 1” to indicate statements that would always be true you could instead type “Something > Nothing”. But then again I guess that you can’t always know if Something actually is more than Nothing. If Freedom can be a another word for Nothing left to lose, and Nothing ain’t worth Nothing but it’s free, then quite obviously Nothing is Free, and therefore it is also Something. This is getting rather philosophical, which again would have put it firmly out of reach of VB. Hmm, wouldn't it be valid VB code to write “If Nothing IsNot Nothing Then”, and that would always evaluate to false? Does that mean that VB is trying to tell us that Janis was wrong? Damn this jet lag.
Click Once install
I’ve blogged about this before, so I won’t go into detail on it now, except for to say that I really like it. I think it will considerably simplify application deployment, at least for deploying applications in a corporate scenario. One thing I believe I didn’t mention last time I wrote about this is that Click Once can not do background updates (like Windows Update and the Application updater block does). This will be added later, apparently when Vista comes around. I do think this is a bit of an annoyance, but as long as the application is running on a fast network and not over the Internet is should not be a problem. On the other hand, with careful use of the options for selecting how the update should behave (check on startup, compulsory update etc.) I think it will not make such a big difference that the application can’t update in the background. Will have to get back to this when I’ve had a chance to test it out a bit more.
The bootstrapper is nice. If it works as promised then Click Once will be able to install stuff like the .NET Framework and SQL Server Express as part of the installation processes. That will be seriously cool.
Comments