Make WCSF the new SCSF

Topics: Web Client Software Factory, Project Management Forum, UIP Application Block discussion, User Forum
Sep 11, 2007 at 9:05 PM
The first time I looked at WCSF I was somehow disappointed that there was no support for user controls (Composibility), which, in my opinion, is a crucial part of enterprise development and code reuse. Fortunately, I've seen lately that the latest builds provide that feature. Going thru the code, I was quite impressed by the project structure the guidance package now generates.

I've used SCSF (yes, Smart Client SF) in Windows Forms apps and I still find it frustrating to have the framework generate the presenter and the UI in the same project. I find WCSF, on the other hand, greatly designed.

Now, the community has two projects addressing the MVP design pattern (although Microsoft has dropped development for SCSF). Unfortunately, the presenters I define in one are not usable by the other - and they should be! A presenter should be UI independent and I should be able to define a web UI and a windows UI using the same presenter.

Some may think that it’s very unusual to have a presenter that fits both worlds, but when you consider modular, reusable user control logic, it makes quite a lot of sense.

So, I’m finally coming to the goal of this post. I think that WCSF is on the right way from a design stand point, much more than SCSF is. What I would like to see is for the core WCSF functionality to be packaged so that it could be reused for both web and windows development.

WCSF is so close to be a reusable MVP implementation, and yet its goal seems to target Web-only apps. Why not make it work for both?

Martin
Sep 12, 2007 at 7:26 PM
Hi Martin,

I also would like to see some insights on this. It does seems to me that when going large scale you usually end up with some pretty different perfomance tuned code. The oportunities to improve application performance are pretty different when you have a smart client than a web application. Even tough, I really would like to get some view on this.
Sep 17, 2007 at 4:45 PM

Hi Freddy, presenter-reuse asside, I think the structure and generated code are very great and should work for both win and web apps. But then, some may argue to use SCSF while waiting for Acropolis. I personally dislike having two different technologies for web and windows when one could fit all. And I don't think Acropolis will target Web apps, so having WCSF support both win/web apps would be great.

Martin
Oct 1, 2007 at 4:14 PM

No opinion on this?
Oct 1, 2007 at 9:42 PM
@DevInstinct

1. You actually can reuse presenters, though there are several things to think about.
  • The first problem is in that the attributes used for Dependency Injection are different in Web Client from Smart Client. Smart Client uses the WorkItem for locating dependencies, where as Web Client uses a Composition Container that is stored in the Application state. One option to work around this might be to look into using inheritance. You could have all the common logic for your presenter be in a presenter base class and then inherit from that an SCSFPresenter and WCSFPresenter. In the base, you can make each member that you need injectable protected this allowing those properties to be overriden in each version with the appropriate attributes.
  • Web and Smart Client often have different UI interaction patterns, thus you may end up pigeon holing the user into a "Web like" experience in a smart client.
If neither of these issues poses a problem for you, then this might be a viable option for you to explore.

2. On the subject of unifying on Web Client, we've had this discussion many times internally and come to the conclusion that although it sounds good conceptually we think there's no magic answer. Web Client is still pretty far off from the functionality available in Smart Client particularly in terms of Workspaces, Event Broker, Commands, etc. In Web Client there is a single composition container at the Module level. This makes sense for Web apps where often a new use case is a new set of pages. In the Smart Client world however you are in one shell for the life of the app, the Workitem encapsulates sets of popup screens that will represent a UI process. The WorkItem hierarchy encapsulates processes off of those processes and so on. This is a good feedback though.