Questions tagged as 'interface'

3
answers

Use interfaces to abstract connection type

In college we learn to use the FACTORY template for connections, but I wonder if it is possible to apply interfaces as well, as in the following example: Case study I have an application in php that follows as closely as possible th...
asked by 26.11.2015 / 11:18
1
answer

Delphi class with optional integer field

The question is: how should I build my TPESSOA class so that the _id_city field can be null. Database Create Table PESSOA ( ID INTEGER NOT NULL, NOME VARCHAR(100) NOT NULL, ID_CIDADE INTEGER) No Dephi TPESSOA = Class(TRemotable)...
asked by 03.11.2015 / 12:23
1
answer

Is it a good idea to use interfaces to specify which magic methods a class will implement?

I've seen some PHP code that, to check if a class has the __toString method, the method_exists function is used. Example: if (method_exists($object, '__toString')) echo $object; On the other hand, I have seen interfaces tha...
asked by 10.09.2015 / 17:42
0
answers

Device gives error and then restarts after trying to uninstall application

I'm having a bug with the application I created, the code is compiling normal and no error or warning , and the application is also working on the phone, but when I try to uninstall this application from I get the following message:    "The...
asked by 15.10.2015 / 07:07
2
answers

Instantiate an object through the interface and access methods not present in it

I have the following interface: interface something { void doSomething(); } And I have a class that implements this interface and adds another method that does not contain the interface: public class Whatever implements something {...
asked by 26.01.2017 / 00:30
2
answers

Is there a way to implement an interface in a class of a DLL that I can only read?

I'm using a DLL that has several classes. I would like to dynamically implement interfaces for these classes, so that I can perform unit tests by doing mock of them. Is there any way to do this? Example: The DLL has a class Comunic...
asked by 03.11.2017 / 13:29
1
answer

How important is the interface in this particular code?

If we put the functions of the interface, also inside the class, so we can create interface? Example: Interface interface Teste { function olaMundo($texto); } Class class Testando implements Teste { function olaMundo($texto)...
asked by 10.07.2017 / 18:37
2
answers

Send parameters to a C #

I created a class called descricaoo that will receive some data parameters and will add in a List of an interface called IInstrucao . But it gives an error "the description class is not implemented to an interface" How to cor...
asked by 29.10.2015 / 16:33
1
answer

Should I use abstract class or interface?

I have a class that connects to Windows machines. I'm leaving it a bit more generic, so I can reuse it for other systems. I was able to identify four "generic" methods: connect status error message run With this, I put together a...
asked by 19.11.2016 / 18:23
1
answer

Error in multiplication and division (java)

I'm having trouble implementing multiplication and division on my calculator with graphical interface. Regardless of anything I put using any of the operators (/ and *), the output result is 0. Sum and subtraction are working normally....
asked by 20.05.2015 / 03:44