Ivan Polovyi
Aug 8, 2022

--

I think it doesn't violate the open-closed principle. Because the functions are static and these functions do not make part of an interface contract. I can easily extract these functions into another class let's say CardUtils; this move won't break the code, only in places where I use the functions, but not the implementations. I've added those two functions to the interface more for convenience to keep things in the same place. But of course, this is my opinion and I assume that it can be wrong. Thank you for your question.

--

--

Ivan Polovyi
Ivan Polovyi

Written by Ivan Polovyi

I am a Java Developer | OCA Java EE 8 | Spring Professional | AWS CDA | CKA | DCA | Oracle DB CA. I started programming at age 34 and still learning.

Responses (1)