Questions tagged [coupling]

197 questions
3
votes
1 answer

Coupling in microservices architecture

When working on an application in microservices architecture I stumbled upon issues concerning coupling between services. This a typical application for ordering products. It seams reasonable to have a service that will operate as a product catalog.…
dhclaw
  • 63
  • 6
3
votes
1 answer

Low coupling and tight cohesion

Of course it depends on the situation. But when a lower level object or system communicate with an higher level system, should callbacks or events be preferred to keeping a pointer to the higher level object? For example, if we are working on a…
hidayat
  • 9,493
  • 13
  • 51
  • 66
3
votes
4 answers

Coupling in OO design

I have two objects. A Meeting object and an Action object (action raised in a meeting). An Action can also exist independent of a Meeting. I have two ways of linking the Action raised to the Meeting: have a method on Meeting where I pass in the…
poulenc
  • 81
  • 2
3
votes
2 answers

Redux actions depending on/coupled to other actions

I am building a Redux application (my first) and am a little unclear about how much coupling is appropriate between actions. My application has several forms whose values are serialized in the url. For example, there is an input field for a…
Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
3
votes
4 answers

Advice on designing loosely-coupled complete systems?

How does one design loosely-coupled systems which may often require data from each-other but don't necessarily belong in the same category? For instance, lets take the old Pet-shop example one-step further and create a pet-store franchise. Each…
Phillip B Oldham
  • 18,807
  • 20
  • 94
  • 134
3
votes
1 answer

Getting rid of Entity factory by tightly coupling its Value Objects

I'm having my User entity value objects loosely coupled, and because of that I use a UserFactory to build the object whenever it comes from the database or when creating a entirely new entity to the domain. Would it be okay to tightly couple the…
Kid Diamond
  • 2,232
  • 8
  • 37
  • 79
3
votes
2 answers

Coupling between controller and view

The litmus test for me for a good MVC implementation is how easy it is to swap out the view. I've always done this really badly due to being lazy but now I want to do it right. This is in C++ but it should apply equally to non-desktop applications,…
Sohail
  • 3,020
  • 1
  • 25
  • 23
3
votes
4 answers

Design Question - OO food application

Say I have a number of usercontrols, each usercontrol inside a tabitem, inside a window. For example, let say this is a food collection application. Then we have tabs Fruit, Vegetables and Snacks. Each tab will show a list of food of that subject,…
baron
  • 11,011
  • 20
  • 54
  • 88
3
votes
2 answers

Remove coupling and then mock for unit test

This is a dilemma. Say we have two classes Class A { public int memberValue; } interface IB { int fun(); } Class B : IB { public int fun() { var a = new A(); switch(a.memberValue) { case 1: …
dushyantp
  • 4,398
  • 7
  • 37
  • 59
3
votes
4 answers

Unit testing: how to test methods with a lot of underlying objects and business logic

I am really new to unit testing, and I can't figure out the proper way to do it for my case, though I spent crazy amount of time on research. My code base is huge (~3 years of work), very coupled unfortunately, hard to test and no unit testing has…
Claudiu
  • 43
  • 7
3
votes
5 answers

Removing tightly coupled code

Forgive me if this is a dupe but I couldn't find anything that hit this exact question. I'm working with a legacy application that is very tightly coupled. We are pulling out some of the major functionality because we will be getting that…
Gren
  • 573
  • 2
  • 9
3
votes
3 answers

Which pattern has lower coupling in java: passing objects to a method or using composition?

//Ex1: (passing by object) class A { } class B { void foo(A a) { } } //Ex2: (composition) class C { A a void foo(){ } } My question is: which pattern has lower coupling? And…
user188276
2
votes
2 answers

Does GRASP Creator really decouples?

I'm learning GRASP pattern at school and I have a question about the Creator pattern. Let's say you have three class, Computer, UserRespository and User. One of the rules of the GRASP Creator pattern tells you to assign the responsibility of…
subb
  • 1,578
  • 1
  • 15
  • 27
2
votes
1 answer

Tools for measuring coupling and cohesion

Do you know of any tools that help us measure coupling and cohesion in the system?
noobcoder
  • 23
  • 1
  • 3
2
votes
2 answers

Benefits of not passing entities to view

I usually see people telling that you should not pass entities to your View. They say you should use a DTO/VO/ViewModel/AnyOtherThingYouWant instead, as using an entity would increase the coupling. Ignoring the moments where I do need some extra…
user135323