Questions tagged [coupling]

197 questions
4
votes
3 answers

Coupling between public functions

Lets say I have a function called do3() In order for that function to work I need the functions do1() and do2() be executed. However, do1() and do2() could also be needed for other stuff (maybe for do4()) All these functions are public (and must be…
Juan Antonio Gomez Moriano
  • 13,103
  • 10
  • 47
  • 65
4
votes
5 answers

auto-instantiated smart pointer

I am looking for a simple way to reduce header coupling in a C++ project, which comes mostly due to (overused) class composition which of course requires complete type. For example: // header A class A { B b; // requires header B }; I have also…
Roman L
  • 3,006
  • 25
  • 37
4
votes
3 answers

Cohesion and Coupling - How does one determine the threshold?

I'm taking further intro java classes at the moment and this is how the class briefly defined this: Cohesion: Aim for high cohesion, in this case cohesion meaning that a single module is tightly focused on its task. Coupling: Aim for low coupling,…
simmonson
  • 137
  • 1
  • 9
4
votes
2 answers

dependency injection with akka.net

How does one build loose coupling to akka.net? Assume I have an MVC application that uses Akka.net and that I want to be able to test the controllers in the MVC app without using a real actor system. Kind of like when you want to test a business…
cfcal
  • 161
  • 6
4
votes
2 answers

Too high coupling or okay to design like this?

Let's say I have a classA, that has its own methods with its own private fields and what have you(bascically adhere to encapsulation standards). Then I have classB, that needs for its execution the final state(that is obtained through one of the…
The Law
  • 344
  • 3
  • 20
4
votes
1 answer

How the interface can be used in communication between modules of component diagram?

Complexity of the interface is another factor affecting coupling. The more complex each interface is, the higher will be the degree of coupling The above quoted sentence is from A concise introduction to Software Engineering ,Chapter 6:…
user2019510
  • 1,460
  • 5
  • 16
  • 29
4
votes
0 answers

Decreasing coupling and cohesion by facade pattern

For my Software Design class, I have to find out if it is possible to decrease coupling and decrease cohesion at the same time by using the Facade pattern? As you all probably know, when there is low coupling, the cohesion of the classes is high and…
4
votes
1 answer

Strategy pattern: coupled strategy vs uncoupled strategy

What´s the difference between a coupled strategy and an uncoupled strategy? Thanks for answering.
MQSJ23
  • 107
  • 2
  • 2
  • 6
4
votes
3 answers

How to test anonymous classes?

I believe you must be familiar with this idiom, which is sort of java's excuse for closures //In the "Resource Manager" class public void process(Command cmd){ //Initialize ExpensiveResource resource = new ExpensiveResource(); //Use …
Pablo Fernandez
  • 103,170
  • 56
  • 192
  • 232
4
votes
1 answer

struts action class and business service layer

I have a question in handling the "business validation" done on the service layer. The code belows shows a typical account fund transfer example, which validates for sufficient fund, transfer amount is lesser than defined limit. In this example,…
ilovetolearn
  • 2,006
  • 5
  • 33
  • 64
3
votes
5 answers

MATLAB and the use of global variables?

I am writing a tool for dicom images and spectroscopy and there is a lot of shared data I want to use between the functions I am making. I have GUI that I made and the different sliders and buttons use a lot of this shared data from the dicom…
Ben Fossen
  • 997
  • 6
  • 22
  • 48
3
votes
3 answers

Integrating Bundles (Related Doctrine 2 Entities) in Symfony 2 and Coupling

As I understand, Bundles is to separate functionality. Suppose I have a UserBundle & a BlogBundle. Then my BlogBundle:Post will have an author field that references UserBundle:User. Doesn't that defeats the purpose of Bundles? I cant swap another…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
3
votes
1 answer

Reducing Decoupling in VBA Object Event Wrapper

tl;dr Is there a way to enable events for built-in objects without coupling the event to the original object's parent, assuming the event interacts with the parent? Disclaimer 1: I don't have access to MS Office on my home machine and therefore type…
Vince
  • 467
  • 3
  • 8
3
votes
8 answers

Class design: change text on button click

I have 2 classes for the game I am making: a gui class and the logic class, for a game of noughts and crosses. The GUI class has a method that uses an array of JButtons and returns them all with the same anonymous inner class action listener. When I…
Roberto Duran
3
votes
0 answers

Is there a PHP linter that can restrict class imports based on custom boundary rules?

We have a monorepo that includes our old monolith as well as our new modules. (We don't want separate repos...yet) src/Monolith/... src/OrderModule/... src/PaymentModule/... We obviously don't want our new modules coupled to the monolith. We also…
Matt Janssen
  • 1,505
  • 13
  • 14
1 2
3
13 14