[RUBY] What is object-oriented after all?

What is object-oriented for the time being?

The idea is to run a program with a combination of things (objects). An application is made up of parts, and the image is that the parts interact with each other to move the whole (gears mesh).

Thinking that a part is an "object" and an interaction is a "message" passed between objects, To get the right message to the right object, you need to "know that the sender of the message knows the recipient." And you know the other person, that is, there is a dependency between the two objects. Managing this "dependency" is object-oriented design. 087582.jpg In terms of catch ball, adults and children understand each other's position and You know how much force you need to throw to catch the opponent. (image)

Why is object-oriented good?

The application is subject to change on a case-by-case basis. Changing is a nuisance in the dependency that the sender of the message knows the recipient.

What is a dependency?

If you have registered for multiple services by carrier email, It can be said that the carrier email address and each service are dependent.

For example, when you change your mobile carrier, it's convenient because you can change the phone number as it is. You won't be able to use carrier email, right? What amendments do you need to make with this change?

→ Log in to all services that use the carrier's email address and change the email address

Just thinking about it makes me chill. And worst of all, two years after I forgot to change my email address on a service, I also forgot my password. If you want to reset your password, you will receive an email for resetting ... Previous email address that cannot be seen ...

What should I have done to prevent such a worst situation? ・ In the first place, I should have used gmail instead of using carrier mail. ・ It would have been better to set an e-mail address for a certain forwarding service (delusion) and have each service acquire an e-mail address from it.

But it is that? The same can be said for both of these That is, I should have set it in consideration of changes </ b>.

In other words, the object-oriented point should be designed with the change in mind, so that the email address of each service account can be changed simply by changing one email address of the forwarding service.

I'll add the code later

Recommended Posts

What is object-oriented after all?
What is object-oriented after all?
After all, what is [rails db: migrate] doing?
What is object-oriented programming? ~ Beginners ~
What is Cubby
What is Docker?
What is null? ]
What is java
What is Keycloak
What is maven?
What is Jackson?
What is Docker
What is self
What is Jenkins
What is ArgumentMatcher?
What is IM-Juggling?
What is params
What is SLF4J?
What is Facade? ??
What is object-oriented after all or just one thing to watch out for in programming
What is Java <>?
What is Gradle?
What is POJO
What is Java
What is centOS
What is RubyGem?
What is programming?
What is before_action?
What is Docker
What is Byte?
What is Tomcat
What is Maven Assembly?
What is `docker-compose up`?
What is a constructor?
What is vue cli
What is an interface?
What is Ruby's self?
What is hard coding?
What is a stream
What is Ruby's attr_accessor?
What is Java Encapsulation?
What is permission denied?
What is instance control?
What is an initializer?
What is Spring Tools 4
What is an operator?
What is object orientation?
What is Guava's @VisibleForTesting?
What is MVC model?
What is an annotation?
What is Java technology?
What is Java API-java
What is @ (instance variable)?
What is Gradle's Artifact?
What is JPA Auditing?
[Swift] What is dismiss?
[Java] What is flatMap?
What is a Servlet?
What is web development?
[Java] What is JavaBeans?
[Android] What is Context? ??