Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unit Testing
Being able to properly unit test your code also requires that you can break it down into sensible modules that can be either mocked or tested, each in total isolation from one another. Your code should be designed in a way that allows you to feed it data and not care where the input/output comes froRead more
Being able to properly unit test your code also requires that you can break it down into sensible modules that can be either mocked or tested, each in total isolation from one another.
See lessYour code should be designed in a way that allows you to feed it data and not care where the input/output comes from/goes to. So the actual reading and writing to the file is abstracted away and your core code should be outputting some sort of sensible data structure, that then gets translated to the file format you need. You should be able to test your core logic and file reading/writing completely separately.
Repository Pattern
Repository is similar to DAO. It's an abstraction that hides the logic for accessing data from the business logic. It's part of the MVC pattern. The Repository is a wrapper around the Model. It is responsible for access the data from the persistent store.
Repository is similar to DAO. It’s an abstraction that hides the logic for accessing data from the business logic. It’s part of the MVC pattern. The Repository is a wrapper around the Model. It is responsible for access the data from the persistent store.
See less