SC-SF and CSLA?

SC-SF and CSLA?

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


Luke posted on Wednesday, May 24, 2006

I have just started with CSLA and I was asked by my manager to look at SC-SF(Smart Client Software Factory). So I wanted to start here by asking the question, Does anyone know if CSLA can be used with SC-SF? 

Thanks

pfeds replied on Wednesday, May 24, 2006

I have been implementing an application using the Composite UI Application Block (CAB) very successfully with CSLA, so personally I can highly recommend it.  The application is now 90% ready for release and I have no regrets using this architecture.

If you need any specific help then let me know.

Do it!

nermin replied on Wednesday, May 24, 2006

Definitely,

I am using it with the CAB in my current app, which shoulld be the base for the SC-SF templates.  Two libraries complent each other well.

Chris replied on Wednesday, May 24, 2006

pfeds, nermin,

I've been using CAB since March and I am now using CAB with CSLA. 

Have either of you altered your business objects at all with CAB attributes (such as pub/sub or smartpart)? 

CAB promotes the use of controllers that call services.  So, did you put your BO's and BO logic in the controller or did you put them in a service class? 

In previous CSLA WinForm applications I used an "object manager" to manage the state of the CSLA objects.  CAB workitems maintain (and persist) state and this state can be used to pass objects to views.  Did you guys use CAB's state to manage the state of your BO's or did you create an additional object manager?  If not, how did you manage state?

Chris

pfeds replied on Wednesday, May 24, 2006

Chris,

The business objects shouldn't have any dependancies on the CAB.  IMO you should keep your objects independant of any user interface layer.

I've found that in most cases I don't require services.  Generally my controllers work with the BOs directly, and then they're simply bound to the view from the controller.  I have in a couple of instances implemented a service that maintains a list of items that can take a while to retrieve from the server, so in effect I'm caching the objects.  I have multiple controllers use this data and provide a refresh button to reload the data from the server.  I have other services within the application such as a resource service and such, but these do not work with the CSLA objects.

As for CAB state, I do in a couple of instances save BOs to state when navigating from one WorkItem to another.  If I can I navigate by firing internal module events as find this is a far neater solution.  For example a ProjectListView could fire a ShowProjectDetailEvent with the ID of the project, and the ShowProjectDetailWorkItem would receive this and create the Project BO.

I hope this helps ~ I know this isn't strictly CSLA related (sorry Rocky!)

 

Chris replied on Wednesday, May 24, 2006

pfeds,

Thanks for your response.  I was just curious about whether or not you embedded any CAB attributes in your CSLA objects.  I am not doing that, but, the thought did cross my mind.  Think ActiveObjects.  The pub/sub events and handlers would serve the same functionality as the Observer/Observable pattern employed by ActiveObjects. 

I also agree with you about puttin BO's and BO logic right in the controllers.  Again, I just wanted to get feedback from you since you've been working with it for awhile.  IMO to use a "service" layer for the BOs is a bit redundant.

I think I am going to implement an "object manager", as I have in other CSLA projects.  Like you said, I will probably restrict the use of CAB state for passing objects to and from workitems and views.

Thanks again,

Chris

Luke replied on Wednesday, May 24, 2006

thanks for all the responses..

Copyright (c) Marimer LLC