Silverlight 3 will include major media enhancements (including H.264 video support), major graphics improvements (including 3D support and GPU hardware acceleration), as well as major application development improvements (including richer data-binding support and additional controls). For more info, check out here.
A nice article explaining the difference between MVC and MVP patterns. Read more at here and here.
The information below was extracted from the write-up by Francis K. Cheung.
What are modular, composible applications?
Imagine that you want to need to build an application that, due to its size and complexity, needs to be split up and developed by several teams. Let's say you have several teams developing modules that can be assembled at run time. There will also be a team in charge of the shared infrastructure. You also need a way for the UI elements from each module to be brought together into a reasonable composite. You also want the modules to be loosely coupled from eachother (no static references). You also want a way for these modules to communicate with eachother. Since there are no static references, you can't take advantage of standard .NET eventing. You also want to expose services and share them across modules.
This scenario was first addressed by the Composite UI Application Block (CAB) and the Smart Client Software Factory. This scenario was then addressed for Windows Mobile 5: Mobile Client Software Factory. For the composible applications in the web space, the Web Client Software Factory was developed.
The demand for CAB functionality interoperable with WPF's look and feel prompted the community project WPF CAB.
The Composite Application Guidance for WPF can help you split the development of your WPF client application across multiple development teams, each responsible for the development of a piece of the application, and help you seamlessly compose those pieces together into a client application.
I have done some search on choosing between SCSF (Smart Client Software Factory) and Composite WPF. If using SCSF, you are still able to host WPF SmartParts and develop WPF controls. If you are an existing CAB/SCSF developers, download the reference document at here. The following information was pasted from here:
#1: What should I use when starting a new project?
My personal conclusion: For me that question is obvious: use Composite WPF guidance and WPF if your client-hardware is sufficient for WPF.
WPF adds a lot value that make things for development of enterprise line-of-business client apps much easier - although the design time experience isn't where it should be, today. And Composite WPF brings you the framework for building extensible and manageable enterprise-level smart clients with WPF! So just use it!
#2: Should you migrate to Composite WPF from CAB/SCSF?
Of course many customers are asking this question right now. They are afraid that they are using an old technology which is not going to be state-of-the-art anymore and running into panic-mode.
Well, I don't see it that critical. CAB/SCSF is still driven forward by the community (see SCSFContrib, SCSFWPF etc.) and there are lots of people out there answering questions, sharing experience etc. Furthermore according to the Microsoft homepage it is still supported the same way it was supported all the time: it is simply treated as custom code in support cases with Microsoft.
My personal conclusion therefore: if you do not get additional business value out of Composite WPF and if you are happy with CAB/SCSF in your solution, why should you take the effort of migrating to it!? Then you don't need to... some good reasons to migrate might be:
- native WPF implementation that leverages the base classes of WPF such as its existing command mechanisms etc.
- more lightweight - Composite WPF is more lightweight than CAB/SCSF and I had the feeling that it is easier to learn...
- extended flexibility of Composite WPF: you have the choice which features you want to use and which you don't want to. Composite WPF features are independent from others - e.g. you could use the MVP/MVC implementation without being bound to any "Controller" or "WorkItem" base classes or to the dependency injection mechanisms.
- the new Unity framework as an easier-to-use, more lightweight dependency injection framework
- the ability of Composite WPF to use another dependency injection framework such as spring etc.
But these are just some thoughts that went through my head. And again - for me important is that if you don't get any value for YOU out of these advantages then why migrate!? There is no reason for doing so. If you get additional value, then let's go;)
#3: How do components from CAB/SCSF map to Composite WPF?
As far as I have seen, the Composite WPF framework achieves exactly the same goals as CAB on it's own. There is no replacement for SCSF available, so far, and according to Microsoft none is planned for the foreseeable future. The team is in a kind-of gathering customer feedback loop right now;) Okay, but let's map some features from CAB/SCSF to Composite WPF - I assume that you read my paper on CAB/SCSF to fully understand the following table...
| Shell Workspaces |
Region Managers |
| Shell UI Extension Sites |
none |
| WorkItem class |
none or your own ordinary class It's on you whether you want to use "use case controllers" as described in my paper or not. And if, you just create ordinary classes without any attributes or base-class dependencies;) |
WorkItem - Use Case Controller-part |
none |
WorkItem - Container-part |
Unity Framework and it's container capabilities |
WorkItem - Client Services management |
Unity Framework and it's container capabilities |
| Event Broker |
Event Aggregator |
| Command Pattern |
WPF Commands and/or Composite WPF extensions to WPF commands |
| Dependency Injection |
Unity Framework or your own |
| Smart Parts |
WPF controls as views |
| Presenter class |
none or your own ordinary class It's up to you whether you use MVP/MVC - and if you just implement ordinary classes without any attributes or base class dependencies. |
| ModuleController, ModuleInit |
IModule classes |
| ProfileCatalog, ModuleEnumerator/Services |
ModuleEnumerator |
As you can see, Composite WPF supports all scenarios but leaves you more "freedom" of whether you want to implement a scenario or not. And also if you implement a scenario you often don't need to inherit from any base class or apply attributes in most cases. That means you can build-up your own hierarchies without running into too many dependencies of the Composite WPF guidance.
#4: The very basic steps to get from CAB/SCSF to Prism
These are some of the first steps I had to complete while migrating the shell and modules from CAB/SCSF to prism. Essentially these where the following:
- Create a new solution for the Composite WPF version of my demo.
- Import the interface libraries from the CAB/SCSF solution to the Composite WPF solution and remove all namespace-, attribute- and base-class references to CAB/SCSF-related classes.
- Re-create the shell as described in the guidance: I have to admit I didn't even try to migrate the shell because many of the concepts are different. But I left my IShellExtensionService interface concept and therefore I was able to hide this pretty heavy change from the modules I migrated later on.
- Add a new class library with some of my own base classes:
(1) A Controller base class with a state-bag to replace WorkItems. This is a simple as possible and I just used it because I used the WorkItem.State property. (2) A presenter base class with a reference to the original work item.
- Add the first CAB/SCSF module to my new solution.
- Replace the "ModuleInit" class by a IModule implementation. I even left the ModuleController-concept for simplicity.
- Remove the WorkItemController base class reference in my ModuleController class and replace it by the Controller-base class I created in step 4.1 above.
- Replace CAB-Commands [CommandHandler] by DelegateCommands as used in WPF and WPF composite guidance.
- Replace all WorkItem.Service usages against a Unity Container Service usage.
- UI Extension Site usage must be replaced by my IShellExtensionService concepts as described in my paper as they are not available anymore. Or you create your own IShellService that supports extension of menus etc. in your shell.
- Uncomment CAB/SCSF generated code in the code-besides of the smart parts.
- Remove all attributes in Presenter classes and SmartParts which are specific to CAB/SCSF.
- Replace all WorkItem classes with your own, custom Controller classes that inherit from the Controller-base class I've created in step 4.
- Update the configuration and run the application
BizSpark is an innovative new program that unites Startups with entrepreneurial and technology resources in a global community with a common goal of supporting and accelerating the success of a new generation of high-potential Startups.
Here’s some requirements to enroll in BizSpark:
- You get development-only licensing for everything from VS Team Studio to Excel for everyone developing in your startup for up to 3 years.
- You get development and production licenses for up to 3 years for Windows Server, SQL Server, SharePoint and the other Microsoft servers you might want to use to power your web app.
- You get an MSDN subscription that lets you into the moderated tech support groups and 2 tech support incidents a year.
- You pay zip until you quit the program, or hit $1 million a year revenue, or the 3 years is up. Then you pay a disconnect fee of $100.
- Your company has to be privately held, younger than 3 years, and be making less than $1 million year revenue when you enter the program.
- You get BizSpark from a BizSpark Network Partner (various VCs, angel networks, user/startup groups and others) or from certain Microsoft employees.
- BizSpark is global: some adjustments in price conditions in some countries.
For more information on how to join the programme, look into 47Hats.com.
Building on the vision of software + services, Microsoft Code Name “Acropolis” makes it easier to build and manage modular, business-focused, client applications for Microsoft Windows on the .NET Framework. It builds on the rich capabilities of Windows and the .NET Framework, including Windows Presentation Foundation (WPF), by providing tools and pre-built components that help developers quickly assemble an application from loosely-coupled parts and services. Code Name “Acropolis” reduces the complexities of building occasionally connected client applications and provides the ability to assemble and reconfigure systems without having to write a lot of code. Code Name "Acropolis" is part of the .NET Client Futures release, Microsoft’s preview of upcoming technologies in Windows client development.
For more information about Code Name "Acropolis" and the .NET Client Futures, see Windowsclient.net.
References:
After installation of Silverlight 2 RC, I found out that some of my Silverlight 1.0 applications are not working properly. A few searches show that there are few known issues:
Exceptions Reported instead of silent failures on Image URLs.
In Silverlight 1, if your application had a state where you were loading an image from an invalid URL it would fail silently, and no exception would be raised. Silverlight 2 raises an exception in this case, so if you wrote your code without an exception handler for this scenario, your end users would see a Silverlight error dialog if they are using Silverlight 2. Other than that, your application would behave in the same way (i.e. it would be unable to load the image from the invalid URL)
Action: Ensure that you are using exception handling before reading an image from a URL.
Change of behavior when Double Encoding Image URLs
Silverlight 1 was unable to handle some characters in Image URLs, and as such double encoding was necessary. This has been fixed in Silverlight 2, so if you have hard coded double-encoded URLs in your application, you may have some invalid URL errors thrown (see above)
Action: Remove any double-encoded hard coded URLs, and replace with normal URLs. Ensure that you are using exception handling before reading an image from a URL.
Change of behavior when reading XAML with relative path specifiers
This only applies when you specify the XAML on the Silverlight plug-in object. If you specified the XAML location using relative path specifiers (i.e. http://mydomain.com/app/../location.xaml), Silverlight 1.0 would resolve the URL. Silverlight 2 does not, and the full URL needs to be specified.
Action: Ensure that you are not using relative path specifiers on your XAML. Ensure that you are using exception handling on the plugin.
Exceptions Reported instead of silent failures on invalid XAML
When using createFromXAML to load XAML into your render tree at runtime, Silverlight 1.0 was forgiving of invalid XAML where you had a property at the root element of the XAML string that you are parsing. Silverlight 2 will throw and exception in this case.
Additionally XAML properties that were invalid would fail silently in Silverlight 1. If you had, for example, the following XAML: <TextBlock><Canvas.RenderTransform>…</Canvas.RenderTransform></TextBlock>
Silverlight 1.0 would be forgiving of this error, but Silverlight 2 will throw an exception.
Action: Ensure that you are using exception handling. If your XAML throws any exceptions due to these invalid properties you will need to fix your XAML.
Null reported instead of success on searching some XAML
When using findName() to find a XAML element, in Silverlight 1.0, in the case of a Storyboard, if you searched for a transform (example <Canvas.RenderTransform><ScaleTransform.ScaleX>), you would receive a positive result. However, this is inconsistent, and in Silverlight 2, you will receive ‘null’ as results of this search.
Action: Make sure your object is named and search for it by name instead of property path.
Exception on specific Text Wrapping property instead of silent failure
When using a TextBlock, Silverlight 1.0 mapped the ‘WrapWithOverflow’ setting to ‘Wrap’ on the TextWrapping property when it hit it, and as such this invalid property did not cause an exception. Silverlight 2 does not have this behavior, so the XAML will not parse and an exception will be thrown.
Action: Replace instances of the ‘WrapWithOverFlow’ setting with ‘Wrap’.
Line breaking differences on TextBlock
In some cases, a TextBlock would wrap text if not enough horizontal space was provided, despite the fact that it was not instructed to do so through property settings. This has been fixed in Silverlight 2, and as such you may see some places where your text is not wrapping where it did previously.
Action: If your TextBlocks look different with Silverlight 2 than they did with 1.0 this is the cause. You’ll need to edit your XAML to get the desired results.
Different handling of markers in an ASX file
In Silverlight 1, only markers that were within the duration specified in an ASX would be visible. In Silverlight 2, all markers are visible, so if you have an application that uses markers, and in particular pre-reads these markers, you may see some slightly different behavior.
Action: If you are pre-reading markers, and are receiving markers that are outside of your expected time range, you will need to truncate them manually.
For more information, refer to "Ensuring that your JavaScript Silverlight applications work with Silverlight 2".
When people talk about WPF with Smart Client, it could simply means of building a WPF applications that leverage on Smart Client approach. In previous posts, I discussed about WPF and Smart Client individually on themselves. So, how to develop WPF with Smart Client? First question on your mind would probably be "any template or source code on this?". Well...I thought the same too. Here it is, the site is known as Smart Client WPF Community Site. Generally the site offers a modified project from Microsoft Smart Client Software Factory to support building WPF based applications using Kent's WPF layer for CAB.
Another reference: http://www.codeplex.com/scsfcontrib
Unlike WPF, Smart Client isn't a technology, and it isn't any specific architecture. It is a concept and a style of applications that combines the best of both windows applications and web applications. They combine the windows applications capabilities of providing rich user experience that are not complex to develop, and that can use local resources which allow it to be responsive, interact with connected devices, and other things that web applications just can't do. On the other hand, Smart Client combines the best features of web applications which are there ability to be centrally deployed and managed (Symbyo.com, 2008).
Why do we need a Smart Client? Let's consider the pros and cons of both Web Application and Desktop Application:
Web Application
The Thin clients or the Web application provided features like...
1. Easy to Update – Single location update
2. Easy to deploy – Single location Update
3. Easy to manage.
If it had the above features then it also had the following issues...
1. Network dependency – are usually Network based
2. Poor user experience – mainly emit HTML
3. Complex to develop.
Desktop Application
The Thick clients or the Rich client or Desktop Applications or Client/Server application provided features like...
1. Rich User experience – by means of better user interface
2. Offline capabilities – Need not be connected on a Network
3. High Developer Productivity
4. Responsive & Flexible
The Thick did provide the above feature but on the other hand they also had the following issues...
1. Tough to Update – Each location needs modifications
2. Tough to Deploy – Deployment had to be done at multiple location
3. “DLL Hell”
WIth consideration to the pros and cons of both architecture, Smart Client combines the best features of both architecture. A graphical approach of Smart Client architecture is shown as below:

According to Codeproject, a Smart Client would have the following characteristics:
- Local Resource Utilization - A smart client application always has code artifacts on the client that enable local resources to be utilized. What do we mean by local resources? We mean everything from hardware to software resources. A smart client may take advantage of the local CPU, local memory or disk, or any local devices connected to the client, such as a telephone, bar-code/RFID reader, and so on. But it may also take advantage of local software, such as Microsoft Office applications, or any installed line-of-business (LOB) applications that interact with it.
- Connected - Smart client applications are never standalone and always form part of a larger distributed solution. This could mean that the application interacts with a number of Web services that provide access to data or an LOB application. Very often, the application has access to specific services that help maintain the application and provide deployment and update services.
- Offline Capable - Because they are running on the local machine, one of the key benefits that smart client applications offer is that they can be made to work even when the user is not connected. For applications running in occasional or intermittent connectivity situations, such as those used by traveling workers or even those running on laptops, tablets, PDA's, and so on, where connectivity cannot be guaranteed at all times, being able to work while disconnected is essential. Even when the client is connected, the smart client application can improve performance and usability by caching data and managing the connection in an intelligent way.
- Intelligent Install and Update - Smart client applications manage their deployment and update in a much more intelligent way than traditional rich client applications. The .NET framework enables application artifacts to be deployed using a variety of techniques, including simple file copy or download over HTTP. Applications can be updated while running and can be deployed on demand by clicking on a URL. The Microsoft(r) .NET Framework provides a powerful security mechanism that guarantees the integrity of the application and its related assemblies. Assemblies can be given limited permissions in order to restrict their functionality in semi-trusted scenarios.
- Client Device Flexibility - The .NET Framework together with the .NET Compact Framework provides a common platform upon which smart client applications can be built. Often, there will be multiple versions of the smart client application, each targeting a specific device type and taking advantage of the devices unique features and providing functionality appropriate to its usage.
Now, if you are going to develop a Desktop application for your clients, would you consider Smart Client? Take for example, a common situation that happens to everyone, after you made a bug fix to your application, you need to deploy the installation/update package to every PCs. Without Smart Client, you probably need to go to each PC, insert installation CD or browse to a network sharing folder, run setup.exe. In contrast, if you are using Smart Client/ClickOnce approach, all you have to do is fire up your IE browser, enter a specified address to download the setup file and it will install automatically. In addition, this easy step can be performed by the application users themselves.
A brief introduction on the functionality of ClickOnce approach: "ClickOnce enables the user to install and run a Windows application by just clicking a link in a web page. The core principle of ClickOnce is to bring the ease of deployment of web applications to the Windows user. In addition, ClickOnce aims to solve three other problems with conventional deployment models: the difficulty in updating a deployed application, the impact of an application to the user's computer, and the need for administrator permissions to install applications. ClickOnce applications can be self-updating; they can check for newer versions as they become available and automatically replace any updated files. For its installed application flavor, ClickOnce presents several update options. Applications can be configured to check for updates on startup or after startup. ClickOnce also exposes programmatic APIs to customize update behavior. There is also support for required or mandatory updates for managing ongoing updates and ensuring that the entire user-base can be moved up to a new version in a timely manner. (Wikipedia,2008)".
Introduction to Building Smart Client Applications. The sample source code and presentation slides can be downloaded at here. A common question that will be asked by anyone: "What's the best practice when developing a Smart Client application?". Well...your answer can be found here, the Smart Client Software Factory. The Smart Client Software Factory (SCSF) is a technology toolkit from the Microsoft Patterns & Practices (P&P) group that focuses on building complex, composite smart client applications. SCSF takes advantage of the Microsoft Enterprise Library 2.0 and Composite UI Application Block, using a software factory model to generate the application framework through a set of wizards. Using SCSF results in more rapid and standardized application development, allowing developers to generate core application frameworks and focus on building the business logic behind the application rather than the plumbing code. SCSF is also extensible through P&P's Guidance Automation Toolkit (GAT).
For more read-up on Smart Client, this is the best site you must refer to.
In a nutshell, WPF a.k.a. Windows Presentation Framework provides the foundation for building applications and high fidelity experiences in Windows Vista, blending together application UI, documents, and media content, while exploiting the full power of your computer (WPF MSDN, 2008).
If you have never seen any WPF application before, look for sample applications at here. If you are a developer or a designer, I can assure that you will be WOW after seeing the nice UI and probably consider building an application like those. Therefore, in the remaining post, I will only discuss about how to get started and the REAL world practice. Well...if you need an introduction or walkthrough on what is WPF, download the presentation slide at here.
To GET STARTED, Microsoft provides a all-you-want-to-know site named WindowsClient.Net. On the other hand, to get started in Silverlight, the site you must refer to is Silverlight.Net. First of all, download all the essential tools such as Visual Studio 2008 and Expression Studio.
LEARN FROM EXPERIENCE. Frankly speaking, when I was ready to learn WPF and Silverlight, I had skipped reading up those "how to develop a Hello World" tutorials. What I did is download some sample projects with source code, run it and study it.
If you are going to develop a commercial or enterprise application, do refer to Composite Application Guidance for WPF by patterns & practices Developer center. You may download the Composite Application Guidance package that consists of a sample application source code and documentation. Refer to this guide is very useful, as I'm using it too for my projects.
Last but not least, a few must-explore-into tools are WPF Application Quality Guide and Performance Profiling Tools. The WPF Application Quality Guide provides guidance for improving the testability of WPF applications; Performance Profiling Tools allow you to analyze WPF application run time behavior and potential performance bottlenecks.
Silverlight 2 RC is available. Again this final release carries a lot of changes compared to Beta 2. And again I need to update all my Silverlight projects :(. Well...some of the positive highlights of this final release are New Controls and New Controls Skin. At last, we have combobox control (I still remember the day I need to use popup control and label to create a combobox in beta 1, 2), and also progress bar and password box. Besides that we have messagebox.show() now.
For more information on breaking changes, dowload at here. Silverlight 2 Release Candidate Now Available - ScottGu's Blog Silverlight 2 Released - ScottGu's Blog
Finally, a commercial banner built in Silverlight is out there...Well, it could be the first in Malaysia. Good job, LV san!
Direct preview of the banner can be seen here.
I posted a carousel sample at here somewhere but it was in beta 1 version. Looking for a beta 2 version? Go to this link. Thanks Chalvantzis for the effort.
Hereby I uploaded my beta 2 version which create carousel items from reading/parsing xml file. Download here.
1st Demo: SilverlightPart. SilverlightPart enables you to host Silverlight application in Sharepoint, without building the web part for Silverlight application. SilverlightPart can be downloaded from Silverlight for Sharepoint BluePrint site. However, the control was not developed for Silverlight 2 Beta 2 yet (up to the date of this post). The project was re-compiled to fit Silverlight 2 Beta 2. On top of that, the project is re-built using SmartTemplates that means setup wizard is created for the ease of your Sharepoint web part installation.
2nd Demo: Sharepoint MasterPage with Silverlight Navigation control. Download here.
3rd Demo: Data Binding. Shows how to read images list from Picture Libraries in Sharepoint (via web service), then displayed it in Silverlight Surface control. You must place the "clientaccesspolicy.xml" and "crossdomain.xml" to the root of the Sharepoint site using Office Sharepoint Designer. Download here.
Download all demos at here.
GETTING STARTED! To those who have downloaded the samples from Silverlight for Sharepoint Blueprint site but failed to get it works, please perform the following checklist:
In Sharepoint server environment, make sure:
- WSS 3.0 SP 1 is installed
- .NET Framework 3.5 is installed if using Silverlight 2.0; .NET Framework 2.0 is fine for Silverlight 1.0
- Download and install Microsoft Silverlight 2 SDK Beta 2. Deploy(drag & drop) System.Web.Silverlight.dll (browse to C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server) into Global Assembly cache (C:\Windows\Assembly)
- Extend web.config of your Sharepoint site with Microsoft ASP.NET extensions and Silverlight 2.0 configuration elements. This part is tricky. First, create a Silverlight 2.0 beta 2 project in Visual Studio 2008. Choose "Add a new Web to the solution for hosting the control". 2 projects are created: Website & Silverlight control. Referring to the web.config under Website project, add the elements according to section node into web.config of Sharepoint site.
- Make sure MIME type of .XAP file extension is registered in IIS. e.g.: File Name Extensions: .xap; Format: application/x-silverlight-2.
Done? If yes, you are ready to go!
|