WHAT IS OBJECT-ORIENTED PROGRAMMING

53
1202
views
JAVA

What is  OBJECT-ORIENTED PROGRAMMING.

  • INTRODUCTION–  C++ is an OBJECT-ORIENTED PROGRAMMING (OOP) like java language. The object-oriented programming approach has attempted to handle the large complexities in the program giving more reliable, clear and easily maintainable products. The OOP approach has a wide range of application like artificial inelegancy, normal networks, simulation and real-time system. C++ is today’s dominant computer language because of its striking features like data encapsulation, polymorphism, inheritance.
  • PROCEDURE ORIENTED PROGRAMMING(POP)– Procedure-oriented language contains lists of instruction and instruction tells the computer to do something such as reading, writing, and calculation.
  • MAIN CHARACTERISTICS OFP PROCEDURE-ORIENTED PROGRAMMING —

1.DIVISION INTO FUNCTION–  In this approach, a large program is divided into functions has a clearly defined propose and interface for other function.
OBJECT-ORIENTED PROGRAMMING

2) GLOBALIZATION OF DATA– In procedure ORIENTED language, the primary focus is on function and less importance is given to data. Data is made global so that it can easily be accessed by every function.

OBJECT-ORIENTED PROGRAMMING

NOTE– C and Pascal support local data also.

3) NEW DATA TYPE– It is very difficult to create new data types like complex data types. POL does not support extensibility.

3) RELATIONSHIP TO THE REAL WORLD– It does not model real world problem very well.

MAIN FEATURES OF PROCEDURE-ORIENTED PROGRAMMING–

  1. Follows structured programming approach.
  2. Function oriented, less importance to data.
  3. Globalization of data leads to loss of importance information.
  4. Do not model real world ver well.
  5. Follows top down approach.
  6. Example C, FORTMAN, Pascal.
  • OBJECT-ORIENTED PROGRAMMING– Object oriented programming approach binds the data and the function that operate on that data into a single entity is called an object. Functions of an object can only access its data. Thus, object-oriented programming language model around ‘objects’ rather than ‘actions’ and ‘data’ rather than logic.

OOP treats data as an important and critical element in the program development. It has data more closely to the functions that operate on it and thus avoid global access. In our real life, we encounter various objects like a chain, pen, mobile, TV, Desk etc. Thus, object-oriented programming revolves around real life.

Object oriented programming

MAIN FEATURES OF OBJECT ORIENTED PROGRAMMING–

  1. OOP is more data oriented.
  2. Programs are made up of objects which model the real world.
  3. Data and Functions are bonds together.
  4. Data security exists.
  5. Objects Communicate through Functions.
  6. The addition of new data and function is easy.
  7. OOP follows a bottom-up approach.
  8. Example- C++, JAVA, .NET.

Object oriented programming

CONCEPTS OF OBJECT ORIENTED PROGRAMMING–

  • OBJECTS– In object-oriented programming, a program is divided into objects, In our day to day life, we come across a number of objects. Some Examples are TV, Telephone, Car.

Each object has the following two characteristics– 

  1. State or Attributes– The state or attributes refers to built-in characteristics of an object. Example– A color TV has the following attributes.
  • Volume Control.
  • picture Control.
  • 75 Channels.
  • Remote Control Unit.
  1. Behavior or Operations– The operations of an object refers to its action. Example– A TV can have following operations.
  • Switched ON.
  • Switched OFF.
  • Displays Pictures.

 

  • CLASSES– A Class is a group of objects that share common properties and relationships. Classes are user defined data types and behave like the built-in types of programming. Objects are variables of the class of the type. Example– A class fruit has mango, apple, and banana as objects. Classes are the basic building block of object-oriented programming.
  • DATA ABSTRACTION– Abstraction refers to the act of representing essential features without including the background details or explanations. Example– A TV user can switch on the TV set and enjoy the various TV program without knowing its complete technical details.
  • DATA HIDING– Data Hiding is a property, where the internal data structure of an object is hidden from the rest of the program. Thus, the private parts of the objects are not available outside the objects and cannot be altered by external changes.

NOTE– Data hiding is implemented in C++ with the help of private and protected keywords.

  • ENCAPSULATIONS– The wrapping up of data and functions into a single unit is known as ENCAPSULATION is the most fundamental concept of OOP’s. The data is not accessible to the outside world and only those functions which are wrapped in the class can access it. Thus Functions provide the interface between the object’s data and the program.

NOTE– Encapsulations is implemented in C++ with the help of classes.

  • ADVANTAGES OF ENCAPSULATION–
  1. Data Security is not accidentally corrupted by the external world.
  2. It ensures that changes to data and functions of an object can be made without affecting other objects.
  3. Objects are independent of each other. Therefore, each object can be studied properly for better understanding the design.
  • RELATION BETWEEN ENCAPSULATION AND DATA ABSTRACTION.

  • INHERITANCE– Inheritance is the process by which objects of one class acquire the properties of objects of another class. It supports the concept of hierarchical classification. The principle of inheritance is that each derived class from which it is derived.

OBJECT-ORIENTED PROGRAMMING

NOTE- The main advantages of inheritance is reusability means that we can add additional features to an existing class without modifying it. The new class will have features of both classes.

  • THE NEEDS AND OBJECTIVE IN INHERITANCE
  1. It is required for extending the functionality of an existing class.
  2. It can be used to establish ‘A KIND OF ‘ relationship.
  3. It helps in reusing class by derived class.
  • POLYMORPHISM-  In simple terms, polymorphism means one name and many duties. Polymorphism refers to the ability of one thing to take many (poly) distinct forms (morphism).

NOTE- The process of making an operator exhibit different behavior in different instances is called operator overloading.

  • TYPES OF POLYMORPHISM- There are two types of polymorphism.
  1. COMPILE TIME POLYMORPHISM- Binding the code associated with the function call at compile time is known as compile time polymorphism. Function overloading implements compile time polymorphism.
  2. RUNTIME POLYMORPHISM- Binding the code associated with a function at runtime is called runtime polymorphism. Virtual functions implement this.
  • FUNCTION OVERLOADING- Function overloading refers to the use of one function name to perform different parameters type lists, The compiler will regard them as different functions.

aa

To correctly implement functions overloading, The parameters lists must contain either different numbers of parameters or there must be at least one position in their parameter lists, where the type are different. The correct functions to be invoked is determined by checking the number and types of arguments.

  • NOTE- Function overloading can be done for functions.
  • Having a different type of arguments.
  • Having different numbers of arguments.

 

  • ADVANTAGES OF FUNCTIONS OVERLOADED-
  1. The program becomes easy to read.
  2. The programmer need not waste time in searching for a new name for similar functions.
  3. The programmer can devote more time to logic development and need not remember different names.
  4. Easy maintainable of the code.
  5. A better understanding of the relation between program and outside world.

 

  • ABSTRACT CLASS– Abstract class is a class that defines an interface but does not necessarily provide the implementation for all its member. No object of an abstract class exists.

 

  • CONCRETE CLASS– A concrete class is a derived class of an abstract class that implements all the missing functionality. A concrete class can be instantiated.

 

  • APPLICATION OF OPPs–
  1. Artificial intelligence and expert System.
  2. Neural Network.
  3. Real-time System.
  4. Simulation and modeling.
  5. Object Oriented Database.
  6. Office automation System.
  7. CAD/CAM system.

53 COMMENTS

  1. I was wondering if you ever thought of changing the structure of your blog?
    Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so
    people could connect with it better. Youve got an awful lot of text
    for only having 1 or two pictures. Maybe you could space it
    out better?

  2. First off I would like to say awesome blog! I had a quick question which I’d
    like to ask if you don’t mind. I was curious to find out
    how you center yourself and clear your mind before writing.
    I have had a tough time clearing my thoughts in getting my thoughts out
    there. I truly do take pleasure in writing however it
    just seems like the first 10 to 15 minutes tend to be lost just trying
    to figure out how to begin. Any suggestions or tips? Thanks! https://en.wikipedia.org/wiki/Gran_Canaria/074/8

  3. My relatives always say that I am killing my time here at web, however I know I am getting knowledge all the time by reading such fastidious articles.

  4. hello there and thank you for your information – I’ve certainly picked up something new from right here. I did however expertise several technical points using this website, as I experienced to reload the website lots of times previous to I could get it to load correctly. I had been wondering if your web hosting is OK? Not that I am complaining, but slow loading instances times will often affect your placement in google and could damage your high-quality score if ads and marketing with Adwords. Well I am adding this RSS to my email and can look out for a lot more of your respective exciting content. Ensure that you update this again very soon..

  5. Pretty nice post. I just stumbled upon your weblog and wished to say that I’ve really enjoyed browsing your blog posts. In any case I will be subscribing to your rss feed and I hope you write again very soon!

  6. Wow, wonderful blog format! How long have you been blogging for? you make running a blog look easy. The total look of your web site is excellent, as well as the content material!

  7. I have been exploring for a little bit for any high-quality articles or weblog posts on this kind of house . Exploring in Yahoo I finally stumbled upon this web site. Reading this information So i am satisfied to show that I’ve an incredibly just right uncanny feeling I discovered just what I needed. I most surely will make sure to don’t disregard this website and give it a look regularly.

  8. Great blog! Do you have any helpful hints for aspiring writers? I’m hoping to start my own website soon but I’m a little lost on everything. Would you recommend starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m totally confused .. Any suggestions? Thanks!

  9. wonderful submit, very informative. I wonder why the opposite experts of this sector do not realize this. You must proceed your writing. I’m sure, you’ve a huge readers’ base already!

  10. Howdy! This is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done a marvellous job!

  11. I don’t even know the way I finished up here, but I believed this publish was great. I do not know who you’re but definitely you’re going to a well-known blogger for those who are not already 😉 Cheers!

  12. Thank you very much for writing the idea, I saved the webpage. I’m furthermore looking for material on garageband iphone, are you aware the place where I might come across a thing like that? I’ll be back in the future!

  13. Hmm it looks like your blog ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I too am an aspiring blog writer but I’m still new to everything. Do you have any suggestions for first-time blog writers? I’d genuinely appreciate it.

  14. An exciting discussion is worth comment. I believe that you simply should write a lot more on this topic, it might not be a taboo subject but usually men and women aren’t enough to speak on such topics. To the next. Cheers

  15. Greetings! This is my very first comment on your site so I just wanted to give a fast hello and tell you I truly enjoy reading through your articles. Can you suggest any other sites which cover lucky patcher for android? I’m likewise pretty keen on this thing! Thanks a ton!

  16. Hi and thanks for this great content! I certainly enjoyed it.I will be sure to take note of your website and will often return in the future. I would like to suggest that you keep on with the great job, even think about omega xl tablets also, have a nice evening!

  17. I’m seriously loving the theme/design of your website. Do you run into any browser interface situations? Some of the blog audience have complained regarding my omega xl for sale site not operating appropriately in Internet Explorer though looks fantastic in Safari. Have you got any recommendations to aid correct that situation?

  18. This website is known as a stroll-via for all of the info you needed about this and didn’t know who to ask. Glimpse right here, and you’ll undoubtedly discover it.

  19. Excellent post. I used to be checking constantly this weblog and I’m impressed! Extremely helpful info specifically the final part 🙂 I handle such information a lot. I used to be looking for this particular info for a long time. Thank you and good luck.

  20. Can I just say what a relief to locate somebody who basically knows what theyre talking about on the web. You surely know the way to bring an problem to light and make it significant. More people today must read this and have an understanding of this side of the story. I cant believe youre not extra well-liked for the reason that you surely have the gift.

  21. As I web site possessor I believe the content matter here is rattling magnificent , appreciate it for your efforts. You should keep it up forever! Best of luck.

  22. Great website. Plenty of useful information here. I’m sending it to some friends ans additionally sharing in delicious. And of course, thank you in your sweat!

  23. Hey, I just hopped over to your site by way of StumbleUpon. Now not one thing I would normally read, however I appreciated your thoughts none the less. Thanks for making something worth reading.

  24. “I simply could not leave your web site before suggesting that I really enjoyed the standard info a person supply for your visitors? Is gonna be back continuously in order to check up on new posts”

LEAVE A REPLY

Please enter your comment!
Please enter your name here