1

I'm looking to re-write an admin app, and I already have a pretty clean domain class library and web services/databases to handle all the business logic and persistence. That is, the library already provides CreateFoo, GetFoo, and UpdateFoo methods, that by default use existing web services.

I thought I might use Naked Objects for .NET MVC to write a new web admin tool. It seems like Naked Objects assumes that you want the Naked Objects framework to handle both GUI and persistence, but I just want the MVC web site to come from Naked Objects, not the persistence.

Is there any guidance on how to do GUI-only Naked Objects for .NET? How do I "turn off" the persistence side altogether? If I just try it, I get an exception "No entity connection strings in App.config file"--of course, I don't want to use any connection strings.

UPDATE: Injecting a new NakedObjects.Persistor.Objectstore.Inmemory.InMemoryObjectPersistorInstaller into the Persistor property in RunWeb.cs seemed to switch me over to in-memory persistence. Diving a little deeper, it seems as though I might need to implement more complicated interfaces--thus the need for a guide. Maybe it isn't worth using Naked Objects for applications where we would have to wire up all the persistence logic to fit Naked Objects's interfaces?

Patrick Szalapski
  • 8,738
  • 11
  • 67
  • 129
  • 4
    Is *Naked Objects* some framework that I have never heard of, or is it just a notion that you are using to say POCO? Are you talking about view model? I don't understand what you are asking. – Darin Dimitrov Jun 18 '12 at 14:39
  • @Darin: might be this: http://nakedobjects.codeplex.com/ – David Brabant Jun 18 '12 at 14:43
  • Sorry, added link to clarify for those unfamiliar. – Patrick Szalapski Jun 18 '12 at 14:50
  • You might be able to use my project, Noodles to acheive what you are after. It's a NO style framework but doesn't have any tie-in to a particular data architecture: https://github.com/mcintyre321/Noodles – mcintyre321 May 28 '13 at 12:38

2 Answers2

3

As you say, you can use NO MVC with the in-memory object store. You need to override

protected override IObjectPersistorInstaller Persistor

property in the RunWeb class.

But the objects have to come from somewhere. In the case of the in-memory object store, the other installer to look for is the IFixturesInstaller, which defines a set of fixtures (entities) to install into the in-memory objectstore on startup.

Overall, though, it maybe that your use case doesn't particularly fit what NO MVC was designed to do.

Dan Haywood
  • 2,215
  • 2
  • 17
  • 23
1

looks like naked objects used EF for persistence. EF is a ORM therefore a db is expected. so the short answer is, you cannot switch from a DB to webservices for persistence because NO is tied to EF.

Jason Meckley
  • 7,589
  • 1
  • 24
  • 45