Concepts for the adoption of object orientation

Asked

Viewed 297 times

1

I came across this question, researched it and the correct answer is:

e) computing is triggered by the exchange of messages between objects.

I agree that the And is true, but what I don’t understand is this, because the letter D this wrong?

Object orientation is an abstract way of thinking a problem using real-world concepts and not just computational concepts. From this perspective, the adoption of the object-oriented paradigm necessarily implies that:

  • a) users use the applications more simply.
  • b) the systems are encapsulated by other systems.
  • c) application programmers are more specialized.
  • d) the objects are implemented efficiently and simply.
  • e) computing is triggered by the exchange of messages between objects.

From what I understand about object orientation to D this also correct.

  • 1

    To D Seems wrong to me. I can implement something using object orientation without being efficient, or add unnecessary levels of complexity to something simple to do

  • I believe this D is more focused on good practices with OO.

1 answer

3


In my view, the key words here are necessarily entail. Although simplicity is usually present in philosophy for the implementation of object orientation concepts, it is not a necessary requirement to be configured as such. I can apply the concepts of orientation to objects in order to complexize my application without need and even then it will be object orientation.

A simple example would be to create a class that represents the system user. Simply, I could do something like:

class User {
    public string name { get; set };
    public string username { get; set };
    public string password { get; set; };
}

Depending on the application, this class would be enough, but it is possible to make it more complex, for example, using the concept of inheritance. We can imagine that username and password are user characteristics, but name is a characteristic of a person; thus, it would be possible to create a class Person and the class User inherit from her:

class Person {
    public string name { get; set };
}

class User extends Person {
    public string username { get; set };
    public string password { get; set; };
}

A trivial concept of object orientation has been applied, but this does not imply that my application has become more efficient or simpler. The opposite can happen: heavier and much more complex.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.