Is CSLA the "M" in MVC?

Is CSLA the "M" in MVC?

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


LiteWait posted on Wednesday, April 25, 2007

It may seem like a stupid question, but since I am new to CSLA I wondered if CSLA can be thought of as the "model" in an MVC paradigm?

We've got a development team at our company building a MVC framework for all next generation development.  Unfortunately, the core guys doing this are ex-Java nuts who feel they have to create everything from scratch rather than investigating existing tools and technologies for .Net.  They've already shot down looking my idea of taking a look at CAB (even just for ideas).  I've looked at the code they are building for the "model" portion of the framework and it is so simplistic it won't be able to support anything other than a basic CRUD app...let alone our core Order Entry app which is 500 windows and 1.5M lines of code.

I want to take them on again, and it seems CSLA could fit nicely into the "model" portion of the framework, but I wanted to be sure before dig any deeper.
Thanks for your input.


Brian Criswell replied on Wednesday, April 25, 2007

From my understanding of the topic and reading the following Wikipedia article, I would say yes.
http://en.wikipedia.org/wiki/Model-view-controller
More specifically, the business objects that you created using CSLA would be your model.

RockfordLhotka replied on Wednesday, April 25, 2007

In general yes, it is the "M".

However, a lot of MVC implementation make an assumption (a poor one imo) that the Model is passive. That it is composed of objects that contain no logic, and just have public read/write properties.

Which is really sad, given that the Model is the most obvious and logical place for all your logic. CSLA helps you build a Model that does contain all your logic.

So my only word of caution is to be careful when looking at MVC or MVP to make sure you don't lose the ability to encapsulate all your logic in the Model, or the ability to create a rich, interactive user experience (assuming you are using Windows Forms or WPF) without duplicating things like validation logic into the View or Controller.

Copyright (c) Marimer LLC