Category Archives: software development

Silverlight 4 with COM can do anything – on Windows

At PDC Microsoft played down the significance of adding COM support to Silverlight 4 when run out of the browser and fully trusted (you can also be out of the browser and not fully trusted). The demos were of Office automation, and journalists were told that the feature was there to satisfy the requests of a few Enterprise customers.

Now former Microsoft Silverlight program manager Justin Angel, who has implemented his blog in Silverlight, has spelt out what we all knew, that Silverlight with COM support can do just about anything. His richly-illustrated blog post has code examples for:

  • reading and writing to any file (subject I guess to the permissions of the current user)
  • executing any command or file
  • emulating user input with WShell.SendKeys
  • pinning files to the Windows 7 taskbar
  • reading any registry values
  • adding an application to the Windows startup folder
  • doing text to speech using Windows built-in engine
  • accessing local databases with ODBC
  • automating scanners and cameras
  • using the Windows 7 location API, accessing the full .NET Framework
  • and of course … automating Microsoft Office.

Well, fully trusted means fully trusted; and these are great features for powerful though Windows-only Silverlight applications, though I hope no user installs and trusts one of these applets thinking it is “only Silverlight” and can’t do much harm.

The post also has comments on the lack of any equivalent feature for the Mac in Silverlight 4:       

If Microsoft chooses to not go ahead with Mac support in Silverlight 4 RTM, well, it’s not because they couldn’t

says Angel, suggesting that it would be easy to add AppleScript support. (I had to type that quote – no clipboard support in Silverlight 3).

Of course there is time for Microsoft to unveil such a feature, say at Mix10 in March, though I wouldn’t count on it.

Why F# rather than IronPython in Visual Studio 2010?

Dynamic languages are all the rage; and after JavaScript, Python is perhaps the dynamic language of the day, loved by Google and gaining increasing attention. IronPython, built on .NET, is stable and at version 2.6. Now Visual Studio 2010 turns up with an additional language in the box, but it is not IronPython; rather it is a little-known language out of Microsoft Research called F#.

Now, F# is very interesting and brings real diversity to Visual Studio; it is great for mathematics and for parallel programming. But wouldn’t IronPython have sparked more immediate interest from the .NET community? Judging by this feature request, with 500 votes, it would. It’s is a little embarrassing for Microsoft that the favoured IDE for IronPython work is SharpDevelop. Plenty of IronPython enthusiasts are pressing for Visual Studio support.

Here’s what IronPython MVP Jeff Hardy says:

I think I can safely say that adding full, high-quality support for IronPython to Visual Studio would require at least a couple of man-years of work. The rabbit hole goes pretty deep when you consider all of the functionality that VS offers, not to mention the difficulty of doing IntelliSense well. I estimate they’d have to at least double the IronPython team to get full support into VS11. IronRuby would require the same commitment.

Hardy is hopeful for VS 2012.

I still find it odd. Official Visual Studio integration would do a lot to raise awareness and usage of IronPython; and make Microsoft’s commitment to dynamic languages more visible – though I guess F# supporters will be happy with Microsoft’s priorities here.

Windows Presentation Foundation now ready, too late

The immortal film The Railway Children has a scene in which a band plays during an award presentation. Unfortunately a series of false starts delay the performance, until finally it all comes together and the music begins. The camera pans – the audience has already departed.

Is it like that for WPF (Windows Presentation Foundation), Microsoft’s user interface framework which is built on .NET and DirectX and was intended to replace the ancient GDI (Graphics Device Interface) and GDI+?

In this new post I make the case that with WPF 4.0 is the framework is now truly ready to use, not least because Microsoft itself is using it in Visual Studio and the interaction between these two teams has solved a number of problems in WPF.

But who now wants to develop just for Windows? Well, it makes sense in some contexts, though I note that in the Thoughtworks paper on emerging technology and trends about which I wrote yesterday, neither Windows nor WPF gets a mention. Nor for that matter does the Mac, Linux, or OS X, though iPhone and Android feature strongly. The only emerging desktop technology that interests Thoughtworks is the browser.

Technology trends: Silverlight, Flex little use says Thoughtworks as it Goes Google

Today Martin Fowler at Thoughtworks tweeted a link to the just-published Thoughtworks Technology Radar [pdf] paper, which aims to “help decision makers understand emerging technologies and trends that affect the market today”.

It is a good read, as you would expect from Thoughtworks, a software development company with a bias towards Agile methodology and a formidable reputation.

The authors divide technology into four segments, from Hold – which means steer clear for the time being – to Adopt, ready for prime time. In between are Assess and Trial.

I was interested to see that Thoughtworks is ready to stop supporting IE6 and that ASP.NET MVC is regarded as ready to use now. So is Apple iPhone as a client platform, with Android not far behind (Trial).

Thoughtworks is also now contemplating Java language end of life (Assess), but remains enthusiastic about the JVM as a platform (Adopt), and about Javascript as a first class language (also Adopt). C# 4.0 wins praise for its new dynamic features and pace of development in general.

Losers? I was struck by how cool Thoughtworks is towards Rich Internet Applications (Adobe Flash and Microsoft Silverlight):

Our position on Rich Internet Applications has changed over the past year. Experience has shown that platforms such as Silverlight, Flex and JavaFX may be useful for rich visualizations of data but provide few benefits over simpler web applications.

The team has even less interest in Microsoft’s Internet Explorer – even IE8 is a concern with regard to web standards – whereas Firefox lies at the heart of the Adopt bullet.

In the tools area, Thoughtworks is moving away from Subversion and towards distributed version control systems (Git, Mercurial).

Finally, Thoughtworks is Going Google:

At the start of October, ThoughtWorks became a customer of Google Apps. Although we have heard a wide range of opinions about the user experience offered by Google Mail, Calendar and Documents, the general consensus is that our largely consultant workforce is happy with the move. The next step that we as a company are looking to embrace is Google as a corporate platform beyond the standard Google Apps; in particular we are evaluating the use of Google App Engine for a number of internal systems initiatives.

A thought-provoking paper which makes more sense to me than the innumerable Gartner Magic Quadrants; I’d encourage you to read the whole paper (only 8 pages) and not to be content with my highlights.

A year of blogging: another crazy year in tech

At this time of year I allow myself a little introspection. Why do I write this blog? In part because I enjoy it; in part because it lets me write what I want to write, rather than what someone will commission; in part because I need to be visible on the Internet as an individual, not just as an author writing for various publications; in part because I highly value the feedback I get here.

Running a blog has its frustrations. Adding content here has to take a back seat to paying work at times. I also realise that the site is desperately in need of redesign; I’ve played around with some tweaks in an offline version but I’m cautious about making changes because the current format just about works and I don’t want to make it worse. I am a writer and developer, but not a designer.

One company actually offered to redesign the blog for me, but I held back for fear that a sense of obligation would prevent me from writing objectively. That said, I have considered doing something like Adobe’s Serge Jespers and offering a prize for a redesign; if you would like to supply such a prize, in return for a little publicity, let me know. One of my goals is to make use of WordPress widgets to add more interactivity and a degree of future-proofing. I hope 2010 will be the year of a new-look ITWriitng.com.

So what are you reading? Looking at the stats for the year proves something I was already aware of: that the most-read posts are not news stories but how-to articles that solve common problems. The readers are not subscribers, but individuals searching for a solution to their problem. For the record, the top five in order:

Annoying Word 2007 problem- can’t select text – when Office breaks

Cannot open the Outlook window – what sort of error message is that? – when Office breaks again

Visual Studio 6 on Vista – VB 6 just won’t die

Why Outlook 2007 is slow- Microsoft’s official answer – when Office frustrates

Outlook 2007 is slow, RSS broken – when Office still frustrates

The most popular news posts on ITWriting.com:

London Stock Exchange migrating from .NET to Oracle/UNIX platform -  case study becomes PR disaster

Parallel Programming: five reasons for caution. Reflections from Intel’s Parallel Studio briefing – a contrarian view

Apple Snow Leopard and Exchange- the real story – hyped new feature disappoints

Software development trends in emerging markets – are they what you expect?

QCon London 2009 – the best developer conference in the UK

and a few others that I’d like to highlight:

The end of Sun’s bold open source experiment – Sun is taken over by Oracle, though the deal has been subject to long delays thanks to EU scrutiny

Is Silverlight the problem with ITV Player- Microsoft, you have a problem – prophetic insofar as ITV later switched to Adobe Flash; it’s not as good as BBC iPlayer but it is better than before

Google Chrome OS – astonishing – a real first reaction written during the press briefing; my views have not changed much though many commentators don’t get its significance for some reason

Farewell to Personal Computer World- 30 years of personal computing – worth reading the comments if you have any affection for this gone-but-not-forgotten publication

Is high-resolution audio (like SACD) audibly better than than CD – still a question that fascinates me

When the unthinkable happens: Microsoft/Danger loses customer data – as a company Microsoft is not entirely dysfunctional but for some parts there is no better word

Adobe’s chameleon Flash shows its enterprise colours – some interesting comments on this Flash for the Enterprise story

Silverlight 4 ticks all the boxes, questions remain – in 2010 we should get some idea of Silverlight’s significance, now that Microsoft has fixed the most pressing technical issues

and finally HAPPY NEW YEAR

More patent nonsense: Microsoft loses in Office custom XML appeal

Microsoft has lost its appeal in a case where a small company called i4i claims that Office 2003 and 2007 infringes its patent on embedding custom XML within a Word document. This is not the XML that defines the content and layout of the document. It is XML contained within the document that Word itself does not understand, because it conforms to a custom schema, and which will not be displayed unless you write code to parse it and output some sort of result to the document.

Microsoft now says:

With respect to Microsoft Word 2007 and Microsoft Office 2007, we have been preparing for this possibility since the District Court issued its injunction in August 2009 and have put the wheels in motion to remove this little-used feature from these products. Therefore, we expect to have copies of Microsoft Word 2007 and Office 2007, with this feature removed, available for U.S. sale and distribution by the injunction date.  In addition, the beta versions of Microsoft Word 2010 and Microsoft Office 2010, which are available now for downloading, do not contain the technology covered by the injunction.

The key phrase here is “little used feature”. It is true, in that the vast majority of Word documents do not use it; the only users who will be affected will be those who have built custom solutions which use it in some kind of workflow or for data analysis.

Why did Microsoft lose? Here I have to admit my lack of legal knowledge; though I’m aware that Microsoft’s track record in court is not good. One interesting aspect of the case reported here is that Microsoft was proven, by an email from January 22 2003, to have been aware of the patent and products from i4i:

we saw [i4i’s products] some time ago and met its creators. Word 11 will make it obsolete

says the internal email; Word 11 is another name for Word 2003.

That said, intuitively both the patent and the decision seem odd to me, in that XML is specifically designed to allow data with a custom schema to be embedded within a document defined by another schema. But does the i4i patent cover every XML document out there that does this – such as, for example, XHTML documents that include microformats? The answer, as I understand it, is no, because the patent is about how the custom XML is stored, not that it exists. Here’s a quote from the patent itself:

The present invention is based on the practice of separating encoding conventions from the content of a document. The invention does not use embedded metacoding to differentiate the content of the document, but rather the metacodes of the document are separated from the content and held in distinct storage in a structure called a metacode map, whereas document content is held in a mapped content area … delivering a complete document would entail delivering both the content and a metacode map which describes it.

In other words, the custom XML is not stored directly within the containing document, but in a separate file, together with an instruction that says “please insert me at location x”.

Is that really any different? Intuitively, I doubt it. What we think of as single files are often in reality a number of sections bundled together, such as a header part and a content part. Further, what we think of as a single file may be stored in several locations, with metadata that defines how to get from one part to the next.

An Office 2007 document such as .docx is in reality a ZIP archive which contains several separate files, organised according to the Open Packaging Convention; if the i4i patent has wider implications, it strikes me that they would be for the OPC rather than for XML itself.

I don’t claim any expertise in whether or not i4i has a valid claim against Microsoft or others. I do have an opinion though, which is that this kind of patent litigation does not benefit either the industry or the general public. This particular case concerns me, because the patent strikes me as generic, and one that could be applied elsewhere, which means more effort expended to workaround legal issues rather than in improving the software we use; and because even if the feature in Word is “little used”, the concept is an important one that still has great potential – though now probably not in Microsoft Office.

Technorati Tags: ,,,

Moonlight 2 released; no Microsoft codecs unless you get it from Novell

The Mono Project has released Moonlight 2, its implementation of Silverlight for Linux. I tried my own database application and was pleased to find that it works fine; better than it did with the earlier release.

Note the right-click menu which offers some handy debugging features as well as the invitation to “Install Microsoft Media Pack”. If you choose this, you get a dialog offering the Microsoft codecs which are downloaded from Microsoft, not from Mono servers. You have to agree a EULA that restricts use to Moonlight running in a web browser.

That last bit is intriguing; it seems Microsoft is trying to prevent desktop or out-of-browser Moonlight (or Mono) from taking advantage of its codecs.

So what is in Moonlight 2? Miguel de Icaza explains:

Moonlight 2 is a superset of Silverlight 2. It contains everything that is part of Silverlight 2 but already ships with various features from Silverlight 3.

Those additional features include the pluggable pipeline, easing animation support, writeable bitmaps, and partial out-of-browser support. Further, de Icaza says:

We are moving quickly to complete our 3 support. Microsoft is not only providing us with test suites for Moonlight but also assisting us in making sure that flagship Silverlight applications work with Moonlight.

There is also a new patent covenant that:

ensures that other third party distributions can distribute Moonlight without their users fearing of getting sued over patent infringement by Microsoft

That said, the media pack is a source of friction. Only the Novell Moonlight distribution will raise the above dialog to install the Microsoft codecs; others will have to make their own arrangements; at least that is how I understand de Icaza’s post.

It seems an odd restriction, and means that most users should download from Novell.

COM automation in Silverlight 4 is not an “edge case”

I wrote a piece for The Register about the arrival of Windows-specific features in Silverlight, which attracted some comments both on the Reg and also on Slashdot. Plenty of people said it was just what they expected from Microsoft, some of them misunderstanding the point that this only applies to out-of-browser applications that are trusted: the user has to pass a dialog box granting the application permission to access the local system. A few defended Microsoft’s decision; and this Slashdot comment on COM automation in Silverlight 4 strikes me as a good encapsulation of the official line:

This is a fairly obscure feature, and I’m fairly surprised that it was included at all, but doubt it’ll be of use to the vast majority of current and future Silverlight developers out there. Like the html control, it’s a crutch, to allow developers that want to use Silverlight a way to leverage existing investments. The mantra I’ve heard out of the Silverlight team is to focus on unblocking customer scenarios (scenarios they cannot unblock themselves) without compromising the overall feature goals (like keeping the runtime download small) … it’s an edge case feature that doesn’t affect Silverlight’s over all "Cross-Platforminess".

The idea that COM automation is merely an “edge case” surprises me, even though I also recall it being described like that at PDC. Access to COM automation gives a Silverlight desktop application on Windows substantial extra capability. At PDC program manager Joe Stegman showed how Silverlight 4 can integrate with Office, sending data into an Excel spreadsheet: an example with obvious value for real applications. I also heard developers at PDC discussing how they might wrap up a Silverlight application with a COM DLL, creating an application which in effect has full access to the local operating system. Although Silverlight cannot access the Windows API directly, there are no such restrictions on the COM DLL, so the combination means that pretty much anything is possible.

Let’s also bear in mind that Microsoft’s Brad Becker is on record saying that one day WPF and Silverlight might simply become different .NET profiles. He told me this at Mix earlier this year; and said a similar thing to Mary Jo Foley at PDC:

Some day — Microsoft won’t say exactly when — Silverlight and WPF are going to merge into one Web programming and app delivery model that, most likely, will be known as Silverlight, Brad Becker, Director of Product Management for Microsoft’s Rich Client Platforms, told me this week

If Microsoft is contemplating such a thing, then clearly full access to the native features of Windows will have to be possible.

I am not entirely negative about this prospect. Even if you are only targeting Windows, Silverlight has a lot to commend it: a small runtime, easy setup, and options for browser-hosted or desktop deployment. If you have ever wrestled with the Windows installer or tackled a failed .NET runtime installation you will like the simplicity of running a Silverlight application.

Nevertheless, with version 4.0 Microsoft is changing its Silverlight story. It is no longer a pure cross-platform play; rather, it is a runtime where some features are cross-platform, and others Windows only. Microsoft calls this developer choice; I see it as evolving into the inverse of Sun’s aim with Java. Sun tried strenuously to guide developers towards cross-platform, but provided a way out – via Java Native Interface – if absolutely necessary. Microsoft will provide cross-platform where we really need it, but make it easy to slip into Windows-only development in order to get some nice feature like a location API, or Office integration.

I see this as an advantage for Flash, because developers know that Adobe has no incentive to prefer one operating system over another – except to the extent that minority platforms (like desktop Linux) tend to receive less investment.

Personally I think Microsoft should at least provide a way for Mac users to get similar benefits – perhaps by implementing something like the native process API in Adobe AIR 2.

I also think Microsoft will have to get real about Linux support. It is wrong that Microsoft will cheerfully state:

Silverlight 4 runs across all platforms and major browsers

as it does in the “Fact sheet” handed out at PDC; while leaving Linux implementation to a third-party process uncertain in both features and timing. Here is the reality of cross-platform Silverlight, in a screenshot taken seconds ago from Linux:

Right now it is a two-platform play – admittedly, the two platforms that matter most, especially in a Western world business context, but never forget that Google Chrome OS is coming.

PDC day two: Silverlight 4 and a free laptop

There were two big themes at PDC in Los Angeles today. One was the Silverlight 4 beta, the subject of the most impressive section at the keynote. The other was the announcement of free laptops for every attendee – aside from press and government. It is remarkable how a generous gift can change the atmosphere. The lack of breakfast or Universal Studios party was soon forgotten as the audience cheered its own good fortune.

There is actually some justification for handing out this hardware. It’s a decent machine, a modified Acer Aspire 1420P with Windows 7 x64, 2GB RAM, multi-touch display, and accelerometer. Most of us do not have multi-touch machines, and giving them to the core Windows developers who attend PDC may help stimulate the creation of applications that properly support this feature.

Otherwise, it was a Silverlight day. Although SharePoint 2010 was also in the keynote, the cheers it received felt more like relief, that it finally has sensible development and debugging tools in Visual Studio, than real enthusiasm. Somehow the keynote did not capture the potential of the product.

Silverlight though was well received. It is a huge release that opens up many new possibilities, though I am discovering some details that look awkward. There is also one troubling aspect, which is that Microsoft is introducing imbalance in its cross-platform story. The Windows version of Silverlight 4.0 supports COM automation, enabling integration with local APIs such as location on Windows 7, and Microsoft Office. There is no equivalent in the Mac release. It would not be so bad if Microsoft offered some route to similar functionality on the Mac, but there is none that I am aware of.

Microsoft folk that I spoke to about this dismissed it as a minor point, but it is not. Cross-platform is a discipline; this is a failure to observe that discipline and hands an advantage to Adobe Flash for developers that require broad reach.

PDC day one: Windows in the cloud

Today was cloud day at PDC. Microsoft announced that Windows Azure will become a production platform on January 1st, with billing starting from February 1st. It also announced the beta of Windows Server AppFabric role, for on-premise apps that can either stay on-premise or be deployed to Azure later; and some new developments like the Windows Server Virtual Machine role on Azure, a pre-configured Windows Server VM into which you will be able to deploy an application.

Azure was first announced at the 2008 PDC, and had a stuttering start, with a CTP (Community Tech Preview) that was difficult to use, major changes to SQL Server Data Services – a simplified cloud database that was scrapped and replaced with full SQL Server – and generally poor marketing from Microsoft. I was not sure whether the company was serious about Azure, or merely trying to tick the cloud box.

I do now think it is serious, and delivering some interesting technology for easily scalable cloud-hosted applications. Microsoft does not sees its cloud services as replacing your in-house servers (no surprise there), but more as a way of deploying certain kinds of web applications. A great feature is that thanks to Active Directory Federation Services in combination with the new .NET library called Windows Identity Foundation you can relatively easily have use your Azure applications authenticated against your internal Active Directory.

The surprise of the day was when Matt Mullenweg of WordPress fame turned up to demo WordPress running on Azure, which now supports PHP and MySQL as well as Java applications. Another unexpected guest was Loic Le Meur of Seesmic, who introduced Seesmic for Windows and also talked about a coming Silverlight version.

That said, the keynote did not exactly crackle with excitement. Microsoft seemed almost to downplay what is now possible with Azure, perhaps sensing that it could be disruptive to its own business model. A telling moment came during a press briefing when Doug Hauger, Azure General Manager, denied that Windows or Office were in any sort of decline. Despite his position he seems to be under the illusion that we will happily continue with our fragile on-premise, single platform, micro-managed IT systems.

I enjoyed the day though. The beauty of PDC is that Microsoft rolls out its best speakers; it was great to hear Mark Russinovich explain the kernel changes in Windows 7 and Server 2008 R2 – same kernel of course – and I will be writing more about the session shortly.

I’m expecting more focus on Office, Silverlight and Visual Studio tomorrow, when Steven Sinofsky, Scott Guthrie and Kurt DelBene will be giving the keynote, and hoping for some compelling announcements.