Tuesday, September 20, 2016

Interview Question Series - Abstraction and Encapsulation

Abstraction means in object oriented design that , a class should and only include the required functions or methods. like if there is a class of Customer, it should not include any order related details. and it should have only required properties or methods of customer which is going to use in implementation of that class.

Abstraction means to show only the necessary details to the client of the object

another similar keyword is "Abstract Class"
Abstract class in OOD is like interface but can not create objects , it has only required methods/functions which can be used in derived / implemented class.
like a vehicle class can not create object but another derived class of this like CAR can create object or Hyundai, Maruti etc.

Encapsulation is used to hide its members from outside class or interface, this can be done with access modifiers, like public ,private, internal, protected and protected internal. also with proper implementation of get and set properties.

for example, in employee class the calculation of age is not required outside the class, so that method can be created as private and properties of get and set can be defined for date of birth and only get can be defined for Age. there is object have only age get option, there is no set for age property and no calculation method both are hidden inside the class based on encapsulation concept.

details of access modifiers
  • Public: Access to all code in the program
  • Private: Access to only members of the same class
  • Protected: Access to members of same class and its derived classes
  • Internal: Access to current assembly
  • Protected Internal: Access to current assembly and types derived from containing class.

Interview Question Series - Service oriented architecture

Service oriented architecture (SOA) is based on distributed computing where the consumer of service need not to worry about provider's implementation.
in other words, it has loose coupling, where consumer sends a request to provider and provider gives the response. this communication happens based on some rules and XML.

these rules are defined in SOAP/ REST implementation.

here in SOA , our provider can be written in JAVA/ Dotnet, and consumer can also be in different language.  not all code should be in same language.

it is recommended that implementations of SOA should use open standards to realize interoperability.

Change UUID for Virtual box's VDI File

vdi uuid rename command

VBoxManage  internalcommands sethduuid c:\rsoni\VirtualMachines\Win2012R2\Win2012R2.vdi