I tried to touch JavaScript Part.2 Object-oriented

Introduction

A memorandum that summarizes what I learned in my second month as a development engineer. Recently, I've learned a lot of new things every day, and I can't keep up with my feelings of fun and a lot of information! !! !! It is supposed to be. I will write it like my own external HDD!

↓ By the way, click here for previous articles -15th -16th -17th

I posted two articles today (. ・ V ・) ノ

The original meaning of an object

--Object ・ ・ ・ Object, object, purpose (from weblio English-Japanese dictionary)

What is object-oriented?

--The way of thinking in development. --A development method that considers the application to be created as **.

Object-oriented in Java

--The basic idea is [above](https://qiita.com/icchy_sh33p/items/dc00f27d8cb6cc2f4385#%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3% Same as 82% AF% E3% 83% 88% E6% 8C% 87% E5% 90% 91% E3% 81% A8% E3% 81% AF). --Created by instantiating based on the class and the code written in it → In other words, the image of ** making things from blueprints **. --There are two, ** class ** and ** instance **.

class

--Has a role as ** "blueprint" ** in Java. --Since the actual design is done in the class, the following things exist in the class. -** Method ** ・ ・ ・ Created in the blueprint ** Describes "behavior" ** -** Constructor ** ・ ・ ・ Processing created at the same time when creating an object

instance

--The real thing. Recognition that it is actually made. --Class ** instantiation ** ... A class that has been made real and can be used in that class. The result of instantiation is ** object ** = Class is ** Object blueprint! ** **

Object-oriented in JavaScript

--The basic idea is [above](https://qiita.com/icchy_sh33p/items/dc00f27d8cb6cc2f4385#%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3% Same as 82% AF% E3% 83% 88% E6% 8C% 87% E5% 90% 91% E3% 81% A8% E3% 81% AF). --In the case of JavaScript, one of the major features is that ** classes do not exist ** --There is a ** prototype object ** instead of a class -** Prototype object ** ・ ・ ・ Object as a blueprint (created so that you do not have to write the object every time) --** Objects in JavaScript ** ... entity, real thing (** close to an instance in Java **). ――It is difficult to create the same object many times / I want to add a function

→ ** Prototype object ** was created to make it easier to handle using the original object. → In other words, the image is that ** we will seek easier creation using blueprints from the original ones **.

Summary

--Same about the underlying object-oriented thinking in both Java and JavaScript ――By seeing the object to be developed as ** "things" **, the blueprint and the substance exist. ――However, the approach is opposite in object orientation. --Java has the image of ** assembling and completing things based on the blueprint ** ――The image of JavaScript is that ** further blueprints and entities are created based on the created entity, and the final product is completed ** using them.

Afterword

I was talking about the importance of object-oriented programming since I was touching Python, and while I was learning Java and JavaScript, I was a little careful, but how much do I understand? I wondered if I knew it properly in the first place, and I thought it would be okay to put it together once, so this time I decided on object-oriented programming!

To be honest, I didn't really understand the image of the object, and sometimes I knew this thing but didn't understand what it meant ... but when I put it together, I researched it again and read a reference book. I think I managed to reach a level that I can understand now.

It may take some time to output, but since I can organize and supplement the information in my head, I realized again that it is important to be conscious of people in this way. !! !! !!

I will summarize it again! !! See you soon

Recommended Posts

I tried to touch JavaScript Part.2 Object-oriented
I tried to verify yum-cron
I tried to chew C # (indexer)
I tried to summarize iOS 14 support
I tried to interact with Java
I tried to explain the method
I tried to summarize Java 8 now
I tried to chew C # (polymorphism: polymorphism)
I tried to explain Active Hash
I tried to summarize the methods used
I tried to introduce CircleCI 2.0 to Rails app
I tried migrating Processing to VS Code
I tried to summarize Java lambda expressions
I tried to get started with WebAssembly
I tried to solve AOJ's Binary Search
I tried to implement the Iterator pattern
I tried to summarize the Stream API
I tried to build AdoptOpenjdk 11 on CentOS 7
What is Docker? I tried to summarize
I tried to build Ruby 3.0.0 from source
I tried to implement ModanShogi with Kinx
I tried to summarize about JVM / garbage collection
I tried to verify AdoptOpenJDK 11 (11.0.2) with Docker image
I tried to make a machine learning application with Dash (+ Docker) part3 ~ Practice ~
I tried to implement polymorphic related in Nogizaka.
I tried to manage struts configuration with Coggle
[Rails] I tried to raise the Rails version from 5.0 to 5.2
I tried to manage login information with JMX
I tried to organize the session in Rails
java I tried to break a simple block
I tried to link grafana and postgres [docker-compose]
[Rails / JavaScript / Ajax] I tried to create a like function in two ways.
I tried to develop a man-hour management tool
I tried to develop a DUO3.0 study website.
I tried to chew C # (basic of encapsulation)
I tried to implement deep learning in Java
[Must see !!!] I tried to summarize object orientation!
I tried to create a LINE clone app
rsync4j --I want to touch rsync in Java.
I tried Spring.
I tried to build AdoptOpenJDK 8 (Addition: Amazon Corretto 8)
[Ruby basics] I tried to learn modules (Chapter 1)
I tried tomcat
I tried to output multiplication table in Java
[JavaScript] The strongest case when I tried to summarize the parts I do not understand
I tried to link JavaFX and Spring Framework.
I tried refactoring ①
I tried to set tomcat to run the Servlet.
I tried to build Micra mackerel in 1 hour!
I tried to develop an application in 2 languages
I tried to create Alexa skill in Java
I tried to develop a website to record expenses.
I tried FizzBuzz.
I tried to implement a server using Netty
I tried to break a block with java (1)
I tried JHipster 5.1
I tried to move Hello World (+ α) written in C language from JavaScript [WebAssembly]
I tried to make a message function of Rails Tutorial extension (Part 1): Create a model
I tried what I wanted to try with Stream softly.
I tried to implement file upload with Spring MVC
I tried to organize the cases used in programming