31 Object Relational Impedance Mismatch 32 Object Relational Mapper lets you

31 object relational impedance mismatch 32 object

This preview shows page 6 - 12 out of 29 pages.

3.1 Object Relational Impedance Mismatch
Image of page 6
3.2 Object Relational Mapper lets you query and manipulate data from a database using an object-oriented paradigm 3.2 Advantages and disadvantages of ORM advantages disadvantages Easy input sanitization Might cause performance issues There is no need to write SQL There is a learning curve to learn it Allows the use of OOP concepts Object Oriented Impedance Mismatch Fits the natural way of coding Leaky abstractions 3.3 Entity Framework API Entity Framework API (EF6 & EF Core) includes the following abilities: 3.3.1 EF Architecture:
Image of page 7
3.3.2 Context Class in Entity Framework 3.4 An Entity in the EF and States 1. Is a class in the domain of your application 2. two types of properties: Scalar Properties Navigation Properties 3. The entity state represented by an enum System.Data.Entity.EntityState in EF 6 and Microsoft.EntityFrameworkCore.EntityState in EF Core with the following values: 3.5 Querying in Entity Framework 1. Entity framework supports three types of queries: LINQ-to-Entities Entity SQL Native SQL 2. Eager Loading or Lazy Loading 4. Database approach 4.1 Database First Approach: database is created first using Data Definition Language, so writing SQL first
Image of page 8
4.2 Model First Approach: Visual Designer is used or the model is mapped out via XML configuration files, so ERD fisrt 4.3 Code First Approach: This is when Code (C# classes) are written or created ) 5. Conceptual model from your domain classes There are two ways to configure your domain classes: Data Annotation Attributes (System.ComponentModel.DataAnnotations, System.ComponentModel.DataAnnotations.Schema) Fluent API 6. Inheritance Strategy Overview
Image of page 9
6.1 Table per Hierarchy (TPH) 6.2 Table per Type (TPT) 6.3 Table per Concrete Type (TPC)
Image of page 10
7. Adv and Disadv of code and database first 7.1 code first Adv DisAdv Ability to “version” control database via SVN, Git or Mercurial. Difficult if new to the C# environment and already know SQL Reduces the amount of automatically generated code significantly. Heavily depends on the architecture of the systems in use, using it may be more difficult in scenarios where the database layer is important. A “developer” centric approach. 7.2 Database Adv DisAdv Assumes that the database design does not change over time. Requires an understanding of SQL to create the Database. Knowledge of SQL will make this task significantly easier in comparison to Code First. Changes to the database can negatively impact development as auto-generated codes may not be working as intended Lack the correct annotation attributes (sometimes). Week5 1. JavaScript JavaScript is a lightweight, interpreted or JIT compiled programming language with first class function. designed to run as a scripting language in a host environment is a prototype-based, multi-paradigm, dynamic scripting language, supporting object- oriented, imperative and declarative styles.
Image of page 11
Image of page 12

You've reached the end of your free preview.

Want to read all 29 pages?

  • Three '18
  • Staff
  • .NET Framework, Representational State Transfer, ASP.NET MVC, validation error messages , Take Down Request

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture