I just read a lovely article on RIA FLEX about how you could walk on water in Adobe Flex and how you would be stuck coding zillions of lines of code in Silverlight.
The post had some quantitative data to support its claim, that data as follows:
Some value object class:
- Adobe Flex: 19 lines
- Silverlight: 164 lines
Some Data Entry Screen (without datagrid)
- Adobe Flex: 61 lines of MXML + 25 lines of Actionscript
- Microsoft Silverlight: 108 lines of XAML + 53 lines of C#
Some Data Entry Screen (with datagrid)
- Adobe Flex: 170 lines of MXML + 198 lines of Actionscript
- Microsoft Silverlight: 261 lines of XAML + 315 lines of C#
The author’s conclusion: it takes 1.5 to 2 times more lines (and in reality therefore hours) to develop an application using Microsoft Silverlight.
Here are my results:
Some value object class (I’m assuming the author means business entities):
- Adobe Flex: ?
- Silverlight: 68 lines
Some Data entry screen (without datagrid)
- Adobe Flex: ?
- Microsoft Silverlight: 22 lines of XAML + 1 lines of C#
Some Data entry screen (with datagrid)
- Adobe Flex: ?
- Microsoft Silverlight: 5 lines of XAML + 1 line of C#.
Full disclosure: the Data entry screens that I built were for a customer entity with the following definition:
string FirstName –> TextBox
string LastName –> TextBox
bool IsActive –> Checkbox
string CustomerType –> Drop Down List
With a couple more lines of markup + code I could easily do the following things:
1) allow read-only and writable views of the data entry screen
2) add validation of fields on the data entry screen
With the architecture I am using I can quite easily scale my entity object model and not incur a ton of extra code. For every additional field or List of children its an extra 3 lines of code and one line of XAML.
So as you can see, based on the requirements given, I have built the same thing with drastically different results. You will notice that most of my work was setting up the business entities. This will enable the proper mapping to XAML which is why I was able to do two-way binding and reap such huge reductions in markup and code in the actual Views.
If the author could provide the same details about the complexity he used we could get a better comparison between implementation size. However, I do disagree wholeheartedly with the authors assertion that lines of code translates directly to cost and hours. In fact this argument is slanted against Microsoft Silverlight due to one of its own platform advantages: in Microsoft Silverlight every visual element that exists in the visual tree can be traced back to a corresponding element in XAML. Adobe Flash/Flex have black box Flash storyboards and graphics that you do not get the same level of internal access to manipulate at runtime. But back to the argument of lines of code = cost and hours. This is just silly. Half the XAML that is in my projects is generated in Expression Blend and stored off in a Resource Dictionary somewhere. In fact, developers don’t even have to write XAML if they don’t want to. There are some developers that were script kiddies in a previous life and they live and breath markup, while there’s people like me who found benefits from using Blend for certain things and hand coding XAML for others.
I would like to learn more about the differences between implementation on Adobe Flash/Flex and Microsoft Silverlight. Hopefully we can do this in open and honest ways rather than posting statistics that aren’t qualified in anyway.