codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Follow publication

Why Do You Need To Know Interface Fundamentals? 🔊

Fayner Brack
codeburst
Published in
6 min readAug 3, 2017

--

The picture of a traffic light intersection with many cars going through
Listen to the audio version!
A Code Example with a Car class implementing the Vehicle interface
A Code Example with the Car class not implementing the Vehicle interface method and a compilation error

There is a difference between "interface" in the context of the mechanics of a programming language and "interface" in the context of engineering

A road is an interface that accepts a vehicle — which is also an interface — and affords it to drive through

What a real life object or environment affords another object to do can be specified in the form of an "interface"

A Code Example with the HTML structure of the tabs in a movie description page
A Code Example for the tabs container controller
A Code Example for the tab controller
tabsController.register(currentTabController);
register: (tab) => {
registeredTabs.push(tab);
},
register: (tabController) => {
registeredTabs.push(tabController);
},
register: (tab) => {
registeredTabs.push(tab);
if (index === 0) {
tab.activate();
}

--

--

Published in codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Written by Fayner Brack

I believe ideas should be open and free (as in Freedom). This is a non-profit initiative to write about challenging stuff you won’t find anywhere else.

Responses (5)