CSLA .NET FAQ

Yes.

CSLA .NET works great with any of the "M" patterns (MVVM, MVC, MVP, etc), since it is all about helping you create a great Model.

The only catch you might discover is that some (many?) implementations of the "M" patterns assume an anemic or limited Model implementation. Specifically they are often based around the idea that the Model is composed of DTO or dumb Entity objects.

CSLA .NET is all about creating a very rich Model, where the objects encapsulate actual behavior (business, validation and authorization rules) and are not just dumb data containers.

Due to this you may discover that some assumptions made by some "M" pattern implementations don't work real well. I view this as a problem with the pattern implementations, based on that terrible assumption that the Model should be lame...

The MVVM pattern has many variants. CSLA .NET works with any variant, but the best fit is where the ViewModel exposes the Model (the CSLA .NET root business object) as a property so the XAML can bind directly to your business objects. Other variants work as well, but require that you do a lot of redundant work in your ViewModel, which seems like a massive waste of time and money.

These forum threads have good information:


CSLA .NET version 3.8 introduced numerous features designed to streamline the creation of an MVVM UI over CSLA .NET business objects.

However, I do not plan to make CSLA .NET into a UI framework, and there are several MVVM UI frameworks out there. So my plan with 3.8 is to provide the most basic MVVM UI support in CSLA .NET itself, and to ensure that you can easily create viewmodel objects that work with virtually any MVVM UI framework, thus allowing you to choose the UI framework that meets your needs while still enjoying the powerful features provided by CSLA .NET.

This blog post has more information about the 3.8 MVVM features.

CSLA 4 provides rich support for MVVM in a way that integrates with the Visual Studio 2010 Xaml designer. CSLA 4 helps ensure that you can use the drag-and-drop features of the VS10 designer, while still enjoying the benefits of MVVM.

Edit

Can I use MVVM UI Frameworks?

You can use CSLA .NET and MVVM UI frameworks together. For example, this thread has good information about using Caliburn Micro with CSLA .NET.

Also, the Bxf framework is a super-lightweight MVVM framework. Bxf supports WPF, Silverlight, and Windows Phone development, and can be used with or without CSLA .NET. I am the original author of Bxf, and so you can imagine that it is designed to work smoothly with CSLA 4.

All content and CSLA .NET is Copyright © 2009-2011 Marimer LLC