design patterns - Help designing my own rough DataContext -


I did a little bit of LINQ programming with TDD ASP.Net MVC and liked it. Degraceing, I am now learning webform against stored procs and can not use linq. I would like to maintain some loose coupling and testability which was mixed with MVC.

I did not have time to learn and setup a dependency injection infrastructure, instead I created an object factory that is necessary to be configured to make fake or actual examples, depending on which is necessary is.

The problem with this approach is that the factory offers new examples of my test reserves, so when the unit accepts a repository for the unit, it can be done without any changes in the context of my unit test. Receives a fresh example - this is the problem. Since there is no firmness mechanism in the examples of my examination and I am not using dependency injection, I need a way to use the current data reference of the unit test for the entity A, so that it can replace the filthy property of the entity B. Could get. Generally, I create my datacentext as a datatyon, but I have ruled it due to the issues of concatenation with the web-app

I instead look for a good pattern to follow I am doing As a stop interval, I am required that all repositories and business objects create an immediate hierarchy with reference to the data, where the datacentext refers to the repository with the DP, which provides commercial objects immediately with DC.

I have not used mixed patterns, succession or interfaces (except for fun). I am not much of the OO programmer but it looks very ugly Does anyone follow the suggestions of any good pattern? Who should organize my solution?

Look at the data mapper pattern, there should be many instances there, this is the approach we use and It works well for us.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -