Sunday, January 23, 2011

Abstract classes



Abstract classes can be very complex and still be use able.

Abstract classes can gain additional functionality without damage
classes that were using the old version.






Abstract classes represent fundamental types that can be built upon,
like Stream.


 Default implementations can be provided for some methods, taking the
burden off the programmer.

Saturday, January 8, 2011

What is Data Abstraction?

Data abstraction is a process of representing the essential 
features without including implementation details.
In computer programming, abstraction can apply to control or to data: Control abstraction is the abstraction of actions while data abstraction is that of data structures.
Lets take a person as example and see how that person is abstracted in various situations
      A doctor sees (abstracts) the person as patient.  The doctor is interested in name, height, weight, age, blood group,  previous or existing diseases etc of a person.
     An employer sees (abstracts) a person as Employee. The employer is interested in name, age,  health, degree of study, work experience etc of a person.
In the above example, the doctor may not be interested in characteristics of a person on which the employer is interested in and vice versa. 
Both employer and doctor will not be interested in all the characteristics of a person (like the color of dress the person wears on a particular day, the food the person takes, the relatives of the person etc).  But however some elements are common to both doctor and the employer (like name, age, height etc). 

Monday, January 3, 2011

What is an Instance?


     An instance has state, behavior and identity. The structure and behavior of similar classes are defined in their common class. An instance is also called as an object.

       Instance is nothing but objects in a class.Its just like students in a particular class having, just like different , height, weight, color, etc Means which can hold separate properties and behavior.

        An instance (also sometimes called an object) is when you use a class (or any other type) to allocate space on the stack, or the heap, and call the class's constructor. 

         If their was a class named Person. It might have instance variables for each person's weight. It might have a class variable for the common belly-button count for all Persons.

Sunday, January 2, 2011

What is Class ?


Object Oriented Programming has some key terms such as  Classes, Data Abstraction, Encapsulation, Information Hiding ,Inheritance and Polymorphism etc .

Class is a template for a set of objects that share a common structure and a common behavior.
Class describes the nature of a particular thing. Structure and modularity is provided by a Class in object oriented programming environment

Object Oriented Programming, or OOP is a type of programming that combines “objects” such as data fields and certain computer methods to create unique interactivity to effectively create applications and other computer software. 

           

Advanced Object Oriented Programming

what is an object?

In the beginning of our discussion,I would like to say some words about object, what is an object?
         object is combination of message and data.Objects can receive and send messages and use messages to interact with each other. The messages contain information that is to be passed to the recipient object.
        OOP is a method of programming in which programs are organised as cooperative collections of objects. Each object is an instance of a class and each class belong to a hierarchy.
      The two key principal concepts in OOP are the objects and the classes. The basic important idea behind these different but new languages is to make together the entire units containing the data and the functions that are operated on the different programs. Each of these units is known as the object.