[JAVA] About object orientation

Introduction

While I have been studying and learning programming, I will write the meanings of the languages and words that I often hear as a review of whether or not I understand them properly.

This is my first post, so I think there are many points that cannot be reached, but thank you.

About the content of this article

When I was studying at the programming school I attended, I often hear the word object-oriented, so I decided to write this article by revisiting it. I think object-oriented programming is one of the words you often hear when you're learning programming, but when you ask me to explain it, it's difficult.

First of all, if you say it with a crisp explanation

The concept of expressing "things" as if they were assembled and operating them on a computer

is

To be honest, can I write it myself? ?? ?? It's so simple and difficult to explain ...

Why do you find it difficult

In the first place, there is no clear correct answer in the explanation of object-oriented programming, and since it is a concept, even if you research object-oriented programming while you are learning, almost all articles are confused because the explanation method and answer are different. I think I did.

So, I think that object-oriented programming is a rather vague answer, so I thought it would be good if I could somehow grasp the image and convey it.

Let's start with a quick understanding, not a 100% understanding

By doing so, you will gradually be able to understand that object-oriented programming is like this.

The need for object orientation

The reason why object-oriented programming is needed in the first place is that it will be easier to rewrite programming and it will be possible to respond flexibly to changes.

Object-oriented refers to a method of grasping the procedure to be programmed as one "thing", so we give each "thing" a role, and if there is a change, that one role. You only have to change the contents of the "things" in, so if you have a program that may change later, I think it's better to make it object-oriented.

Summary

I mentioned that understanding object-orientation makes you more resistant to change, but there are other benefits as well. If you summarize with four merits, including being strong against changes

・ Flexible response to program changes.
-Since the code can be reused for the same function, the amount of code description can be reduced and the development man-hours can be reduced.
-The range of influence during repairs is limited, and careless bugs can be reduced.
・ In large-scale development, it is easy for multiple people to share and develop.

Will be.

I think that you can understand it little by little if you understand the concept clearly while suppressing the merit of object orientation. I'm still not very familiar with it, so if you have any knowledge or advice on object orientation, I'd love to hear from you.

Recommended Posts

About object orientation
What is object orientation?
Explanation about Ruby Range object
About =
The illusion of object orientation
About Ruby and object model
About Java setters and getters. <Difference from object orientation>
Explanation about Ruby String object
Explanation about Array object of Ruby
About method.invoke
About Kotlin
About attr_accessor
Try to organize your own object orientation
About Hinemos
About inheritance
About params
About Docker
About Rails 6
About form_for
About Spring ③
About enum
About polymorphism
About Optional
About JitPack
About Dockerfile
[For super super beginners] What is object orientation?
About encapsulation
About Docker
About JAVA_HOME
About active_hash
About static
About exceptions
A PHP engineer who keeps improving legacy code learned about object orientation
About scope
[Maven] About Maven
[Must see !!!] I tried to summarize object orientation!