Composite views/Controls in WCSF

Topics: Web Client Software Factory
Oct 2, 2007 at 4:00 PM
I'm tearing my hair out now and it is probably down to my lack of experience in ASP.NET, so I'm hoping some kind soul could help direct me down the right path.

I'm mainly a winforms developer and I've previously worked with SCSF. The smart client implementation allowed composite views that contained multiple views within a workitem, allowing for code re-use and creation of custom composite controls. I'm struggling to implement this within the WCSF.

I want to create a CMS-style project, with blocks (webparts?) that contain my custom composite controls/views.

How do I achieve this within WCSF, does anyone have an example I can look at? It seems to me the WCSF is organised around using a single view per page, wrapped up in the master page. Should I be looking at creating web user controls/web custom controls? If so, does anyone have any tutorials/guidance on how to implement this?

I'm convinced this is purely down to my unfamiliarity with developing for ASP.NET and would really appreciate it if someone else who is using custom controls or composite views in their application could provide some insight.
Oct 2, 2007 at 4:54 PM
The January and June versions of WCSF had very limited support for ASP.NET User Controls. You could use them, but you would not get great features like dependency injection.
The October bundles release (in progress and very close to shipping the last couple of bundles) has support for DI on user controls and master pages.

The idea of a composite view in the web space is a little different than a composite view in CAB. When we developed the first version of WCSF, we started writing web apps the way we wanted to, found the pain points, and removed them as well as possible with libraries and code automation. When possible, we stole ideas and concepts from CAB and SCSF. However, some concepts do not translate to the web space well.

So, for your current challenges:
I'd point you at the ASP.NET docs and the www.asp.net site to get a good understanding of how User Controls work in the typical ASP.NET scenario. Try this page: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/userctrl/default.aspx. After you have gotten comfortable with that, take a look at the current code for the OrderEntryRI in the CodePlex source repository (the Source Code tab on the menu bar) or at the Reference Implementation Bundle (coming soon) for samples of how we see composite views working in WCSF apps.

Michael Puleio - patterns & practices
Webhttp://msdn.microsoft.com/practices/
Bloghttp://blogs.msdn.com/mpuleio/
Oct 2, 2007 at 9:19 PM
Michael -

Many thanks for your reply. It is a huge relief to hear that I'm not just missing something or misunderstood the fundamentals of how the WCSF operates.

I'm looking through the OrderManagementRI project and it looks like the solution is, as you mentioned for the forthcoming October release, User Controls supported by DI. That's exactly what I was looking for, so I'm overjoyed to see that not only has it already been thought of but that the release is on its way.

Again, thank you for the rapid and detailed reply, hair preserved I can go back to much WCSF joy.