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
-
2
votes1
answer248
viewsAssociation, aggregation, etc. in practice?
I am studying POO and still can not see, in practice, the difference between them. Basically everything ends up in one class having as attribute the instance of another class. But if it is…
-
2
votes1
answer120
viewsHeritage is slowing the startup of my SPRING BOOT application
I’m working on an automatic text messaging system, in my class hierarchy I have an abstract class at the top called TaskNFSBusiness which sets the rules for messages that are not in real time, it is…
-
2
votes1
answer74
viewsHow do I build attributes based on values defined in the __init__ method in my class?
I wrote the following class: class Words(): def __init__(self, value, g_class, first_meaning = True): self.value = value self.g_class = g_class self.first_meaning = first_meaning #attribute meaning…
-
2
votes1
answer101
viewsObject Orientation - Flutter
I have an application in flutter that has a form and that the data is sent to a class, however, I have a specific screen that needs to recover a class data in which I sent, but when I recover the…
-
2
votes2
answers71
viewsObject array gives error when I try to access an element of it
package br.com.cursoemvideo; public class Olho { private String cor; private boolean funciona; public String getCor() { return cor; } public void setCor(String cor) { this.cor = cor; } public…
-
2
votes1
answer73
viewsHow to call the constructor within a method
I have a simple college exercise to mess with the vector. Basically these are the actions that we should do: cout << "\tMexendo com Vetor\n"; cout << "\n\nEscolha uma das opcoes para…
-
2
votes2
answers46
viewsPrint an attribute of several classes
I am creating a program that will launch the establishment products and creating each product being an object already that they have type, name and price. I want to print a specific attribute of…
-
2
votes1
answer45
viewsHow far do you try to predict the future when designing an application?
How far can we or should we try to predict the future when designing an application? Be it architecturally or in design. What makes a rugged change-face design without being overly planned? It is a…
oop software-engineering software-project project-management requirementsasked 4 years, 8 months ago Piovezan 15,850 -
2
votes2
answers259
viewsInvoke child class method in C++
I have a parent class/structure and a daughter class/structure in C++. The parent class defines a method, and the daughter class burdens that method. Trivial example: struct Pai { void imprimir() {…
-
2
votes1
answer54
viewsCan I rename an attribute by creating a table from a type?
Following the Object-Relational model, I want to create the tables or_medico and or_atendente derived from t_funcionario that I created. Below follows the structure of type: DROP TYPE t_funcionario…
-
2
votes1
answer67
viewsInstantiate a class with private attributes
How can I take the attributes of the person class and instantiate them in the medical class and then display it? The doctor and the patient are people and both have class attributes Pessoa. I left…
-
2
votes1
answer69
views -
2
votes1
answer65
viewsPython - Object-Oriented Programming
I created a module with two classes: I want to use both as if the mouse depended on the computer. E.g.: when using them: only when the Computer is turned on does the mouse have permission to turn on…
-
2
votes3
answers104
viewsHow does inheritance work with "Constructor Property Promotion" in PHP 8?
PHP 8 now supports constructor Property Promotion to declare class properties in constructor arguments: class Foo { public function __construct( public $foo, ){} } By making the inheritance by…
-
2
votes0
answers34
viewsAnonymous class receiving a value through a function
Guys, here’s the thing, I just came across a situation that I didn’t quite understand how it works. Some objects such as the components in the Java Swing, or any type of frameworks objects that have…
-
2
votes3
answers112
viewsIn Python how to pass the self between 2 windows using modules
I’m learning Python, version 3.7 with Pyqt5 (Qt Designer) I’m trying to define the value of a label using modules, in window 1 it calls the function and works, but when I open window 2 and click on…
-
2
votes0
answers31
viewsIs it possible to create private methods for Python classes?
In Rust, it is possible to create a module where some methods associated with a struct are private. I understand that the utility of this is to make available to the end user of the module only the…
-
2
votes2
answers63
viewsHow to use split() inside a Java loop?
Good evening, I have been learning Java for a while and wanted to know how I could read a text file that has one or two numbers in a maximum of 10 lines. Something like the files below:…
-
1
votes2
answers4081
viewsHow to create user validation with access levels in codeigniter?
I have this model and control that checks and validates users registered in the table tb_users database. I need a script that checks whether the user is 0 or 1 in the column nv_nivel. If the user is…
-
1
votes4
answers775
viewsStatic service class in web application
I have a class to generate report and another to check e-mail in an application, should leave it as static? The email class is to check the email in a certain period or when the user requests.…
-
1
votes3
answers942
viewsUndefined Reference when compiling multiple files
I’m learning C++, and I have a question about creating classes in different files. I created the header with prototypes of functions, then as member functions in another cpp file. When I go to test…
-
1
votes4
answers1237
viewsAccess config.php variables
I am a beginner in php and I have a problem, I have a config.php file this way: <?php $config['dbHostname'] = 'localhost'; $config['dbUser'] = 'teste'; $config['dbPassword'] = 'passteste'; But I…
-
1
votes1
answer754
viewsHow can I pass a class value to a Listbox
I am involved in a small personal project, composed of some classes and many photons. I need to send a value that is obtained when I access a certain button, to the listbox that is in one of these…
-
1
votes1
answer746
viewsObserver Design Pattern on Android
Someone would have how to show me an Observer structure within android? I was trying to build one like the java, but I was unsuccessful. My test was done as follows: I created a class Banco and a…
-
1
votes4
answers1506
viewsDirect method call in instance
I came across something that doesn’t seem to make sense, when I try to make the method call from a direct object in its instance it doesn’t seem to work. class Pessoa{ private $Nome; private $Idade;…
-
1
votes1
answer516
viewsHow to pass data(string) from a class to Viewcontroller’s Textfield
I want to pass data of a class of the type NSObject to be shown in my TextField Viewcontroller. I tried to use the function prepareForSegue but I couldn’t. Does anyone know how to pass the data,…
-
1
votes2
answers291
viewsError when instantiating an object
When I will instantiate the object Vendedor this error appears: java.lang.NullPointerException at Vendedor.<init>(Vendedor.java:9) I’d like to know what it means and how to fix it?…
-
1
votes3
answers415
viewsAutomatic method execution
I have an x class that needs to run a y method once a day. However, how to do this in Object-Oriented PHP? P.S.: In structured PHP, it used crontab or fcron to program that a given URL was executed…
-
1
votes1
answer20770
viewsCreate Object Array in java and access objects directly
So I need to do the following I have a class with some attributes and methods, I need to generate a array of objects of this class, however I wanted to be able to access them directly, currently…
-
1
votes0
answers127
viewsController mapping for the Domain model
We have the following situations in general, consider objects larger than the example. Situation 1 We may have a request that has all Account parameters;…
-
1
votes1
answer111
viewsHow to use a constructor with two or more classes?
I am developing an object-oriented library. I created an iterator for my future container. I have advance_iterator and regress_iterator. Both give rise to bidirectional_iterator. The code is:…
-
1
votes1
answer824
viewsHow to represent in UML superscript methods
How to represent in the class UML when a method should be overwritten? If it is enough just to repeat the parent class method for the daughter class or there is another way or, who knows, it should…
-
1
votes1
answer60
viewsProblem receiving the return of an object
I created a class to download data from a web service. And I take the following test steps: I instate the download class in viewDidLoad of Viewcontroller and then run the method, as in the code…
-
1
votes0
answers155
viewsWhat is object-oriented programming?
I know that C++ and Java are examples of object-oriented languages. I know that the Std::Cout << "string"; is an object, but I don’t know what object-oriented programming is. What?
-
1
votes2
answers884
viewsHow to call an original function in a php overloaded method
I need to run the parent version of a method overloaded in php, it is possible? Ex.: public function delete() { // executa código extra e depois executa o método original super->delete(); }…
-
1
votes1
answer556
viewsPOO with PHP $_POST
How It Should Be Done for a Super Global $_POST Value To Enter a Class. I’ve tried several ways, but without success. This value will be dealt with within the class.
-
1
votes0
answers375
viewsHow to create graphics in pChart with Object-oriented Connection?
I’m having problems creating my graph in pChart, I’m currently using an object-oriented connection and I’m able to connect to the database but, I’m not able to generate the data for the chart. I get…
-
1
votes1
answer224
viewsData aggregation in PHP and MVC development
Good morning! I am developing a web system and I am having doubts about the organization as a MVC structure. There is a register of companies that already have class/model/control etc. My doubt…
-
1
votes2
answers335
viewsInheritance and manipulation of a superclass’s methods
Inheritance is said to inherit all the methods of a super class. But in doing class Soma{ private double total; public void setSoma(double s1, double s2) { total = s1+s2; } public double getSoma() {…
-
1
votes1
answer98
viewsError trying to select with PHPOO
Well, I’m a beginner in PHPOO and I developed a class with functions to connect to the database (already successful) and another to select (where the error occurs). I will post the code and then…
-
1
votes1
answer652
viewsHow to use a variable within another method of the same class?
How could I use the method define_title() the variable $extension that is within the method file_verify? class Title extends Imoveis { public function file_verify($file) { $file = explode("/",…
-
1
votes1
answer1252
viewsPOO PHP Function Insert into MYSQL
Hello, I’m wanting to do a function to insert the data in the table, is not returning me anything, look at the code: function insertInto ($tabela, $colunas=array(), $valores=array()) { foreach (…
-
1
votes3
answers4033
viewsUndefined reference compiling with g++
I usually use g++ to compile my code, but now that I’ve started learning template I cannot compile for anything, the following error appears: g++ -c pilha.cpp pilha-infinita.cpp g++ pilha.o…
-
1
votes3
answers1096
viewsHow to change a value of a literal Javascript object?
I am trying to change the value of a property in a Javascript object, but in the creation of the object literally, and not constructor. var cliente = { nome: "Wesley", idade: 20, cargo: "Front End",…
-
1
votes1
answer958
viewsError trying rowCount in PHP class
I’m trying to make a rowCount using a class I developed for the connection and some functions involving the bd. I have the following PHP class: class Banco { private $debug; private static $pdo;…
-
1
votes2
answers1268
viewsAdd Date methods using typescript
I’m trying to create a date format method. Something like var minhaData = new Date(); console.log(minhaData.format('[d]/[m]/[Y]')); I searched the internet and managed to develop this excerpt:…
-
1
votes1
answer531
viewsHow to pass objects between controllers in MVC using POO
Basically, I need to be login successful to save the username in a variable and use it in another controller. Model.php: public function login($email, $password) { session_start(); $sql = "SELECT *…
-
1
votes1
answer119
viewsWhat’s wrong with this code?
What is the error of this code? ( ! ) Parse error: syntax error, Unexpected '$obj' (T_VARIABLE), expecting Function (T_FUNCTION) in C: wamp www php index.php on line 53 <?php class Aluga { public…
-
1
votes1
answer1077
viewsWhat is the function of @Override in Java?
Seeing some code or even creating an automatic method I noticed the presence of it @Override. What he really does in the code?
-
1
votes1
answer87
viewsProblem with Allegro 4 and C++
I’m trying to create a game in Allegro 4, but I am having problems with a method, more specifically with an attribute BITMAP. The program compiles but stops working right away. Follow the code:…