Question 59


1.1.4 Question

Multiple Choice

You are designing an application that allows employees to change their human resources (HR) information, such as next of kin and direct deposit information. The re­quirements state that the application should talk directly to the HR systems’ database.

However, at a recent company meeting, the CFO announced that the company will be converting to a new HR system over the next two years. They will take an additional year to move employees to the new system, one department at a time. How will this affect your design?

  • A. It won’t; the requirements state that the application should talk directly to the HR systems’ database.
  • B. You should ensure your naming convention for the database as clearly as possible so you can rework your data calls with minimal changes.
  • C. You should implement the Repository pattern with the current HR system being the first repository that is built. When the second system comes online, you imple­ment that data access using the same pattern.
  • D. You should map the model directly to the database calls, anticipating that you will have to change the model as the new system rolls out.

Answer:

C
Explanation
A. Incorrect: It is the designer’s job to ensure that any known enhancements or fu­ture changes are accounted for. Although this approach follows the requirements, it is not the best long-term solution.
B. Incorrect: This solution does not provide the proper level of abstraction; it re­quires either a “one or the other” approach to supporting the HR system, or an approach in which you have to manage which database you are calling from within each data call.
C. Correct: Using the Repository pattern will give you a level of abstraction into the data layer. When you create the second data access component for the new HR system, you can then differentiate on a user or departmental level which imple­mentation to use.
D. Incorrect: This solution does not provide the proper level of abstraction; it re­quires either a “one or the other approach” to supporting the HR system, or an approach in which you have to manage which database you are calling from within each data call.