Questions tagged [coupling]

156 questions
169
votes
9 answers

I changed one method signature and now have over 25,000 errors. What now?

I started a new job recently where I am working on a very large application (15M loc). In my previous job we had a similarly large application but (for better or for worse) we used OSGi, which meant the application was broken down into lots of…
user788497
  • 1,321
54
votes
5 answers

Where should you put constants and why?

In our mostly large applications, we usually have a only few locations for "constants": One class for GUI and internal contstants (Tab Page titles, Group Box titles, calculation factors, enumerations) One class for database tables and columns (this…
52
votes
11 answers

How do I avoid cascading refactorings?

I've got a project. In this project I wished to refactor it to add a feature, and I refactored the project to add the feature. The problem is that when I was done, it turned out that I needed to make a minor interface change to accommodate it. So I…
DeadMG
  • 36,914
46
votes
6 answers

Why is "tight coupling between functions and data" bad?

I found this quote in "The Joy of Clojure" on p. 32, but someone said the same thing to me over dinner last week and I've heard it other places as well: [A] downside to object-oriented programming is the tight coupling between function and…
34
votes
3 answers

How does dependecy injection increase coupling?

On the Wikipedia page on dependency injection, the disadvantages section tells us this: Dependency injection increases coupling by requiring the user of a subsystem to provide for the needs of that subsystem. with a link to an article against…
BЈовић
  • 14,049
29
votes
9 answers

In software design, should an application remain agnostic regarding its usage with real world data / mock data?

Let me try to summarize a bit more with a simple example: You're building a large application, a user portal for example, with feeds, news, account management, and a whole range of difference features. During development it's decided you need to…
28
votes
5 answers

I'm not seeing 'tightly coupled code' as one of the drawbacks of a monolithic application architecture

One of the most common things I see when discussing pros/cons of microservice vs monolithic architecture is that monolithic applications have, or always trend toward, 'tight coupling.' To be honest, I'm not seeing why this is true if your developers…
28
votes
9 answers

Coupling: Theory vs Reality

Coupling is defined as the knowledge one object has about another one, which describes how dependent they are. The more dependent, the worse, since changes in one would impact in the second. High coupling is bad, low coupling good. There are…
23
votes
3 answers

How to decouple UI from logic on Pyqt/Qt apps properly?

I've read quite a lot about this subject in the past and watched some interesting talks like this one from Uncle Bob's. Still, I always find pretty difficult to architect properly my desktop applications and distinguish which should be the…
BPL
  • 465
23
votes
5 answers

Why would a type be coupled with its builder?

I've recently deleted a java answer of mine on Code Review, that started like this: private Person(PersonBuilder builder) { Stop. Red flag. A PersonBuilder would build a Person; it knows about a Person. The Person class shouldn't know anything…
23
votes
3 answers

Unit testing behaviours without coupling to implementation details

In his talk TDD, where did it all go wrong, Ian Cooper pushes Kent Beck's original intention behind unit testing in TDD (to test behaviours, not methods of classes specifically) and argues for avoiding coupling the tests to the implementation. In…
Andy Hunt
  • 6,046
19
votes
4 answers

Event-driven programming: when is it worth it?

Ok, I know the title of this question is almost identical to When should I use event based programming? but the answers of said question have not helped me in deciding whether I should use events in the particular case I'm facing. I'm developing a…
abl
  • 471
  • 3
  • 12
19
votes
3 answers

UML: Queue processor in a sequence diagram

Which is the appropriate way of representing a queue processor in a UML sequence diagram? I want to represent in the same diagram two systems that are loosely coupled through a queue. The first system, performs some actions and insert an action in a…
19
votes
3 answers

Does decoupling trump DRY in REST?

I am building a REST API to expose most of functionality of an existing Java API. Both APIs are for internal use within my organization; I do not have to design for external use. I have influence over both APIs but am implementing the REST one. …
Will
  • 712
18
votes
9 answers

Is coupling with strings "looser" than with class methods?

I'm starting a school group project in Java, using Swing. It's a straightforward GUI on Database desktop app. The professor gave us the code from last year's project so we could see how he does things. My initial impression is that the code is far…
Philip
  • 682
1
2 3
10 11