Thursday, November 28, 2013

What is difference between class and object?

Class is a blue print or some template and object is a building created from this blue print or template. Class is a more abstract definition of something and object is the real thing that belongs to that class.
For example
Class:

class Bike {
       
    }

Object:


Bike myObject = new Bike();

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.