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 do 9 different interfaces for all methods and 9 classes to implement these interfaces if I always use all 9 methods after creating an instance?
Interface segregation principle and single responsibility principle
160 Views Asked by Szyszka947 At
1
There are 1 best solutions below
Related Questions in SOLID-PRINCIPLES
- SOLID principles: extract code in superclass
- How to relate canvas drawing objects with canvas controller objects in flutter (in SOLID correspondence)?
- How to Implement Dependency Inversion and Interface Segregation for a Concrete Class that Needs to Be Initiated?
- Liskov Substitution Principle: Confusion about additional Functionalities of sub types
- Is Dependency Inversion Necessary to Ensure Decoupling between Caller and Callee?
- How should i apply SOLID principles for an entity which have two types, one editable and the other uneditable
- Clarification on Single Responsibility Principle: Actor vs. Responsibility
- Where to instantiate my classes and still adhere to SRP
- Applying OOP principles to microservices
- Separating data structures from algorithms in Go
- One DAO per entity vs multiple DAO's per entity
- Breaking up methods leading to more operations
- Entities can move from one use case to another using the controller?
- Does dependency injection make sense for "pass by value" types? Is there a difference in DI for Value Types and Reference Types
- SwiftUI using Enum across module
Related Questions in SINGLE-RESPONSIBILITY-PRINCIPLE
- Clarification on Single Responsibility Principle: Actor vs. Responsibility
- Where to instantiate my classes and still adhere to SRP
- Which is lighter in Flutter: GestureDetector or TextButton?
- Filtering inside a processing method vs. filtering outside
- Responsiveness in different monitors
- Does DI Encourage or Enforce SRP?
- Applying Clean Architecture Principle When Add Dashboard module witch query multiple services from Application Layer
- How to properly build rich domain models
- Do getter and setter methods violate the Single Responsibilty Principle
- Automatic MapStruct conversion within @Repository
- How to generate srp_a for USER_SRP_AUTH flow in cognito (nodejs). Not a single correct way present over entire internet
- Is it possible to avoid using the singleton pattern in my CartManager class for an online shop by using dependency injection?
- In MVVM with Clean Architecture, where is the best place to put the variables that will be used in many places in the project?
- What am I missing in my CRC (Class Responsibility Collaborator) Model?
- Does calling a method of the different class using switch violate Single Responsibility Principle?
Related Questions in INTERFACE-SEGREGATION-PRINCIPLE
- How to Implement Dependency Inversion and Interface Segregation for a Concrete Class that Needs to Be Initiated?
- Is this UML diagram violating the Interface Segregation Principle?
- How can I provide access only for some methods from service in angular?
- How to keep the interface segregation principle while using the state design pattern?
- Class adapter pattern in the classic TimedDoor case study
- Interface Segregation Principle - Multiple Client Apps
- Applying correctly interface segregation principle in my UML diagram
- In SOLID, is it possible to break SRP without breaking ISP or viceversa?
- Advantage of Using Interface in production application
- Interface segregation principle and single responsibility principle
- How can I solve this Interface Segregation Principle Violation
- Short Interface implementation in kotlin
- Trying to program to abstractions in C# but neither interfaces nor classes really work
- What exactly is a "client" in the interface segregation principle (ISP)?
- Does the composite design patterm adhere the principles of SOLID (spacialy the L and the I)?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
If you would use all or most of these nine methods in every use case, then it is clear that you do not need interface segregation.
However, the reason you are even asking this is probably that having nine methods appear too much. This may be the case and it sounds like perhaps you need some refactoring, but no one can tell you that without studying your code.