Impedance Mismatch

In object oriented programming, there is one problem called Impedance Mismatch. The problem occurs when there is a mismatch / differences / gap between objects in an application and representation of data in storage.

Some differences that can cause Impedance Mismatch are:

  • Data type
  • Structural and integrity
  • Manipulative
  • Transactional

Features in programming language and framework can help reduce Impedance Mismatch, such as LINQ and Entity Framework in .Net framework.

Reference: Wikipedia

innerText x textContent in Mozilla Firefox

Mozilla Firefox doesn’t support JavaScript’s innerText property. Instead, the similar property used by Firefox is textContent. textContent is W3C-compliant property.

Differences between innerText and textContent are:

  • innerText is MSHTML’s proprietary.
  • textContent includes <script> tag on return value.
  • In Opera browser, innerText is modified to behave just like textContent.
  • textContent is supported in Internet Explorer 8 and 9.

Reference: Stackoverflow

Type System: Dynamic / Static x Strong / Weak x Type Safety

Dynamically Type

A programming language is said to be dynamically typed when the majority of its type checking is performed at run-time as opposed to at compile-time. In dynamic typing values have types, but variables do not; that is, a variable can refer to a value of any type. This includes APLErlangGroovyJavaScriptLispLuaMATLAB/GNU OctavePerlPHPPick BASICPrologPythonRubySmalltalk and Tcl.

Statically Type

A programming language is said to use static typing when type checking is performed during compile-time as opposed to run-time. Statically typed languages include ActionScript 3, AdaCDEiffelF#Fortran,GoHaskellhaXeJADEJavaMLObjective-COCamlPascal, and Scala.

Strongly Type

A type system is said to feature strong typing when it specifies one or more restrictions on how operations involving values of different data types can be intermixed.

Weakly Type

Opposite to Strongly Type. Also defined as languages that support either implicit type conversion, ad-hoc polymorphism (also known as overloading) or both.

Type Safety

Type-safe code accesses only the memory locations it is authorized to access. (For this discussion, type safety specifically refers to memory type safety and should not be confused with type safety in a broader respect.) For example, type-safe code cannot read values from another object’s private fields.

Source: Wikipedia

SqlCommand.Execute Methods

There are 4 different Execute methods in SqlCommand class.

ExecuteNonQuery: Executes a Transact-SQL statement against the connection and returns the number of rows affected.

ExecuteReader: Executes the CommandText against the Connection and builds an IDataReader.

ExecuteScalar: Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

ExecuteXmlReader: Sends the CommandText to the Connection and builds an XmlReader object.

Source: MSDN

SQL Union

Union: The UNION operator selects only distinct values by default.

Union All: The UNION ALL operator selects duplicate values.

Source: W3Schools

Type of SQL Joins

These are type of SQL Joins:

Inner Join (Join): return rows when there is at least one match in both tables.

Left Join: return all rows from the left table, even if there are no matches in the right table.

Right Join: return all rows from the right table, even if there are no matches in the left table.

Full Join: return rows when there is a match in one of the tables.

Cross Join: returns the Cartesian product of rows from tables in the join.

Source: W3Schools, Wikipedia