D
D
Div-Man2018-03-12 21:20:54
PHP
Div-Man, 2018-03-12 21:20:54

Professional use of OOP?

So I don’t understand why, when they make some method, then it gets a lot of attachments? Let's take a look at the league/plates
component found on the packagist site . It has a render method , if you click on it, it works, through the make method , which works, through another render method . The make method creates a new object in which another object is created and there are many more nestings. So what am I talking about, am I right in thinking that these nestings (a lot of small methods) are created in order to be used for other methods, so as not to duplicate code?


Is this the correct use of oop?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
McBernar, 2018-03-12
@McBernar

A method, like any function, must do one simple thing and do it well.
This is the main principle.

B
bkosun, 2018-03-12
@bkosun

This is in order to comply with the SOLID principles (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question