>> Design Application Architecture
Plan Application Layer
Data access options
After you determine your data requirements—existing data, new data, or a combination—
consider how you need to access the data. The two primary options are:
object relational mapper (O/RM) - an application or system
that aids in the conversion of data within a relational database management system
(RDBMS) and the object model that is necessary for use within object-oriented programming.
The O/RM hydrates the object with the data from the database, or creates
the SQL statements that will save the object data into the database. Entity Framework, and Linq-to-SQL are examples of O/RM.
Writing your own component to manage interactions with the
database Writing your own component implies you will need to manage any
conversions to and from your object model. This approach might be preferred when
you are working with a data model that does not closely model your object model, or
you are using a database format that is not purely relational, such as NoSQL.
Entity Framework supports the Model First, Code First, and Database First design approaches.
Model First and Code First each offer a different way to link objects and a database.
An architect uses the Model First approach when designing the database and the object
model at the same time with Entity Designer in Microsoft Visual Studio. This was one of the
most-requested features after the initial release of Entity Framework because new projects
tend to need new database schemas.
SoC - Separation of concern is a software development concept that separates a computer
program into different sections, or concerns, in which each concern has a different purpose.
By separating these sections, each can encapsulate information that can be developed and
updated independently. N-tier development is an example of SoC in which the user interface
(UI) is separated from both the business layer and the data access layer.
Model - represents the table and data structure
View - responsible for displaying information to users. It’s the only part of the application that users see.
Controllers - handles incoming requests, handles user input and interaction, and executes application logic. A controller connector to the model and view. Controller is the gateway.
The Repository pattern is a design pattern that where the code to uses objects without knowing how the objects details. The deatils of the object, including mapping from tables to objects, is contained in the repository class.
Repository Pattern Example
Sample Question 56 | Sample Question 57 | Sample Question 58 | Sample Question 59 | Case Study Exam Question 1 | Case Study Question 42 | Case Study Question 47 | Case Study Question 48 | Exam Question 142