Dependency is a broad software engineering term used to refer to when a piece of software relies on another one. A requirement & prerequisite that must be fulfilled or installed before your code or software can function.
Questions tagged [dependencies]
224 questions
99
votes
7 answers
Should I use Dependency Injection or static factories?
When designing a system I am often faced with the problem of having a bunch of modules (logging, database acces, etc) being used by the other modules. The question is, how do I go about providing these components to other components. Two answers…
RokL
- 2,451
54
votes
5 answers
How to deal with fear of taking dependencies
The team I'm in creates components that can be used by the company's partners to integrate with our platform.
As such, I agree we should take extreme care when introducing (third-party) dependencies. Currently we have no third-party dependencies and…
robinwit
- 650
46
votes
5 answers
What is the difference between a library and a dependency?
In this docker beginner video its explained, that different stacks may depend on different libraries and dependencies and that this can be handled with Docker.
However, I don't get what the difference should be between a library and a dependency. As…
Adam
- 587
45
votes
6 answers
When should dependencies be updated?
We had two major dependency-related crises with two different code bases (Android, and a Node.js web app). The Android repo needed to migrate from Flurry to Firebase, which required updating the Google Play Services library four major versions. A…
Chris Cirefice
- 3,004
39
votes
8 answers
Is it ok copying code from one application to another, both belonging to the same repository, to keep them independent?
Given a repository which contains two different applications A and B (e.g. bootloader and RTOS), is it ok to copy source code from A to B in order to avoid dependencies (include's, adding A source files to the B compilation) between them, so they…
Martel
- 615
- 5
- 7
39
votes
4 answers
Optional dependencies in npm?
I have a similar question to this, but not quite the same.
I would like for the user of my app to install it with whatever dependencies are needed for the way he would want to use it. So, for example, if they want to persist to MongoDB, then only…
imiric
- 501
26
votes
6 answers
Separating a "wad of stuff" utility project into individual components with "optional" dependencies
Over the years of using C#/.NET for a bunch of in-house projects, we've had one library grow organically into one huge wad of stuff. It's called "Util", and I'm sure many of you have seen one of these beasts in your careers.
Many parts of this…
Roman Starkov
- 4,499
24
votes
5 answers
How would one handle external dependencies in an open-source project?
When one writes an open-source project and uses Google Code or GitHub, and wants to use a library like Lua, how should one do this?
Should the dependency be included in the repository?
Should the dependency be built from within the same build…
user4595
21
votes
2 answers
Why should I use foreign keys in database?
In my 10+ years of experience in the IT field, I have never used foreign keys in any of my projects and I never felt the need. I did work with professional databases that had foreign keys constraints.
I am now at a position where we are building a…
TheTechGuy
- 1,045
18
votes
4 answers
Sharing classes or interfaces between different projects
I was looking for some answers in SO or here, but without any results, that's why I would ask you.
Let's assume I have a two different projects - for example server part and client part of an app. I'm developing my own part, while my friend is…
radekEm
- 365
16
votes
3 answers
Is it problematic to have a dependency between objects of the same layer in a layered software architecture?
Considering a medium-big software with an n-layer architecture and dependency injection, I am comfortable to say that an object belonging to a layer can depend on objects from lower layers but never on objects from higher layers.
But I'm not sure…
bracco23
- 429
14
votes
3 answers
Git Project Dependencies on GitHub
I've written a PHP framework and a CMS on top of the framework. The CMS is dependent on the framework, but the framework exists as a self-contained folder within the CMS files. I'd like to maintain them as separate projects on GitHub, but I don't…
VirtuosiMedia
- 4,119
- 4
- 35
- 43
12
votes
9 answers
is it okay to mock a database when writing unit test?
I read an article about unit testing by Vladimir Khorikov, written in 2020. Here is The Article
https://vkhorikov.medium.com/dont-mock-your-database-it-s-an-implementation-detail-8f1b527c78be
It said that you shouldn't mock an (internal) application…
12
votes
4 answers
What is the correct way of adding third-party code into a C or C++ project?
I want to incorporate some open source libraries into my C project. This is the first time I do that, so I don't know what is the right or most common way of doing it.
I see two possible paths I can take:
Download the code of each library I'll use,…
user300750
12
votes
2 answers
Is it a good idea to manage a group of repo microservices as submodules of a master repo?
At the moment of writing I have let's say 4 micro services interoperating in order to build a bigger system.
Every microservice has its own repo.
What I'm thinking is that it would be useful to have parent repositories that group the children…
koalaok
- 513