Most voted "oop" questions
Object orientation is a paradigm of analysis, design and programming of software systems based on the composition and interaction between several units of software called objects.
Learn more…1,456 questions
Sort by count of
-
127
votes4
answers42803
viewsWhat really is DDD and when does it apply?
When I first studied MVC in the book I talked a lot about DDD (Domain-Driven Design). From what I understood at the time, the idea of the DDD was simply to program software with a focus on…
-
109
votes6
answers13840
viewsWhat good is a builder?
In general classes have constructor methods. What is the usefulness of the class constructor method? Why should we create it? It can work without it?
-
76
votes3
answers5608
viewsWhat does "immutable" really mean?
In that question I did about value types and reference types in C#, it was quoted in the accepted answer that instances of structs must be immutable objects. Reading on wikipedia confirmed that an…
-
74
votes8
answers5453
viewsWhy in some if’s situations are considered bad?
I read in some places that it is not recommended the exaggerated use of if, because it makes your code difficult to read and maintain, so it’s not a good practice. What would be the overuse of if in…
-
71
votes2
answers4053
viewsIs it wrong to use class inheritance to group common behaviors and attributes?
What they teach us about Inheritance The overwhelming majority* of materials dealing with Class Inheritance exemplify it as a mere mechanism for grouping common attributes or actions. At most, as a…
-
68
votes3
answers19793
viewsFunctional Programming and Object-Oriented Programming. What are they and what are their main differences?
What are and what are the main differences between Functional Programming and Object-Oriented Programming?
-
68
votes1
answer19312
views -
66
votes3
answers2309
viewsIs it right to prefer composition to inheritance?
I’ve read several articles and books of Designer Patterns the expression Prefira composição em vez de herança. I believe it is a rather controversial subject due to the views discussed. In my view,…
-
64
votes1
answer5474
viewsProgramming facing the interface and not the implementation, why?
What are the main reasons (in practice) that lead developers to apply the practice of developing for interface and not for implementation?
-
61
votes1
answer1802
viewsHow do prototypes work in Javascript?
It seems to me that the concept of prototype is fundamental in Javascript and even in several places I have read that is one of its strengths. However, this does not seem such a simple concept to…
-
60
votes2
answers2892
viewsPHP mixes object-oriented codes and procedural language?
I am learning PHP, and by the example I have seen on the internet there is a mixture in the coding of programs, of object orientation and structured procedures. Is that really common or am I…
-
57
votes7
answers1478
viewsIs using many interfaces a bad programming practice?
I am a student in Information Systems and I am modeling a game, a virtual pet that has its needs and conversation with its owner, below follows the modeling of classes and interfaces. I showed it to…
oop software-architecture interface abstract-classesasked 10 years, 5 months ago Ivan Ricardo Lopes 1,376 -
56
votes4
answers107040
viewsWhat is the difference between public, default, protected and private modifiers?
What are the differences between modifiers public, default, protected and private when working with inheritance? There are rules of how and when I should use them when I’m working with heritage and…
-
51
votes4
answers3366
viewsAre getters and setters an illusion of encapsulation?
It is common to teach that it is right to leave the class attributes private and create getters and setters for them, all because of the encapsulation. Isn’t that the same thing as making everything…
-
51
votes3
answers26529
viewsWhat is the difference between a class and an object?
I was reading a book on object orientation and these two entities are translated differently. What is the difference between the two?
-
50
votes7
answers6727
viewsIn object orientation, why are interfaces useful?
Someone can give a practical explanation of why interfaces are used and why they are useful to us developers?
-
49
votes6
answers32712
viewsAbstract Class X Interface
What is the difference between an abstract class and an interface? I don’t understand when I should use one or the other.
-
49
votes1
answer13752
viewsDifference between Icollection, Ilist and List?
What’s the difference between ICollection, IList and List? When I should use each one specifically?
-
48
votes3
answers24523
views -
47
votes5
answers28367
viewsWhen to use self vs $this in PHP?
I see it as a very frequent doubt: When should we use the self::, or the $this in PHP. Which form is best suited for use and what is the difference between the 2 situations?…
-
43
votes4
answers67145
viewsComposition and aggregation: what are the differences and how to use them?
Object orientation is common for objects of a certain class to have references to one or more objects of other classes. A very simple example is an object of a class Pedido with reference to a list…
oopasked 10 years, 5 months ago SomeDeveloper 18,074 -
42
votes6
answers3282
viewsIs there a Javascript class?
I am studying Javascript and saw some explanations that left me with doubts. Here at Stackoverflow I saw several questions about the possibility of creating an abstract class in Javascript. But my…
-
41
votes2
answers838
viewsWhat is the overhead of using object orientation?
In the company where I work today we are strongly encouraged to avoid object-oriented programming for both old and new projects. For old projects I agree that it is a bad practice to start inserting…
php oop performance software-architecture characteristic-languageasked 9 years, 10 months ago jlHertel 4,733 -
40
votes3
answers2698
viewsWhat are covariance and countervariance?
I saw something like in this question and I know that this relates in some way to object orientation. What are they? How do they affect my code, and how can I use them to encode better?…
-
39
votes3
answers25089
viewsWhat is the function of a static method?
Is it just convenience? I mean, it’s unnecessary to instantiate an object to use a function that doesn’t use the data from it. Is there a difference in execution? Memory, processing - resources in…
-
38
votes3
answers96047
viewsWhat is the use of a static or final variable in java?
What is the difference of the declaration private static int var_nome for private final int var_nome for private int var_nome? How these statements can influence my algorithm?…
-
37
votes3
answers8360
viewsProperty x Attribute
One propriedade of a class is not the same thing as a atributo? What’s the real difference between them? Or propriedade is a synonym for atributo or vice versa? Or varies according to the…
oop terminology characteristic-language property attributesasked 9 years, 5 months ago MeuChapeu 5,875 -
37
votes5
answers7326
viewsIs Javascript an Object-Oriented language?
Many say that it is not an object-oriented language, because it is not possible to define classes in it, until its version Ecmascript 5, but with the use of constructing functions and prototyping it…
-
36
votes6
answers34111
viewsWhat is and what is an abstract class for?
In object orientation, what is the meaning of an abstract class? What is its purpose?
-
35
votes3
answers1710
viewsWhat is the role of architecture standards in object orientation?
This question seems to have an obvious answer, but I confess that I still don’t get the idea myself. I am working with object orientation since 2011, mainly focused on web development. As soon as I…
-
32
votes2
answers1436
viewsWhat it means '~' in front of the constructor of a C#class
Working on a project here at the company, I came across some commands that are now being used more (yield, ??, anonymous type) but until I understood, but one who called my attention by not knowing…
-
30
votes2
answers5203
viewsMethods and properties in C# - advantages and disadvantages
In C# we have properties with getters and setters, which facilitates the insertion and reading of data in an object when some logic should be performed. In other languages, such as Java these tasks…
-
30
votes2
answers1659
viewsMeaning of terminology: "Object oriented"
What is the correct term for a fully object-based language (C#), and a language that uses objects but is not completely based on them. Example: VB has (had) several functions that were not in…
-
30
votes1
answer1075
viewsPolymorphism in procedural language
One of the characteristics of object orientation is polymorphism, the ability of a method to perform different behaviors according to the context that can be defined by a hierarchy…
-
30
votes3
answers814
viewsHow and when to build an object in valid state?
Think of a large class, a complete customer registration for example. It has a huge amount of attributes in it. Many of them need to be initialized in the construction of the object in order for the…
-
29
votes3
answers5730
viewsWhen should we declare a method static?
As a general rule, it is considered bad programming practice to use static methods. But in what situations it is justified (or not justified)? For example: if I were to create a simple method to…
-
29
votes1
answer10807
viewsWhen and how to implement Parcelable vs Serializable?
After a long time using the Serializable implementation in my classes on the Java platform (Android), I discovered Parcelable, but I was in doubt regarding the following questions below: 1. When to…
-
29
votes2
answers12489
views -
28
votes2
answers7111
viewsWhat to do if client can be both PF and PJ?
I’m developing an object-oriented system. I need to keep a customer record. It turns out that these clients can be both natural and legal persons. If clients were just legal persons it would be…
-
28
votes3
answers17504
viewsWhat is the purpose of Transient and Volatile in Java?
Sometimes when I declare my attributes I notice the transient and the volatile. I have the following doubts The transient and volatile are access modifiers? What is the purpose of using them?…
-
28
votes1
answer3003
viewsHow does the Repository standard work?
I was doing a study on a framework in PHP called Symfony. When I was studying about the database research, I realized that there are some differences in relation to the searches, as in frameworks as…
database oop pattern-design software-engineering repositoryasked 9 years ago Wallace Maxters 102,340 -
28
votes6
answers4346
viewsWhat is the difference between attribute and field in the classes?
When I am studying object-oriented programming, at times I hear about fields and attributes of a class, but the two seem to be different definitions to refer to the same thing. What’s the…
-
28
votes5
answers1775
viewsWhy is it bad practice to have int attributes?
I saw in the answer to that question /questions/17015/qual-o-uso-de-uma-variável-estática-ou-final-em-java/17136#17136, that: It is bad practice to have int attributes, unless they are "constant" or…
-
27
votes4
answers16118
viewsWhat is the difference between Static and self in PHP?
What’s the difference between static and self? Exemplify situations that justify your different uses. What does this have to do with late Static Binding?
-
27
votes3
answers11642
viewsWhat is the definition of the term coupling?
What is the meaning of the terms high/low coupling in object-oriented systems development or object-oriented programming (POO)?
-
27
votes3
answers1011
views@Override is required in Java?
If I have an abstract class Pessoa with an abstract method lerNome when I’m implementing this method in my class João I must make use of @Override in lerNome? The same happens when I use interfaces?…
-
27
votes4
answers1698
viewsWhy use C#extension methods?
What I get with extension methods I don’t earn with inheritance? Simply using it as the same name is complicated, since it creates more confusion than anything else.
-
26
votes1
answer1329
viewsIs it good practice to make an exception in these cases?
I’m solving some object orientation exercises. One of the exercises asks to write a class that represents an airplane flight, containing the date, number and methods to check the status of seats.…
-
25
votes4
answers5615
viewsWhat is the difference in the use of the Equals method for the ==operator?
What is the difference in the use of the method Equals for the operator == in situations of comparison between (1) value types and (2) reference types?
-
25
votes4
answers4453
viewsWhat are the practical advantages of using object orientation in the day-to-day life of a development team?
Work in a company that does not use object orientation, although the language allows (and encourage). I have studied and study object orientation, and do my personal projects in OO, but I do not…