Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Whats an interface ^^?

0
Posted

Whats an interface ^^?

0

I’m assuming you’re referring to interfaces as described in the first link below. That is quite a useful link. You are vaguely right but not quite. It’s quite a complex subject to try to describe in a few words but there are many advantages to using interfaces. I’d suggest you read a bit more about Object oriented programming including inheritance and polymorphism. It’s also useful to read about the “dependency inversion principle” where we use interfaces to reduce the coupling between classes. The article in the second link below, although written about C++, is still applicable to PHP and gives an idea of how we can make software designs more flexible and extensible by using interfaces (note that C++ doesn’t have the “interface” keyword; in C++ interfaces are defined using an abstract class i.e., one with only pure virtual functions. In simple terms though, an interface provides the specification of how one class (let’s say the client) interacts with another ‘class’ (let’s say the ser

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123