Member-only story

Interface Segregation Principle in Python

Object Oriented Programming Principles for Data Scientists

Erdem Isbilen
3 min readMar 9, 2023
Photo by Kelly Sikkema on Unsplash

What is Interface Segregation Principle (ISP)?

The basic idea behind the ISP is that clients (the code that uses an interface) should not be forced to depend on methods that they don’t use. It suggests that you should split interfaces that are too large and contain too many methods into smaller and more specific interfaces.

By splitting interfaces into smaller, more specific interfaces, you can ensure that clients only depend on the methods they need. This can make your code more modular, easier to understand, and easier to maintain over time.

Why is It Important for Data Scientists?

ISP makes it easier to reuse code across different projects or applications. By creating smaller and more specific interfaces, data scientists can create libraries or modules that can be easily integrated into different projects, without forcing clients to depend on unnecessary methods.

Reduces coupling: ISP reduces the number of methods that clients depend on, which can help to reduce coupling between different components of a software system.

--

--

Erdem Isbilen
Erdem Isbilen

Written by Erdem Isbilen

Machine Learning and Data Science Enthusiasts, Automotive Engineer, Mechanical Engineer, https://www.linkedin.com/in/erdem-isbilen/

No responses yet