I've recently inherited a project which is a rich Winforms application written in C#. The existing architecture, based around the CSLA framework, is not very clean with data access inside the domain models and too much logic in the data layer (stored procedures) resulting in maintenance and performance problems.
The current options on the table are to either try and fix up or replace the domain layer and data access. I also need to be looking forward towards a Web UI.
(CSLA provides a simple way to turn on a middle tier through configuration, enabling a WCF service)
My prefered plan for Web UI is for a single page app with a Web API in the middle tier.
My question is, what is my best choice for architecure/frameworking this? I want to reduce the entry point for developers working within this framework.
I am thinking of these options:
Fix up CSLA and transition over to new domain object whilst extracting the data access into a repository pattern. Eventually write a Web API layer with view-models mapping from the domain objects.
- This means the dev team will need to be trusted with implementing CSLA layer correctly (unless I can template objects)
- This does mean that I am free to replace my data access as I please
- Using CSLA means it is compatible with current Winforms app (which I can tidy with the MVP pattern)
Move to Entity Framework Code First as the domain layer, which also takes care of my data access
- I have tiny bit of EF experience and have always found the Code First to have high entry point of knowledge
- This means my data layer is tied into EF
- Would need to create my own WCF service for existing Winforms
Use a simple data access layer with something like Dapper and a repository pattern, and replace the domain layer with something entirely new that will support both Web API and Winforms (even if small amount of adaption required)
- What are the current prefered frameworks for the domain layer (other than CSLA or Spring.Net which appears to be very quiet) for this?