Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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...

share|improve this question

closed as unclear what you're asking by Robert Harvey, BЈовић, gnat, JeffO, GlenH7 Apr 8 at 19:28

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
I don't have any idea what you're asking here. Normally the line of demarcation for a UI is the REST interface (WebAPI). Everything should be provided through that. If you're referring to classes that are present in other projects that can be used in the UI, then simply put a reference to them in the UI project. If you're worried about tight coupling, then make some ViewModel classes and put them in their own assembly. –  Robert Harvey Apr 8 at 15:43
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.