I have been involved in Java system development for about 10 years. What is object-oriented several times? You can talk about it in the field, read a book, or look it up online.
Meanwhile, what is a good object-oriented place for on-site interviews? I was asked. At that time,? ?? So I tried to reorganize my thoughts and put them into words.
Like me, I have a long experience in the field, but what is object-oriented? When asked again, what? ?? Those who become. I hope it will be a key to organizing the thoughts of such people.
-Understand object orientation correctly
It brings the way of thinking and appearance of the real world to the world of programming as it is. Therefore, object-oriented programs are intuitively easy to understand (because they are similar to the real world).
I was thinking.
But that? Really? Was that the program you've seen so far? As a result of asking myself, I came to another conclusion.
I will borrow the words of the reference site.
"In object-oriented programming, the whole function is not regarded as a monolith, but as a collection of" objects "with data and procedures."
I will get this.
Therefore, it is concluded that the object-oriented program has high independence of individual parts, so maintainability and reusability are high, development man-hours and repair man-hours are less than before, and productivity is increased. It has reached.
To add my understanding "Data" ・ ・ ・ Attributes "Procedure" ・ ・ ・ Behavior "What you can do if you get together" is the "function" of "objects" that have.
The objects are independent. Independence is important.
An independent "Tarosuke object" can participate in both A and B functions. That is, if you create a "Tarosuke object" when you create the A function, you do not have to create it again when you create the B function.
Since the independent "Tarosuke object" participates in both the A function and the B function set, If you want to correct the "procedure" that is common to the A and B functions, you only need to modify one of the "Tarosuke objects".
The instructing side is easy.
Specifically, when I thought, "I want you to create a user management screen." Whether the person you are instructing is "Tarosuke" or "Karasuke", if you instruct "Please create a user management screen", it will be created. The contents are "Tarosuke" and "Karasuke", and you can create a unique "user management screen".
Furthermore, even if "Monosuke" appears, you can follow the same instructions.
Leave it to the common parent classification.
Specifically, the same procedure for "Tarosuke" and "Karasuke" is done by creating "parents" and "good nights" in the "suke classification" and leaving it to them. Is it like that?
The good thing about this is that you can use the procedure even if "Monosuke" appears.
The instructor does not have to know the specific contents of the work. This is not recommended because it is likely to be a round throw at the system development site, but it is easy for program development.
When I thought "I want you to make a user management screen" that I talked about in polymorphism, Whether the person to instruct is "Tarosuke" or "Karasuke", if you instruct "Please create a user management screen", it will be created.
The instructor does not have to know how to make it.
The story.
Since the independence is high, the development man-hours and repair man-hours are less than before, and the productivity is increased. Wonder.
That said, there are no silver bullets out there. If so, everyone is using it (laughs) So I don't think it fits all.
However, it is regarded as one of the convenient methods. Use where you can. I think that is good.
I was able to organize it with my head! When I think about it and put it into words, it gets stuck in various ways. Verbalization is important w
Recommended Posts