Questions tagged as 'interface'

1
answer

When declaring an interface in the class, who should implement it?

class Gerente extends Funcionario implements Autenticavel { It means that Gerente implements the interface Autenticavel , or Funcionario that will implement the interface?     
asked by 09.09.2016 / 17:17
3
answers

Applying interface in Controllers

I have some controllers that call their respective models and would like to interface on them. I created an interface with some methods that would be important for everyone to implement, as follows: public interface IController<E> {...
asked by 23.03.2016 / 13:25
2
answers

Using interfaces for domain classes

Is it a good practice to make use of interfaces for domain class? Do I have an advantage doing this? If so, which one? Example: public interface IAuditoria { long AuditoriaID { get; set; } string Descricao { get; set; } string S...
asked by 25.07.2018 / 19:14
2
answers

How to implement classes with private method?

I am rewriting the code of an application looking for the best use of the interfaces and I came across a problem: I have a class that needs to have a private method and I want to create an interface for it, since I have other classes that do...
asked by 13.07.2016 / 16:09
2
answers

What is the interface for Countable in PHP?

I saw a certain class whose declaration was this way: class Collection implements Countable {} I noticed that she was implementing Countable , but I did not understand what that implementation was doing there. What is the purpose o...
asked by 07.10.2016 / 20:09
2
answers

How to implement an interface to guarantee a specific contract?

I need to make an interface implement a list of a certain type: public class ITrade<T> { public int date { get; set; } public double price { get; set; } public double amount { get; set; } public string type { get; set; }...
asked by 01.04.2018 / 20:47
2
answers

What is the real usefulness of Interface in PHP?

I know that interface is used as a common standard. But I do not think it's useful. So what's the use of creating an interface that knows its name? I have to code each of them in the class that is implementing the interface. What is th...
asked by 01.09.2018 / 13:00
1
answer

Interface that defines the generic signature of the methods to be implemented

I have three classes: Request Repository RepositoryMotorist RepositoryTravel All have the following methods with the exception of RepositorioTravel which does not have the "Change". The Object can refer to the Driver, Applicant, and T...
asked by 28.11.2016 / 18:22
1
answer

When I have in Fragment a reference through getActivity () should I use interface?

My question is how best to work for the organization of the methods, I will present 2 implementation options that I am in doubt, whenever I have in Fragment a reference through getActivity () should I use interface? : 1st choice: I'm dec...
asked by 19.10.2014 / 12:14
1
answer

Android Studio locked [closed]

My android studio IDE does not work right, whenever I try to drag some element into the interface it hangs and it just does not respond anymore. The same happens when trying to create fragments through the interface, I have to do everything by c...
asked by 29.07.2018 / 04:27