Questions tagged as 'classes'

2
answers

Get property values from a class

I have the following codes: private PropertyInfo[] ObterPropriedades(Type classe) { PropertyInfo[] properties = classe.GetProperties(); return properties; } private string[] ObterValoresPropriedades(Type classe) { List<string>...
asked by 22.12.2014 / 18:01
4
answers

In inheritance with private attributes, does not the child class take its attributes from the parent class?

The devmedia article says that the private modifier does not give access to their attributes in their daughter classes. It has a table with the modifiers. In inheritance with private attributes, does not the child class take its attr...
asked by 15.01.2016 / 19:10
2
answers

Differences when instantiating a class

Using PHP when instantiating an object I do it as follows: $obj = NEW my_class_exemplo; however the auto complete of netbeans always gives me the option to put with parenthesis like this: $obj = NEW my_class_exemplo(); Question...
asked by 22.01.2014 / 23:33
1
answer

What is the purpose of __slots__?

What is this __slots__ property for? in the documentation something about "wasted space", but at the end of the accounts I did not quite understand the purpose of using __slots__ . What is it for and when should I use it?...
asked by 11.01.2017 / 15:54
2
answers

Is it wrong to have a class with methods only?

Is it wrong to have a class with methods only? Or would it be better to use namespaces to save functions?     
asked by 05.05.2018 / 00:36
3
answers

In structures (struct) is it necessary to use getters and setters or only in classes (class)?

Is it necessary to use setters and getters in structures to maintain good practices or is it only necessary in classes?     
asked by 13.12.2017 / 23:28
2
answers

How to model plots when you do not know how many?

Typically, when it comes to installment payments, you get the idea of 12 installments. So you soon create a table with 12 fields, one for each parcel. But I am faced with the situation where the customer is a consumer of continuous service...
asked by 18.09.2015 / 16:55
1
answer

What is the difference between Classes and Interfaces?

What is the difference between classes and interfaces ? I've read that apparently the difference in interfaces is because they are 100% public, but I have no idea. Could anyone explain the difference between them?     
asked by 28.02.2016 / 20:57
3
answers

How to sort sql queries in the RUBY on Rails model?

I have the following method an ROR application. query_student = "SELECT name, registration, room FROM students WHERE registration = "+ params[:registration]+" AND password = "+params[:password] @student = ActiveRecord::Base.connection.exe...
asked by 19.08.2016 / 19:56
1
answer

What is the elegant way to read this PHP Object?

I have Result of a Webservice below, I'm doing some foreachs to read each level of the class, but I think you should have a more elegant way of reading and getting the values of the object, follow Result : stdClass Object (...
asked by 29.01.2016 / 12:58