This project is read-only.

Using Naked Objects Domain Model without Naked Objects MVC

Aug 28, 2012 at 11:21 AM
Edited Aug 28, 2012 at 11:37 AM

I want to use naked objects domain model in my ASP.NET MVC application. What I am trying to do is

  1. I have created naked objects domain model based on model first approach by installing the NakedObjects.ProgrammingModel package using Nuget.
  2. I have created default ASP.Net MVC 3 application (Internet & Razor view engine). I did not install NakedObjects.Mvc using Nuget.
  3. I have added references of naked object domain model project, NakedObjects.PMResources.dll, NakedObjects.Helpers.dll, and NakedObjects.Attributes.dll in my ASP.Net MVC 3 application
  4. Now I want to use/register services (repository classes) of model projects in my MVC application. My goal is to achieve 100% customized UI in my MVC application.

Is there any example of that?

 

Aug 28, 2012 at 11:36 AM

I'm assuming that your motivation is either:

1) You want to run a fully-customized ASP.NET UI alongside a generic Naked Objects MVC UI, targeted at different user groups, but using the same domain model.

OR

2) You want to use Naked Objects MVC to prototype the domain model, but then deploy with a fully custom UI

Either way, before going further, you should look at another option which is to run the same domain model with the Restful Objects for .NET viewer, and then building your fully-custom UI to interface to the Restful Objects API.  This would be my personal preference  -  and build the UI as a single page app, which is the emerging architecture.

If, however, you definitely want your custom UI to be an ASP.NET MVC app (i.e. the HTML views are generated on the server) then you can do it.  Effectively, you want to use the domain model, but not the Naked Objects framework at all.

Start by reading this thread right through:  http://nakedobjects.codeplex.com/discussions/360965 

I understand that Jacques now has this working (his motivation is option 1 above, but the principle is the same for option 2).