Questions tagged [dependencies]

A dependency exists between two elements if changes to the definition of one element may cause changes to the other.

A dependency exists between two elements if changes to the definition of one element may cause changes to the other.

To quote from the 3rd edition of UML Distilled:

An element C (the client) depends on an element S (the supplier) if and only if changes to the definition of S may cause changes to C.

If the elements are classes, only the direct cause for change (i.e. not through a ripple effect) is called a dependency, i.e. the relation is not transitive.

For packages, C depends on S if a class in C depends on a class in S. Sometimes, the transitive closure is taken, i.e. the dependency of C on a package T can be caused by C depending on S depending on T via class dependencies.

References:

  1. Understanding Dependencies
  2. What is the difference between dependency and association?
11076 questions
129
votes
5 answers

Maven: how to override the dependency added by a library

Here's my generic problem: My project P depends on A which depends on B which depends on C which depends on version 1.0.1 of D. There's a problem with version 1.0.1 of D and I want to force the use of another module. I don't know how to declare…
wishihadabettername
  • 12,253
  • 20
  • 58
  • 83
124
votes
3 answers

What is the difference between "pom" type dependency with scope "import" and without "import"?

Starting from Maven 2.0.9 there is possibility to include pom import in the section. As I understand it, it will be "replaced" with dependencies included in this pom as if they were originally…
grafthez
  • 3,501
  • 4
  • 22
  • 41
123
votes
11 answers

What is Dependency Injection and Inversion of Control in Spring Framework?

"Dependency Injection" and "Inversion of Control" are often mentioned as the primary advantages of using the Spring framework for developing Web frameworks Could anyone explain what it is in very simple terms with an example if possible?
Chillax
  • 3,514
  • 17
  • 49
  • 76
123
votes
4 answers

HintPath vs ReferencePath in Visual Studio

What exactly is the difference between the HintPath in a .csproj file and the ReferencePath in a .csproj.user file? We're trying to commit to a convention where dependency DLLs are in a "releases" svn repo and all projects point to a particular…
toasteroven
  • 2,430
  • 3
  • 23
  • 30
119
votes
2 answers

Different dependencies for different build profiles

Is it possible to have a different set of dependencies in a maven pom.xml file for different profiles? e.g. mvn -P debug mvn -P release I'd like to pick up a different dependency jar file in one profile that has the same class names and different…
izb
  • 45,586
  • 39
  • 110
  • 165
118
votes
10 answers

How do I tell CPAN to install all dependencies?

How do I tell CPAN to install all dependencies? I tried setting these in cpan: cpan> o conf prerequisites_policy follow cpan> o conf commit I still had to answer "y" a couple of times (but fewer than before it feels like). Is there a way to get it…
Nifle
  • 11,285
  • 9
  • 70
  • 93
114
votes
12 answers

How do I determine the dependencies of a .NET application?

How do I determine the dependencies of a .NET application? Does Dependency Walker work with managed apps? I've downloaded the latest and tried profiling the app, but it just exits without much of an explanation. If it doesn't work with .NET, then is…
Brian Stewart
  • 8,647
  • 11
  • 49
  • 65
114
votes
8 answers

Which maven dependencies to include for spring 3.0?

I am trying to do my first project with Spring 3.0 (and maven). I have been using Spring 2.5 (and primer versions) in quite some projects. Nevertheless I am kinda confused, what modules I have to define as dependencies in my pom.xml. I just want to…
Nils Schmidt
  • 3,674
  • 6
  • 21
  • 28
112
votes
9 answers

How to handle dependency injection in a WPF/MVVM application

I am starting a new desktop application and I want to build it using MVVM and WPF. I am also intending to use TDD. The problem is that I don´t know how I should use an IoC container to inject my dependencies on my production code. Suppose I have the…
Fedaykin
  • 4,262
  • 3
  • 20
  • 32
106
votes
10 answers

Makefile, header dependencies

Let's say I have a makefile with the rule %.o: %.c gcc -Wall -Iinclude ... I want *.o to be rebuilt whenever a header file changes. Rather than work out a list of dependencies, whenever any header file in /include changes, then all objects in the…
Mike
  • 54,052
  • 71
  • 166
  • 213
106
votes
2 answers

Difference between compile and runtime configurations in Gradle

My question is a little bit common, but it is linked with Gradle too. Why we need compile and runtime configuration? When I compile something I need artifacts to convert my java classes in bytecode so I need compile configuration, but why is needed…
Xelian
  • 14,624
  • 22
  • 83
  • 129
102
votes
5 answers

Gradle - getting the latest release version of a dependency

What would be the easiest way to tell Gradle the following: Retrieve 'junit' dependency and take its latest 'release' version. Managing Maven and Ivy repositories is sort of new to me. I tried the following steps and they result in Could not…
Yippie-Ki-Yay
  • 20,062
  • 23
  • 85
  • 143
99
votes
3 answers

Gradle: What is the difference between classpath and compile dependencies?

When adding dependencies to my project I am never sure what prefix I should give them, e.g. "classpath" or "compile". For example, should my dependencies below be compile time or classpath? Also, should this be in my applications build.gradle or…
java123999
  • 5,574
  • 28
  • 66
  • 104
97
votes
20 answers

How should I detect unnecessary #include files in a large C++ project?

I am working on a large C++ project in Visual Studio 2008, and there are a lot of files with unnecessary #include directives. Sometimes the #includes are just artifacts and everything will compile fine with them removed, and in other cases classes…
shambolic
  • 973
  • 1
  • 8
  • 5
97
votes
11 answers

CMake & CTest : make test doesn't build tests

I'm trying CTest in CMake in order to automatically run some of my tests using make test target. The problem is CMake does not "understand" that the test I'm willing to run has to be built since it is part of the project. So I'm looking for a way to…
claf
  • 8,375
  • 15
  • 54
  • 77