Monday, May 6, 2024
HomeGolangInterface Design Issues Ep. 7

Interface Design Issues Ep. 7


Introduction

In episode 6, Miki constructed a logger package deal with the goal of constructing it as versatile as doable. To realize this, he constructed his logger object with a operate that may: settle for the io.Author interface as a parameter and carry out sort assertions to retrieve different interface varieties as wanted. By constructing this, Miki demonstrated how polymorphism is achieved with Go by altering the kind of a variable with sort assertions.

On this video, Miki will shift his consideration in direction of the speculation facet of programming and provides a lecture on interface design. The primary concept he’ll introduce is that interfaces state what want, not what we offer. To construct on this concept, Miki will give an in depth overview of Go’s io.Copy operate, its meant use and the way the operate states that it must have a variable to learn from and one other to jot down to. The following concept he’ll suggest is that if an interface has greater than 5 capabilities, one thing could also be fallacious, which will be strongly correlated to the Go proverb the larger the interface, the weaker the abstraction. Watch and study extra about Go interfaces and the design concerns to bear in mind when writing one.

Issues you’ll study on this video

  • Standards to find out the effectiveness of an interface.
  • Fast overview of Go’s io.Reader and io.Author interfaces.

Video



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments