Abstraction vs Encapsulation - Principles of Object Oriented Programming (OOPS)

Abstraction
In order to process something from the real world we have to extract the essential characteristics of that object.
Data abstraction can be viewed as the process of refining away the unimportant details of an object, so that only the useful characteristics that define it remain. Evidently, this is task specific.

Encapsulation
Encapsulation is one step beyond abstraction. Whilst abstraction involves reducing a real world entity to its essential defining characteristics, encapsulation extends this idea by also modeling and linking the functionality of that entity. Encapsulation links the data to the operations that can be performed upon the data.

OOP makes use of encapsulation to enforce the integrity of a type (i.e. to make sure data is used in an appropriate manner) by preventing programmers from accessing data in a non-intended manner


Through encapsulation, only a predetermined group of functions can access the data. The collective term for datatypes and operations (methods) bundled together with access restrictions (public/private, etc.) is a class

Basic differences between Oracle and SQL Server

ORACLE
  • Oracle provides password complexity enforcement rule.
  • Connect with one Schema and can work with other schema.
  • Oracle implemented the row versioning on the DB block level.
  • Oracle metadata is managed in the same manner as table data.So during data querying most of online DDL statements on the table can be performed simultaneously.
  • Starting from Oracle 9i the configuration of ROLLBACK SEGMENTS is automatic.
  • Oracle is well rich with Index Options.
  • Oracle provides Automatic Storage Management (ASM), which assists with RAC/Grid based cluster deployment.
  • Oracle provides proprietary cluster file system on Linux and Windows platforms that helps in avoiding the use of raw devices.
  • Oracle provides Materialized Views for performance improvements of Stored Data with multiple Tables.
  • Oracle has more recovery options for corrupted database, redo log or datafile than MSSQL.
MS SQL
Microsoft implemented row level lock based on each single row.
SQL Server
  • all DDL operations that are currently running on tables belong to database "Snapshot Isolation". "Snapshot Isolation" queries are prohibited.
  • SQL requires a complex setup of ROLLBACK Segments and Transaction Level use on it.
  • SQL has just BTREE Index while compare to Oracle.
  • SQL has limitations using Materialized Views.