I’m working on an ASP.NET MVC site (using Team Foundation Service for source control) that I’ve divided into a few separate projects under one solution:
Project.WebAPI (Main entrypoint, contains "Views","Scripts" folders
Project.Data (abstract interfaces for backend data access)
Project.Data.SqlServer (concrete implementations for data access)
For my UI designer to work, he shouldn’t need access to much. Pretty much the only thing that he’s working on is the “Views” and “Scripts” folders of the main project. But “Project.WebAPI” takes parameters that live in Project.Data, so there’s a dependency there.
The app is SPA-style, so I could easily store a fake JSON payload which would entirely remove the need for logging in and pulling real data. My ultimate goal would be to be able to share a subset of the source with the UI designer allowing him to check changes directly into the overall project rather than create a separate instance just for his work which I would have to manually merge in. Does anyone have any experience with this type of thing?
Edit: for clarity: The purpose is to protect the intellectual property of the solution so that the front-end developers don’t have access to the entire solution. I hope that helps…
1
You want to use the DependencyResolver Class.
http://msdn.microsoft.com/en-us/library/system.web.mvc.dependencyresolver(v=vs.118).aspx
In your global asax, you set the resolver and wire up fake implementations of interfaces that your data access layer also implments
Then in your controller, you create 2 constructors
public Controller() : this(DependencyResolver.Resolve<IPersonDataAccessLayer>()) {}
public Controller(IPersonDataAccessLayer layer)
{
__layer = layer;
}
Then you can set up a fake implementation in your global.asax on your designers machine.