Composite WPF and CSLA

Composite WPF and CSLA

Old forum URL: forums.lhotka.net/forums/t/5269.aspx


triplea posted on Tuesday, August 19, 2008

The author of the following article did a great job not only giving a good overview of how SCSF works but also how you can best use it with CSLA:

http://www.codeproject.com/KB/smart/SCSF_CSLA_ProjectTracker.aspx

It would be great to see a version of PTracker using Composite WPF :-)

nermin replied on Tuesday, August 19, 2008

I need to comment on SCSF in general and using Csla with it.

 

I have not worked with the latest – WPF version of SCSF, but rather with an older version running on top of WinForms.

 

The advantages that one gets with SCSF, for me where following:

1)      Very clean separation of concerns – cleaner code with MVC (or MVC like) architecture

2)      Dependency Injection and loose coupling you get with it (not having to manage large amount of references sometimes is truly a great thing)

3)      Ease of testability.

 

There were others, like modularization, tight integration with Enterprise Library, etc but to me the top 3 were most valuable.

 

What I have learned over time is that SCSF is overly complex, that one can easily build and use MVC apps without a need for complex framework.

 

SCSF Dependency Injection engine did not work well with Csla – it needed a public constructor in order to build a Csla object.  Due to that I had to “wrap” Csla objects into “Service Objects” which were nothing but containers for Csla objects and exposed API that was passing calls to internal Csla BOs, as well as returning constructed ones back.

 

This was few years ago.  Again same like MVC, it would have been a lot easier to use a true DI Frameworks like StructureMap or Windsor which allow injecting references and constructing objects through Factory Methods – lot friendlier than a truly complex and not customizable (or for that matter debugable ObjectBuilder)

 

The best advice I can give you is:

Do not go automatically with the solution from Microsoft P&P team (that includes Ent Lib), as generally frameworks built by those folks are a copy of already implemented Open Source project, and for that matter, it appears to me that P&P folks use these projects to “learn” about technology and practices built by folks that implement Open Source version of those tools.

 

That leads to MS version of the thing being generally unnecessarily more complex.  Open Source version in addition are built with support of community and their comments (example of that being Csla), whereas MS P&P libraries are built and then given to us – we do not have much control or influence on  these tools.

 

Please make sure you consider all of these facts prior to going with something only because it comes from MS.

 

Nermin

 

From: triplea [mailto:cslanet@lhotka.net]
Sent: Tuesday, August 19, 2008 2:27 PM
To: Nermin Dibek
Subject: [CSLA .NET] Composite WPF and CSLA

 

The author of the following article did a great job not only giving a good overview of how SCSF works but also how you can best use it with CSLA:

http://www.codeproject.com/KB/smart/SCSF_CSLA_ProjectTracker.aspx

It would be great to see a version of PTracker using Composite WPF :-)



triplea replied on Tuesday, August 19, 2008

Hi Nermin

Thanks for the suggestion and comments. I can imagine that there are a lot of people sharing your views but SCSF has got quite a big following. My experience developing with SCSF + CSLA has been great. Not without issues but for the first time in my career I feel I can truly develop rapidly and solidly (if I may say so). I wouldn't attempt to write even a simple MVC UI framework as I recognise I am a bit weak in creating something solid from scratch to use as a framework/base/whatever, I prefer to be developing BOs and views! So the (very steep indeed) learning curve has paid off as far as I am concerned.

I'm not going to support or complain about the P&P team, I think they do a decent job but am not following them blindly. Just thought that its time to start learning WPF and that Composite WPF would be part of the learning curve for me as well. Oh and I dislike some parts of the Ent Lib I have used. Really...

A note on using other DI frameworks: that was one of the main deliverables (ObjectBuilder gone altogether by popular demand) and even though Unity is mainly used, there has been a lot of talk on how easy it is to use others such as Windsor.
EDIT: Actually there is a reference to an assembly ObjectBuilder2 in UnityExtensions. Need to investigate a bit more I guess...

In any case its great to see many different technologies and frameworks using CSLA BOs. A Composite WPF example wouldn't hurt, who knows I might even dislike and not use it :-)

hayrob replied on Wednesday, August 20, 2008

As the author of the article referred to (thanks for the kind comments), can I just say that I am in the process of upgrading (?) my application to use WPF.

This time however I've not used SCSF or PRISM but build my own framework on top of Csla. I have however used Unity which I think is magic - so much easier to use than the full blown CAB stuff. Using the Jeremy Miller concepts, http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx, you can build a much lighter weight solution.

triplea replied on Thursday, August 21, 2008

Cool thanks for the link and feedback. Looking forward to see the outcome.

AAKLebanon replied on Saturday, September 13, 2008

http://forums.lhotka.net/forums/thread/26058.aspx

 

I hope that some one see what I see about the role of a CSLA business object in the model-view-presentation model pattern !

Copyright (c) Marimer LLC