How do I know if I'm programming procedurally in object orientation?

8

How do I know if I'm programming procedural style in an object-oriented language?

    
asked by anonymous 23.07.2017 / 19:41

2 answers

3

It's hard to say what's right or wrong, because everything depends on a context, but in object orientation there are some topics. Some things that can help are:

  • Avoiding giant classes (also known as god class).
  • Separate the parts of the software into components with a well-defined responsibility.
  • Create objects to represent the parts that make up a project.
  • Use composition to make objects work together (Injection dependency is a great practice to do this).
  • Study SOLID principles.

Anyway, there are several topics, I mentioned some that I think is important. Begin by trying to understand the principles and be critical of your own code. Object orientation is a complex subject and very conceptual, one must always be studying.

    
29.09.2018 / 16:38
0

When you call a procedure directly without sending a message to a specific object so that it takes care of it you are being procedural.

When you tap properties of an object outside the object's own class you are being procedural.

    
03.12.2018 / 15:28