Category Archives: software development

Delphi XE still not quite ready for Vista/Windows 7

I’ve successfully installed Embarcadero RAD Studio XE (including Delphi). I’m running Windows 7 64-bit. On first quitting RAD Studio (which is still called bds.exe – it stands for Borland Development Studio) I got this message:

image_thumb2

Fortunately I know exactly what this means. Read here for my earlier explanation. And if I go to the registry editor I can see these entries:

image_thumb4

I also still get the error:

Error executing ‘C:\ProgramData\{7DE921C9-42C8-4DA3-8A44-043C3349FD1D}\Setup.exe’: The requested operation requires elevation

In one sense the error is not important, and the dialog does not reappear. It is still an ugly dialog, and as you can see from my Registry Editor, not a new one. Maybe next time?

Review: Tapworthy – designing great iPhone Apps by Josh Clark

Developing for iPhone is a hot topic. Many developers are not only having to learn Apple’s Objective C and the Cocoa application framework, but are also new to mobile development. It is a big shift. Josh Clark is a iPhone designer, and his book Tapworthy is about how to design apps that people will enjoy using. It is not a programming book; there is not a single snippet of Objective C in it.

His book illustrates the power shift that has taken place in computing. In the early days, it was the developer’s task to make an application that worked, and the user’s task to understand how to use it, through manuals, training courses, or whatever it took.

There are still traces of this approach in the software industry, but when it comes to iPhone apps it has reversed completely. The app creator has to build an app that the user will find intuitive, useful and fun; otherwise – no sale.

An early heading reads “Bored, Fickle and Disloyal”. That’s the target user for your app.

Clark’s point is valid, and he does hammer it home page after page. You will get the message; but it can get tiresome. His style is frank and conversational: some readers will love it, others will find it grating after a chapter or two.

Even if you are one of the latter group, it is worth persevering, because there is a ton of good content here. There are also numerous short interviews with developers of actual apps, many of them well-known, discussing the issues they faced. The persistent issue: we’ve got a complex app, a small screen, and intolerant users, how on earth do we make this seem simple and intuitive?

Constraints like these can actually improve applications. We saw this on the web, as the enforced statelessness and page model of web applications forced developers to simplify the user interface. It is the same with mobile. Joe Hewitt, author of the first generations of Facebook for iPhone:

There is so much stuff that is actually better on the small screen because it requires designers to focus on what’s really important.

So what’s in the book? After a couple of scene-setting chapters, Clark drills down into how to design for a tiny touchscreen. Be a scroll sceptic, he says. Chapter 4 then looks at app structure and navigation. Chapter 5 takes you blow by blow through the iPhone controls and visual elements. Then we get a chapter on making your app distinctive, a chapter on the all-important start-up sequence and how to make seem instantaneous, and a chapter on touch gestures.

The last three chapters cover portrait to landscape flipping, alerts, and finally inter-app communication and integration.

Throughout the book is illustrated in full colour, and the book itself is a pleasure to read with high quality paper and typography. 300 pages that will probably improve your app design and increase its sales; a bargain.

 

Develop for Adobe Flash/Flex in Amethyst for Visual Studio

SapphireSteel Software is poised to release Amethyst, which lets you develop Flash and Flex applications with Microsoft’s Visual Studio 2008 or 2010.

Why bother? There’s two aspects to this. One is simply the comfort factor: if you are a .NET developer used to Visual Studio, but now working on Flash or Flex, this could be an easier way in than the Eclipse-based Flash Builder. There is a visual designer, a full-featured debugger, a property inspector with sections for properties, events, effects and styles, for example, and double-clicking an event generates an event handler as you would expect.

The other factor is areas where Amethyst can improve on what Flash Builder offers. One example is ActionScript refactoring, disappointing in Adobe’s product. Amethyst is not brilliant, but does have a few extras including Extract Method, Encapsulate Field and Extract Interface.

image

Another useful feature is that Amethyst can share projects with Flash or Flash Builder. Before you get excited, it does not do the magic you might want, Visual Studio editing of .fla files with embedded ActionScript. It does work reasonably seamlessly though: you can open .fla file in the Flash IDE by clicking within Amethyst.

This would have been even more interesting if Adobe had not added a measure of Flash Builder integration in Flash Professional CS5; and that is the challenge facing SapphireSteel – how to keep up with Adobe’s official development tools.

I’ve only played briefly with Amethyst but although I’ve been impressed with it in some ways, I also found myself missing features in Flash Builder, such as the Connect to Data wizards, and the view state management.

It is early days though; and I would be interested to hear from others who have tried Amethyst on what they do or do not like about it.

Price is not yet stated, but SapphireSteel also offer a Ruby product which is priced at $49 for a basic edition, or $199 for a professional version. Amethyst also comes in two editions so perhaps we will see something similar.

Visual Studio LightSwitch – model-driven architecture for the mainstream?

I had a chat with Jay Schmelzer and  Doug Seven from the Visual Studio LightSwitch team. I asked about the release date – no news yet.

What else? Well, Schmelzer and Seven had read my earlier blog post so we discussed some of the things I speculated about. Windows Phone 7? Won’t be in the first release, they said, but maybe later.

What about generating other application types from the same model? Doug Seven comments:

The way we’ve architected LightSwitch does not preclude us from making changes .. it’s not currently on the plan to have different output formats, but if demand were high it’s feasible in the future.

I find this interesting, particularly given that the future of the business client is not clear right now. The popularity of Apple’s iPad and iPhone is a real and increasing deployment problem, for example. No Flash, no Silverlight, no Java, only HTML or native apps. The idea of simply selecting a different output format is compelling, especially when you put it together with the fast JIT-compiled JavaScript in modern web browsers. Of course support for multiple targets has long been the goal of model-driven architecture (remember PIM,PSM and PDM?) ; but in practice the concept of a cross-platform runtime has proved more workable.

There’s no sign of this in the product yet though, so it is idle speculation. There is another possible approach though, which is to build a LightSwitch application, and then build an alternative client, say in ASP.NET, that uses the same WCF RIA Services. Since Visual Studio is extensible, it will be fun to see if add-ins appear that exploit these possibilities.

I also asked about Mac support. It was as I expected – the team is firmly Windows-centric, despite Silverlight’s cross-platform capability. Schmelzer was under the impression that Silverlight on a Mac only works within the browser, though he added “I could be wrong”.

In fact, Silverlight out of browser already works on a Mac; the piece that doesn’t work is COM interop, which is not essential to LightSwitch other than for export to Excel. It should not be difficult to run a LightSwitch app out-of-browser on a Mac, just right-click a browser-hosted app and choose Install onto this computer, but Microsoft is marketing it as a tool for Windows desktop apps, or Web apps for any other client where Silverlight runs.

Finally I asked whether the making of LightSwitch had influenced the features of Silverlight or WCF RIA Services themselves. Apparently it did:

There are quite a few aspects of both Silveright 4 and RIA services that are in those products because we were building on them. We uncovered things that we needed to make it easier to build a business application with those technologies. We put quite a few changes into the Silverlight data grid.

said Schmelzer, who also mentioned performance optimizations for WCF RIA Services, especially with larger data sets, some of which will come in a future service pack. I think this is encouraging for those intending to use Silverlight for business applications.

There are many facets to LightSwitch. As a new low-end edition of Visual Studio it is not that interesting. As an effort to establish Silverlight as a business application platform, it may be significant. As an attempt to bring model-driven architecture to the mainstream, it is fascinating.

The caveat (and it is a big one) is that Microsoft’s track-record on modelling in Visual Studio is to embrace in one release and extinguish in the next. The company’s track-record on cross-platform is even worse. On balance it is unlikely that LightSwitch will fulfil its potential; but you never know.

Ten things you need to know about Microsoft’s Visual Studio LightSwitch

Microsoft has announced a new edition of Visual Studio called LightSwitch, now available in beta, and it is among the most interesting development tools I’ve seen. That does not mean it will succeed; if anything it is too radical and might fail for that reason, though it deserves better. Here’s some of the things you need to know.

1. LightSwitch builds Silverlight apps. In typical Microsoft style, it does not make the best of Silverlight’s cross-platform potential, at least in the beta. Publish a LightSwitch app, and by default you get a Windows click-once installation file for an out-of-browser Silverlight app. Still, there is also an option for a browser-hosted deployment, and in principle I should think the apps will run on the Mac (this is stated in one of the introductory videos) and maybe on Linux via Moonlight. Microsoft does include an “Export to Excel” button on out-of-browser deployments that only appears on Windows, thanks to the lack of COM support on other platforms.

I still find this interesting, particularly since LightSwitch is presented as a tool for business applications without a hint of bling – in fact, adding bling is challenging. You have to create a custom control in Silverlight and add it to a screen.

Microsoft should highlight the cross-platform capability of LightSwitch and make sure that Mac deployment is easy. What’s the betting it hardly gets a mention? Of course, there is also the iPhone/iPad problem to think about. Maybe ASP.NET and clever JavaScript would have been a better idea after all.

2. There is no visual form designer – at least, not in the traditional Microsoft style we have become used to. Here’s a screen in the designer:

image

Now, on one level this is ugly compared to a nice visual designer that looks roughly like what you will get at runtime. I can imagine some VB or Access developers will find this a difficult adjustment.

On the positive side though, it does relieve the developer of the most tedious part of building this type of forms application – designing the form. LightSwitch does it all for you, including validation, and you can write little snippets of code on top as needed.

I think this is a bold decision – it may harm LightSwitch adoption but it does make sense.

3. LightSwitch has runtime form customization. Actually it is not quite “runtime”, but only works when running in the debugger. When you run a screen, you get a “Customize Screen” button at top right:

image

which opens the current screen in Customization Mode, with the field list, property editor, and a preview of the screen.

image

It is still not a visual form designer, but mitigates its absence a little.

4. LightSwitch is model driven. When you create a LightSwitch application you are writing out XAML, not the XAML you know that defines a WPF layout, but XAML to define an application. The key file seems to be ApplicationDefinition.lsml, which starts like this:

image

Microsoft has invested hugely in modelling over the years with not that much to show for it. The great thing about modelling in LightSwitch is that you do not know you are doing it. It might just catch on.

Let’s say everyone loves LightSwitch, but nobody wants Silverlight apps. Could you add an option to generate HTML and JavaScript instead? I don’t see why not.

5. LightSwitch uses business data types, not just programmer data types. I mean types like EmailAddress, Image, Money and PhoneNumber:

image

I like this. Arguably Microsoft should have gone further. Do we really need Int16, Int32 and Int64? Why not “Whole number” and “Floating point number”? Or hide the techie choices in an “Advanced” list?

6. LightSwitch is another go at an intractable problem: how to get non-professional developers to write properly designed relational database applications. I think Microsoft has done a great job here. Partly there are the data types as mentioned above. Beyond that though, there is a relationship builder that is genuinely easy to use, but which still handles tricky things like many-to-many relationships and cascading deletes. I like the plain English explanations in the too, like “When a Patient is deleted, remove all related Appointment instances” when you select Cascade delete.

image

Now, does this mean that a capable professional in a non-IT field – such as a dentist, shopkeeper, small business owner, departmental worker – can now pick up LightSwitch and and write a well-designed application to handle their customers, or inventory, or appointments? That is an open question. Real-world databases soon get complex and it is easy to mess up. Still, I reckon LightSwitch is the best effort I’ve seen – more disciplined than FileMaker, for example, (though I admit I’ve not looked at FileMaker for a while), and well ahead of Access.

This does raise the question of who is really the target developer for LightSwitch? It is being presented as a low-end tool, but in reality it is a different approach to application building that could be used at almost any level. Some features of LightSwitch will only make sense to IT specialists – in fact, as soon as you step into the code editor, it is a daunting tool.

7. LightSwitch is a database application builder that does not use SQL. The query designer is entirely visual, and behind the scenes Linq (Language Integrated Query) is everywhere. Like the absence of a visual designer, this is a somewhat risky move; SQL is familiar to everyone. Linq has advantages, but it is not so easy to use that a beginner can express a complex query in moments. When using the Query designer I would personally like a “View and edit SQL” or even a “View and edit Linq” option.

8. LightSwitch will be released as the cheapest member of the paid-for Visual Studio range. In other words, it will not be free (like Express), but will be cheaper than Visual Studio Professional.

9. LightSwitch applications are cloud-ready. In the final release (but not the beta) you will be able to publish to Windows Azure. Even in the beta, LightSwitch apps always use WCF RIA Services, which means they are web-oriented applications. Data sources supported in the beta are SQL Server, SharePoint and generic WCF RIA Services. Apparently in the final release Access will be added.

10. Speculation – LightSwitch will one day target Windows Phone 7. I don’t know this for sure yet. But why else would Microsoft make this a Silverlight tool? This makes so much sense: an application builder using the web services model for authentication and data access, firmly aimed at business users. The first release of Windows Phone 7 targets consumers, but if Microsoft has any sense, it will have LightSwitch for Windows Phone Professional (or whatever) lined up for the release of the business-oriented Windows Phone.

Measuring start-up time for .NET, Java, C++

A comment here points me to this comparison by Decebal Mihailescu of start-up times for processes on Windows using different runtimes: .NET in several versions, Java 1.6, Mono 2.6.4, and Visual C++ 2010 (native code).

image

It is notable that native code is much faster than the runtimes, and that .NET is ahead of Java – to be expected, perhaps, since Windows is its native environment.

The test application is tiny and when we are talking about a time of less than a tenth of a second, users are unlikely to care much. I would like to see tests based on a larger application; on the other hand it becomes increasingly difficult to make a fair comparison.

It’s a shame Embarcadero Delphi was not included, though I’d expect similar figures to those for Visual C++.

Start-up time is critical to perceived performance. One reason I use an ancient version of Paint Shop Pro for simple image manipulation is that I can double-click an image and be editing it instantly, whereas alternatives like Adobe PhotoShop or the free paint.net make me wait. Unless I need the extra features these provide, I stick with fast and simple.

Internet Explorer 9 Preview gets to 95% on Acid 3

Microsoft has released the fourth platform preview for Internet Explorer 9, which you can download here. This is the last preview before the beta release, expected in September.

When IE9 was first previewed, back in March, it scored only 55% on the Acid3 standards test – well ahead of IE8 which scores around 20%, but far short of rivals like Google Chrome and Apple Safari which achieve full marks. Mozilla Firefox is at 94%.

Acid 3

The new preview is at 95%. IE9 is now up there with them – but why not 100%?

According to UK Web Product Manager Mark Quirk, it is down to three features, two of which are related to SVG (Scalable Vector Graphics). Two points are lost because of SMIL (Synchronized Multimedia Integration Language) presentations, which Microsoft does not intend to support because a similar feature will be part of CSS in future. Two points are lost because of SVG fonts, which again Microsoft does not intend to support because it sees WOFF (Web Open Font Format) as the future standard here. One point is lost because of the inability to draw SVG fonts on a path, though there are other ways to draw fonts on a path.

The bottom line: IE9 will most likely stay at 95% right through to its final release.

Incidentally, IE9 JavaScript performance is wildly faster than IE8, thanks to the new “Chakra” engine. IE9 is on the left, Firefox 4 on the right :

image

So when will we get IE9? Although it is not long to September, there is a major difference between the preview and the coming beta, which is that the preview does not have a full user interface. It is mainly to show off the rendering and JavaScript engine. Therefore we can expect new features in the beta versus the preview. Despite that, Quirk says that Microsoft intends the beta to be “good quality for any user”, not just for brave developers and testers.

But how long before the final release? Microsoft is not saying, though when I suggested the first half of 2011 as a reasonable guess, Quirk reminded me that the beta will be high quality and that the release should therefore follow “not too long” after.

Since we will get much of HTML 5 in IE alongside the other popular browsers, do we still need Silverlight?

“As the number of the things you can implement with HTML clearly goes up, the need for Silverlight and Flash goes down,” said Quirk, though he added hastily, “The value that those players add needs to go higher.”

I’d add that even if IE9 is all that we hope, it will take years before older versions fall out of use. Recently the UK government said it will stick with IE6, and whatever you think of that decision, it shows how hard it is to get browsers upgraded everywhere. By contrast, plug-ins like Flash and Silverlight get updated rather fast. I noticed on Riastats today that over 50% of browsers now have the latest Silverlight, and 39% already have Flash 10.1 – over 90% have Flash 10 or higher.

image

If you combine that issue with things like video playback that are problematic even in HTML 5, it suggests that plug-ins will be with us for the foreseeable future, though it is quite possible that their use may decline.

Another factor is tool support, mature for Flash and Silverlight, but not for the newest features of HTML. After IE9 appears, will Microsoft come up with tools that properly support it, in Expression Web and Visual Studio? “We have to, it’s as simple as that,” says Quirk, though he adds, “we haven’t said when.”

Stats that matter: Android grows in mobile, IE stops declining, eBooks take off

This should be three blog posts; but you’ve read this news elsewhere. Still, I can’t resist a brief comment on three recent trends.

Browsers

The first is that usage of Microsoft’s Internet Explorer has levelled off after a long period of decline. Microsoft says it is increasing but the numbers are too small to say that with confidence. StatCounter global stats for May to July show slight decline for IE (52.83% –> 52.37%) and FireFox (31.54%->30.88%), with Google Chrome the main beneficiary (8.81%->10.32%).

On this blog Chrome has grown from 4.2% to 12.4% in the last year. IE is still declining: 44.9% in July 09, 39.6% in June 10, and 38.2% in July 10.

My guess is that the success of Windows 7 might have brought back a few FireFox users. The interesting story though is where Chrome will be when it stops growing its share. My second guess is that it will be ahead of FireFox, though that is speculative. It is WebKit though, and I think that will be bigger than Mozilla’s Gecko thanks to adoption by Google, Apple, Adobe and others.

Mobile

Next, Google Android. Nielsen reports that it has pulled ahead of Apple iPhone in the US SmartPhone market; both are behind RIM’s Blackberry though that is in steady decline. RIM is announcing Blackberry 9800, the first on OS 6, later today; but I doubt it will disrupt Android’s growth. The developer angle is that Android is now equal to Apple’s iPad/iPhone in strategic importance, which will be a relief to Adobe – Flash runs on Android but not iPhone.

Android owners lack the satisfaction of Apple iPhone owners. 21% of them are eyeing the iPhone for their next upgrade, whereas only 6% of iPhone owners want Android next. Only 42% of Blackberry owners intend to remain loyal. It is all tending to confirm my speculation back in April that Android is the new Windows.

So in two years time, what will be the market share for RIM, Nokia Symbian/MeeGo, Windows Phone, HP Palm WebOS? It will not be easy for any of them.

eBooks

Finally, eBooks. The Kindle vs iPad vs Nook vs Sony is one story; but the bigger one is that the eBook is happening at last. David Carnoy’s recent articles on Amazon give the background. One is an interview with Amazon’s Ian Freed in which the retailer says eBook sales have tripled in the first quarter of 2010 vs that in 2009, and claims 70-80% of the market. Another looks at what Amazon didn’t say. However the market shares work out though, what matters is that screen, battery and wireless technology are now good enough, and publishers and authors willing enough, for eBooks to become mainstream, with huge implications for the media industry.

SOA, REST and Flash/Flex – why Flash does not PUT

Adobe’s Duane Nickull has an illuminating post on how the Flash player handles REST. Nickull is responding to a post by Malcolm Box in which he complains how hard it is to use Flash with a REST web service. Box observes that Flash cannot send POST, PUT and DELETE requests when running in the browser, and does not send cookies.

Nickull defends the Flash behaviour:

Flash’s HTTP libraries currently support GET and POST. My architectural view of this is that the HTTP libraries only should really support these and not worry about the others.

He also notes that cookies are a poor way to manage state:

Cookies are for the browser and belong in the browser. Having Flash Player able to access cookies would be a mistake in my own opinion. Any logic that is facilitated by a browser should probably be dealt with at the browser layer before Flash Player is used.

Now, I think the comments on REST are important to read if you are engaged in designing a web service, as many of us in these days of cloud+device. There is a kind-of “word on the street” approach to web services which says that REST is good, SOA/SOAP is bad; but in reality it is not so simple, and these distinctions are muddled. REST is arguably a form of SOA, you can do SOAP with REST, and so on.

One factor is that reading data in a web client is far more common than writing data. It is easy to be an advocate of the simplicity of REST if all you are doing is GET.

The question Nickull asks is whether the transport protocol has any business dictating how the data it transports should be processed, for example whether it is an operation to retrieve or to write data:

In an SOA world, the transport functionality (usually implemented using SOAP) should focus on just delivering the message and it’s associated payload(s) to the destination(s), optionally enforcing rules of reliability and security rather than declaring to the application layer processing instructions to the service endpoint.

Read the post for more of the rationale behind this. Maybe, even if you are doing REST, restricting your web service to GET and POST is not such a bad idea after all.

That said, whatever you think about the architectural principles, you may find yourself having to write a browser-hosted Flash client for a service that requires an HTTP verb other than GET or POST. There are ways round it: see this discussion of Amazon S3 (which uses PUT) and Flash for an example.

Windows Phone 7 briefing report: no enterprise app deployment at launch

I attended a Microsoft briefing on Windows Phone 7 (WP7) yesterday. Here’s a quick summary of what interested me.

It does appear to be a decent phone. Unfortunately I’ve not yet received a preview device, but there’s no doubt that the user experience is well ahead of that on previous Windows Mobile devices.

The user interface is distinctive as you have no doubt seen. Microsoft is building strong links with both Facebook and Windows Live, surfaced at various places, and hopes this will be the best phone for social networking. It also hooks into Xbox Live, though it does not enable real-time multiplayer games, only turn-by-turn.

It has Bing maps with GPS support, though I suspect it will not be the equal of Google Maps on iPhone or Android. However, at least Microsoft is not in Apple’s position where it relies on a competitor for this key application.

One significant aspect for both users and developers is Tile Notifications. Each installed app has a tile which the user can install on the Start (home) page. These tiles can display text and image notifications that can be customized for the user. For example, a travel app could show a red alert and a message if a plane was cancelled or delayed. A sports app could show the latest score for your favourite team. However, there is no multi-tasking, so most of the time the app is not even running. How does this work?

The answer is that Microsoft hosts a notification server through which app vendors can push notifications. The app vendor needs to store on its own server any user-specific data, such as which flight she has booked. The app vendor can then push notifications to the user via Microsoft’s service. A more detailed explanation is here.

I like this form of notification since it is non-intrusive for the user. If you do not want to see them at all, you can just remove the tile from the Start page.

Microsoft confirmed that in-browser Silverlight will not work on launch. This strikes me as surprising, since Silverlight is built into the OS. I guess it will come later.

I asked a few questions.

When will we get Windows Phone 7? Microsoft is only saying “for Christmas 2010”.

Will it support tethering? No comment at the moment.

Will there be any way to copy a file from your PC to the device? I thought this would get a straightforward answer, but it did not. I was told that the PC side of WP7 has not been announced yet. However, it will bear some relation to what has been done before for Zune – though the UK still might or might not get the Zune Pass subscription service. Prompted by this discussion, I downloaded the Zune software. It is nicer to use than Windows Media Player, for sure. Why does Microsoft have two free media players, a good one that is reserved for a small niche of US users, and a mediocre one that comes with every version of Windows? You tell me.

image

Will there be any way to deploy applications without going through the Marketplace? The answer is mostly “No”, though Microsoft knows this is necessary for corporate apps and says there will be an announcement on the subject later this year. That said, there is a developer portal, intended for testing your apps, where you can specify up to 5 or 10 users who can download and install an app. This is in effect a limited private deployment, though it is not intended for that purpose.

Deploying apps to Windows Phone 7 will be slightly more expensive than it is for Apple’s iPhone. The policies are explained here. You pay $99 to register, which gets you five free submissions, after which it is $19.99 per app. Each registration is limited to five free apps, but there is no limit on paid apps. There is a 70/30 revenue split. The idea is to limit the number of low quality apps. Not a bad thing considering the amount of junk in Apple’s App Store.