Thursday, November 28, 2013

What is an Object in Object Oriented Programming?

Objects are usable instances of classes. Using the blue print analogy, a class is a blueprint and object is building made from that blue print. Classes describe the type of objects.
For example we have a class (say Bike)

class Bike {
       
    }

Then we create object of this class as

Bike myObject = new Bike();

Objects share two characteristic. They have state and behavior. An object stores its state in fields (variables) and exposes its behavior through methods.
Software objects are conceptually similar to real world objects. For example we have real world object Dog.
Dog has state name, color, breed, hungry and behavior barking, fetching, wagging tail etc.
We represent it in software world as

class Dog
    {
        string name;
        string color;
        string breed;
        string hungry;
        void Barking()
        {  
            // function definition
        }
        void Fetching()
        {
            // function definition
        }
        void Waggingtail()
        {
            // function definition
        }
    }

Dog objDog = new Dog();

Saturday, November 9, 2013

What is Class?

A class is the blue print from where individual objects are created.  For example in real world, we may find many individual objects of same kind. There may be thousands of bikes in existence, all of the same make and model. Each bike was built from the same set of blueprints and therefore contains the same component. In object oriented terms, we say that our bike is an instance of the class of objects known as bikes.

The following Bike class is one of implementation of a bike.

class Bike {
        int Speed = 0;
        int Gear = 0;
        void SpeedUp(int increment)
        {
            Speed += increment;
        }
        void ApplyBreakes(int decrement)
        {
            Speed -= decrement;
        }
    }

Simple example of class is

class SampleClass {
   

    }

What is Object Oriented Programming?

Object oriented programming is a programming language model organized around objects rather than action, and data rather than logic. Objects have both data fields and associated procedures called methods. Objects are instances of classes and used to interact with one another to design applications and computer programs.

Saturday, October 26, 2013

Key Concepts of Entity Data Model

The Entity Data Model (EDM) uses three key concepts to describe the structure of data: entity type, association type, and property. These are the most important concepts in describing the structure of data in any implementation of the EDM.
Entity Type
In a conceptual model, An entity represents a specific object (such as a specific customer or order). Each entity must have a unique entity key within an entity set.
Association
In a conceptual model, an association represents a relationship between two entity types (such as Customer and Order).
Property
Entity types contains properties that define the structure and characteristics of Entities. For example, a Customer entity type may have properties such as CustomerId, Name, and Address.

What are Advantages and Disadvantages of Entity Framework

There are several advantages and disadvantages of using Entity Framework.
Advantages

  • No need to write the Data access layer code. Entire Data access layer code will be generated by the Entity  Designer (.edmx file). 
  • For small applications, no need to write Stored procedures for the CRUD opeartions (Insert,Update,Delete and modify). The Designer will provide the implementation. Developer need to consume those methods.
  • Reduces development effort and Unit Testing effort.
Disadvantages
  • As the queries are dynamic there might be a hit in the performance of the application.