60 questions
1
vote
2
answers
45
views
Does multiple data processing violate the principle of interface separation?
I have the code.
@startuml
interface DbReader{
{abstract} read()
}
interface DbWriter{
{abstract} write(obj)
}
class DbConcrete {
read()
write(obj)
}
DbConcrete .up.|> DbReader
DbConcrete .up.|...
2
votes
2
answers
85
views
Question about interface segregation of a repository, when my services are interested only in one or 2 methods on the repository
I am wondering what can be the potential benefit if I start to split the interface of my repository which has GET/CREATE/DELETE/UPDATE methods
and in one service I have like 10 entities
which per each ...
1
vote
2
answers
230
views
Is this UML diagram violating the Interface Segregation Principle?
I have created this UML diagram which applies the Template method design pattern:
Both concrete classes share a lot of the logic whithin the template methods createTask and completeTask, with small ...
3
votes
0
answers
75
views
How to keep the interface segregation principle while using the state design pattern?
In a previous question on StackOverflow, I asked about preventing the Context class within a State design pattern from having too many responsibilities, and I received an answer on that (moving it all ...
0
votes
0
answers
18
views
Interface Segregation Principle - Multiple Client Apps
I’m developing a shared library and using Interface Segregation.
There will be multiple client apps using this library and I was wondering about how to name each interface.
Some apps will share ...
0
votes
0
answers
80
views
In SOLID, is it possible to break SRP without breaking ISP or viceversa?
I understand more or less the difference between them, with SRP telling that a class should only have one responsability, while ISP is more kind of looking from the client of a class point of view, ...
0
votes
1
answer
186
views
Interface segregation principle and single responsibility principle
I have an interface with 9 methods each doing something different but in one context. That is, when I use dependency injection on this interface, all 9 methods are used in one specific scope. Should I ...
0
votes
0
answers
83
views
Short Interface implementation in kotlin
Now
in kotlin we have a possibility to implement the interface like this:
interface AnimalStrategy {
fun eat(): Outcome
}
Want to have
Question: Is it possible to declare the interface in kotlin in ...
2
votes
2
answers
875
views
What exactly is a "client" in the interface segregation principle (ISP)?
This is one of a number of things that's been bugging me for a while and for which quibbling over the correct interpretation of this has been leading me in a number of attempted coding projects to ...
0
votes
1
answer
116
views
Does "Accept Interfaces" break deprecation tooling?
Deprecation
The supported way of marking functions as deprecated is something like this:
type MyStruct struct {
}
// MyFunc returns hello
// Deprecated: Use YourFunc
func (m MyStruct) MyFunc() string ...
0
votes
2
answers
806
views
Cast EF6 and EFCore Entity to a single Interface?
Is it possible to join different version of Entity Framework (Core) Entities from two applications based on EF 6 (with .NetFramework 4.0) and EF Core 5.0 (.Net Standard 2.1) with the same DataBase ...
0
votes
1
answer
221
views
does default interface violate the Interface Segregation Principle? [duplicate]
in this question the author gives some reasons about why the default keyword is introduced into java language. One reason provided is to support the optional method.
However, taking ISP into ...
0
votes
1
answer
98
views
How to build stuff objects using the decorator pattern?
I have some questions regarding the decorator pattern. As I have understood it, the decorator pattern exists to add behaviour to an object, ie "decorating the object" so you can compose ...
0
votes
1
answer
36
views
Should I seperate test functions which throw error from test interface?
I am new at JUnit. I try to write unit test of a simple service class which is "ProductService".
Here is my test codes for "ProductService"
public interface TestProductService {
...
2
votes
1
answer
283
views
Simulate private interfaces in java 8
I'm having an issue regarding the simulation of public interfaces in java 8.
I have this interface with this methods right now:
public interface A<T> {
void method1(T t) throws ...
3
votes
1
answer
1k
views
Liskov substitution principle VS Interface Segregation principle
I have some troubles with understanding these two principles. This is a bit long-read-question, so be patient.
Lets assume that we have a class
abstract class Shape {
abstract void onDraw();
}
...
4
votes
1
answer
404
views
How do I implement the Interface Segregation Principle using smart pointers in C++?
I come from a Delphi and C# background so I understand interfaces from their perspectives. I have been doing C++ for a few years and still learning interfaces from its perspective.
In my application ...
34
votes
3
answers
15k
views
The difference between liskov substitution principle and interface segregation principle
Is there any core difference between Liskov Substitution Principle (LSP) and Interface Segregation Principle (ISP)? Ultimately, both are vouching for designing the interface with common ...
7
votes
4
answers
1k
views
Interface Segregation Principle and default methods in Java 8
As per the Interface Segregation Principle
clients should not be forced to implement the unwanted methods of an interface
...and so we should define interfaces to have logical separation.
But ...
2
votes
2
answers
88
views
Interface Segregation Principle and Convenience/Helper Methods
How does the Interface Segregation Principle apply to convenience/helper methods? For instance:
I want to create an interface that represents business partners. The bare minimum that I would need ...
6
votes
6
answers
2k
views
Interface segregation and single responsibility principle woes
I'm trying to follow the Interface Segregation and Single Responsibility principles however I'm getting confused as to how to bring it all together.
Here I have an example of a few interfaces I have ...
1
vote
1
answer
401
views
Opposite of Interface Segregation Principle
I was asked today in a interview what is the Interface Segregation Principle and what is the opposite case or principle to this one.
The ISP is clear for me but I don't know the second part of the ...
2
votes
3
answers
1k
views
I want to follow the interface segregation principle but the class is closed. Is a wrapper the right way?
More than a few times I've found my self working with a class that is closed (I can't modify it) that I wish implemented a nice narrow interface particular to my needs. My client code is supposed to ...
4
votes
1
answer
374
views
Confusing use of Adapter pattern in java.awt.event package and violation of Interface Segregation Principle ( ISP )
The usage of Adapter patttern in the java.awt.event package looks confusing to me. On the first hand it seems a clear violation of Interface Segregation Principle ( ISP ).
Like the ...
7
votes
2
answers
2k
views
Inheritance and Interface segregation principle
Does inheritance from a class with unused methods violates the interface segregation principle?
For example:
abstract class Base
{
public void Receive(int n)
{
// . . . (some ...