From Experience, Silverlight Versus HTML

 

I built a personal UI framework for SharePoint 2010 using Silverlight 4 called Xaptic (its still possible I’ll upgrade to SL5) for assisting me with UI/UX prototyping and some personal learning. Of course, I also harbor an ongoing interest in raising its level of usefulness, architectural robustness, and overall stability. I would certainly not move forward supporting multiple versions of Xaptic – I could not raise its level of usefulness, architectural robustness, or overall stability knowing that any technology I wrongly adopted now appeared short lived, or slowly withering away. Of course, this is the essential issue set before us. If Microsoft, in a sudden burst of disclosure, spilled their strategy beans I doubt it would change my thinking at this point.

“…ay, there’s the rub, For in that sleep of death what dreams may come” – William Shakespeare, Hamlet

I wanted to understand how I should proceed with Xaptic so I built two versions with nearly identical form and features and learned a few things along the way.

  • I agree with those who say Silverlight is technologically 10 years ahead of anything available in the current HTML5/JS realm for these reasons
    1. For Xaptic, runtime performance (minimal jerky motion, unexpected pauses) was excellent. HTML5/JS feels more dependent on external influences.
    2. Cross browser consistency was damn good in Silverlight – for HTML5/JS I had lots of trouble making things work across different browsers without carpeting layers of JavaScript API’s. The exception here is mobile browsers which largely do not support SL (except WP7)
    3. Frankly, Silverlight coding patterns feel more traditional (yet updated), time honored, and adaptable to the newer paradigms that XAML offers. HTML5/JS feels like a box of chocolates by comparison.
  • The asynchronous patterns in Silverlight are as much trouble as anything JavaScript throws at me. So that was a draw
  • Debugging in both technologies is not a great experience in many ways. Another draw.
  • Interestingly, load time for the initial page was better in HTML5/JavaScript. HTML5/JS wins
  • In “Xaptic for Silverlight” I called REST Services that I created myself reading from a SQL Database. In “Xaptic for HTML5/JS” I used SharePoints client object model to R/W from lists. My overall coding effort was the same for both technologies. A draw.
  • For HTML5/JS, really good libraries are often free to use (MIT license) but SO MANY exist. With Silverlight, good third party components cost money but you know what you’re getting. I give this one to HTML5/JS
  • Silverlight – hands down – has much better and consistent tooling support as would be expected coming from proprietary origins. I felt that pain as I built “Xaptic for HTML5/JS”. Silverlight wins easily here. HTML5/JS is a hodgepodge of anything anyone feels like building.
  • Of course, Silverlight does a few things VERY WELL while HTML5/JS does most things reasonably well.        

MyGrid

In terms of building a true LOB applications for the enterprise (using SharePoint 2010) I want to point out how the two major development approaches (I describe below) offered by SharePoint 2010 influenced my final recommendations and its relationship to my decision around the Xaptic project.  

A very nice feature of SharePoint 2010 is the ability to construct web parts from HTML/.net, Silverlight/.net, or HTML/.js (assuming the appropriate API and services are provided). A big difference between building/using individual web parts in SharePoint versus a full blown LOB application that uses SharePoint as a “platform host” stems from “atomic” nature and variety of web parts that SharePoint offers. With a strong understanding of business requirements and of the SharePoint platform itself a business user could develop what traditionally took programmers months to accomplish. Let’s call this the “power user” style of development for now.

Conversely, hosting a vertical LOB application within SharePoint tends to focus and refine the technology stack very early on, as well as any middle tier logic required. Only a peripheral use of web parts could/would be needed to finish off any of the low hanging fruit. A highly integrated and fluid UI for some LOB application hosted in SharePoint could rapidly move away from the standard web part model now offered by SharePoint 2010. In fact, the efficacy of hosting an LOB application within SharePoint would be a legitimate question in many of these cases. Let’s call this the “integrated” style of development for now.

Silverlight is a prime candidate for the “integrated” approach because it not just a web part technology. It has all the components needed for application development – navigation, dynamic loading of modules (MEF), styles, layouts, threading, VS templates for business, etc. It’s a full stack.  

Oh, wait just a minute. I seem to recall that HTML5/JS also has navigation, dynamic loading of modules (XML/JSON), styles, layouts, threading (Web Workers), and now with VS2011 has templates as well. In fact, that’s the technology SharePoint is built with (in HTML’s previous generation)…

Back to development for a moment, the “power user developer” is much less reliant on any one technology or component killing his/her entire effort. You can leverage web parts built using Silverlight, pure HTML, asp.net, and JS. If one of those technologies fall out of corporate favor (or fails unexpectedly) you simply pull it out of rotation and fix it, or buy a third party web part that still gives you that “Pie Chart” the boss needs. Pie charts in JavaScript, Silverlight, or Excel look the same. Yes, I realize this is highly over simplified but you get my point.

Here are my recommendations based on my recent experience.

  • Build LOB/Enterprise applications with HTML5/JS even if you need some specialized feature that Silverlight happens to offer. The reason is simple, you can make Silverlight a small widget of “special functionality” within a larger HTML5/JS application. You get the best of both worlds. For Xaptic, I decided to use HTML5/JS as the platform but create/utilize Silverlight widgets for any intense graphical stuff – could be fun.
  • If you’re building a small department application with less technical savvy then utilize platforms like LightSwitch or even MS-Access (remember, an MS Access database can now be uploaded to SharePoint as a fully functional application site – not my first choice but possible)
  • HTML5 is evolving fast, mothball projects that are fully based on Silverlight but retain Silverlight for specialty needs within the same project.        

http://www.microsoft.com/visualstudio/en-us/lightswitch

 

Cheers!

Advertisements

Code Standards, Practices, and Utilities for SharePoint

 

Two years ago I added a blog post on “MOSS Solution and Code Naming Conventions”. This subject comes up from time to time and, as a “quick reference”, I am posting some refinements and updates. The original is here: https://scottcurrier.wordpress.com/2009/03/01/moss-solution-and-code-naming-conventions/

Updated Links Next,

Life Cycle and Methods

Application Lifecycle Management (General): http://msdn.microsoft.com/en-us/library/gg604045.aspx

Application Lifecycle Management (Visual Studio): http://msdn.microsoft.com/en-us/vstudio/ff625779

Developing Applications for SharePoint 2010: http://msdn.microsoft.com/en-us/library/ff770300.aspx

Sandboxed Solution Considerations: http://msdn.microsoft.com/en-us/library/ee231562.aspx

Code Acceptance: http://technet.microsoft.com/en-us/library/cc707802(office.12).aspx

SharePoint Development Center: http://msdn.microsoft.com/en-us/sharepoint/default.aspx

Office 365

Office 365 Developers Guide: http://msdn.microsoft.com/en-us/library/hh147180.aspx

Utilities and Tools

SP Dispose Check (memory leaks): http://archive.msdn.microsoft.com/SPDisposeCheck

MSOCAF: https://caf.sharepoint.microsoftonline.com/Default.aspx

StyleCop (style and consistency rules): http://stylecop.codeplex.com/releases/view/64494

FxCop: See http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8279 

For FxCop, as of this writing you will need to manually extract out of the SDK .ISO file if you don’t want the full SDK installed. see http://www.alexatnet.com/content/how-install-fxcop-10-0 

Team Foundation Server: http://msdn.microsoft.com/en-us/vstudio/ff637362

Roger Lamb’s Blog: http://blogs.msdn.com/b/rogerla/

ULS Viewer: http://archive.msdn.microsoft.com/ULSViewer <== added 5/16/2012

SPDiag 3.0: http://technet.microsoft.com/en-us/library/hh144782.aspx

Performance

Performance Counters: http://technet.microsoft.com/en-us/library/ff758658.aspx  <== added  1/18/2012

Quicker Downloads: http://technet.microsoft.com/en-us/library/hh206324.aspx

Web Performance Testing: Visual Studio Ultimate 2010 + SP1, see http://msdn.microsoft.com/en-us/library/aa337591.aspx

Web Testing Videos: http://www.bing.com/videos/search?q=Visual+Studio+2010+Load+Test+Wizard&mid=4320C2158B7365AF11B94320C2158B7365AF11B9&view=detail&FORM=VIRE3

lodctr.exe http://technet.microsoft.com/en-us/library/bb490926.aspx <== added 5/16/2012 (even helped fix User Code Host Service issues with SharePoint, using lodctr /r)

Web Performance Test TIP: if you are running on a local computer testing a remote machine on a different domain then run this command to be sure your remote performance counters map to the correct credentials

runas /netonly /user:domain\user "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" 

General Testing: http://msdn.microsoft.com/en-us/library/bb385901.aspx

Results and Recommendations: http://www.microsoft.com/download/en/details.aspx?displayLang=en&id=12768

Configure Usage Reporting: http://technet.microsoft.com/en-us/library/cc262541(office.12).aspx

Diagnostic Logging: http://technet.microsoft.com/en-us/library/ee748606.aspx

Conventions

http://msdn.microsoft.com/en-us/library/aa291596(VS.71).aspx

http://10rem.net/articles/net-naming-conventions-and-programming-standards—best-practices

http://weblogs.asp.net/lhunt/pages/CSharp-Coding-Standards-document.aspx

Summary

Use your judgment ! You can’t do it all….be thoughtful, not draconian

Cheers!

PS: on a different topic – check out XAPTIC and SPDragon, my Silverlight and HTML5 widget library for SharePoint 2010 http://www.youtube.com/user/scottcurrier

On Building a Custom Service Application for SharePoint 2010

 

Added Part 9

I’ve begun a series of posts on building a custom Service Application for SharePoint 2010. For the most part I believe I have the process understood pretty well but I’m hoping if you see errors along the way you will feel free to point them out. As such, they should be considered a work in progress. I want these to ultimately be very comprehensive and reasonably detailed so I can use them as a reference myself.

For this series of posts I’m using the EMC public blogs. You can find the first two posts at the links below

Part 1: http://consultingblogs.emc.com/scottcurrier/archive/2011/08/16/on-building-a-custom-service-application-for-sharepoint-2010-part-1-background-and-decisions.aspx

Part 2: http://consultingblogs.emc.com/scottcurrier/archive/2011/09/12/on-building-a-custom-service-application-for-sharepoint-2010-part-2-service-application-hierarchy-and-sample.aspx

Part 3: http://consultingblogs.emc.com/scottcurrier/archive/2011/09/17/on-building-a-custom-service-application-for-sharepoint-2010-part-3-some-refactoring-and-administrative-tooling.aspx

Part 4: http://consultingblogs.emc.com/scottcurrier/archive/2012/01/01/on-building-a-custom-service-application-for-sharepoint-2010-part-4-adding-administrative-code.aspx

Part 5: http://consultingblogs.emc.com/scottcurrier/archive/2012/01/01/on-building-a-custom-service-application-for-sharepoint-2010-part-5-adding-administrative-code.aspx

Part 6: http://consultingblogs.emc.com/scottcurrier/archive/2012/01/02/on-building-a-custom-service-application-for-sharepoint-2010-part-6-adding-business-logic-and-client.aspx

Part 7: http://consultingblogs.emc.com/scottcurrier/archive/2012/01/02/on-building-a-custom-service-application-for-sharepoint-2010-part-7-better-engineering-with-proxy-classes.aspx

Part 8: http://consultingblogs.emc.com/scottcurrier/archive/2012/01/04/on-building-a-custom-service-application-for-sharepoint-2010-part-8-client-access-via-proxy-classes.aspx

Part 9: http://consultingblogs.emc.com/scottcurrier/archive/2012/01/06/on-building-a-custom-service-application-for-sharepoint-2010-part-9-provisioning-a-service-application-database.aspx

Cheers!

Scott

PS: check out my Silverlight project called XAPTIC, it’s a widget and tile library for SP 2010 and Office 365 at http://www.youtube.com/user/scottcurrier

A Silverlight Web Part Framework for SharePoint 2010

 

This is part 5 of my updates regarding XAPTIC, my Silverlight Web Part Framework for SharePoint 2010. This weekend I focused on just a couple of needed updates.

  • Added property editors for plain and rich text
  • Added a rich text web part
  • Updated the the XAPTIC API to include property type values that are added when creating custom properties

Next week I focus on fleshing out the rich text editor more as well as start adding in some basic communication between web parts (even communication between XAPTIC HTML and Silverlight web parts).

Finally, I hope to have some time for a full blown JQuery/SPServices demo as well…we shall see Smile

Here is the video update of my latest efforts.

Thanks for watching!

Scott

XAPTIC: Connectivity and Fluid Elements

 

This is my fourth installment and update for XAPTIC, my weekend project to construct a robust Silverlight web part style framework for SharePoint 2010. This weekend was about bug fixing and presentation. Here is what I completed this weekend.

  1. Updated the Icons a bit – I’m not a UI guy and its difficult to make things look good
  2. Added some fluid interface elements (fader effects, etc.) – this piece is still a work in progress
  3. Added the client object model to one of my sample web parts (line chart)
  4. Added a CSS field to the HTML web part (soon JavaScript so I can dig into JQuery/SPServices more)
  5. Updated all the Silverlight parts for better appearance and presentation
  6. Added an Upload and Delete to/from the parts catalog (drag/drop coming soon)

I have so much technical information coming out of this project that I can hardly wait to blog some about it. For now I’ll post these updates as a sign of my progress.

One thing I did not say in the video update was that I actually created a VS 2010 project template. Now all you need to do is simply compile the default project and a fully operational “Hello World” style Silverlight Part is ready to use. See image below the video. I’ll blog that very soon

 

 

Here is the Xaptic Project Template

 

image  

 

Thanks for watching!

Scott