Acidburn 0 Posting Pro

Hi guys,

I'm using the MVC 2 framework and have managed to mock up a website. I'm trying to demonstrate this prior to given the go ahead and make it full scale. I've got a "Persons" controller, this allows me to add a "person" to the application. I've got a slight issue since I want to "Mock out" the database connectivity and storage part, so I added a MockDAO for persons which uses a List<Person>. This as become my database if you'd like, I've placed the DAO in my controller but everytime I navigate to the controller it creates a new DAO thus my list object is reset.

Can I mock out the database like this? If so, should the DAO live in the controller?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.