124
votes
Why prefer a package manager over a library folder?
An important point missing from the other answers:
Using a package manager means having a configuration that indicates which library versions you are using and makes sure that config information is ...
40
votes
Why prefer a package manager over a library folder?
Pros of lib folder disappear quickly after you move from small scale development to bigger work.
For example the "benefit" of not requiring an external tool is trumped by the work required ...
36
votes
Why prefer a package manager over a library folder?
You're missing many of the advantages of package managers.
Package managers allow you to avoid checking large (several megabyte or larger) binaries into source control. Doing so is anathema to many ...
16
votes
Why prefer a package manager over a library folder?
Having recently converted our product from using manually downloaded libraries to automatic package management with Nuget, I can say that using a package manager has massive benefits.
Our product is ...
16
votes
Accepted
Writing a separate package vs copy pasting small amount of reused code
Isolating the serialization code in its own package is little overhead but significant benefits.
You already pointed out the reuse possibility the package, but in fact it offers more:
Separation of ...
14
votes
Why prefer a package manager over a library folder?
No need of external tool to manage packages
That's kind of a non-point is it? If I use a package manager, I don't need to have a lib folder. I also don't have to manage the packages myself.
No ...
11
votes
Accepted
Adding library as dependency only to use one function
This really really depends and has to be decided on a case by case basis. Also, the modern JavaScript ecosystem has a strong bias towards using tiny libraries, so conventions from other ecosystems do ...
10
votes
Accepted
Singleton with dependency injection ,is that a good practice in some cases?
This is problematic, because if your program calls
HeavyTaskDb.Instance(X)
first, and then
HeavyTaskDb.Instance(Y)
later (maybe in a completely different area of the code base), it returns ...
9
votes
Accepted
Remove circular dependency
The general problem here is the Event class having too many responsibilities. It should be a dumb information container, maybe with some persistence methods, but not more. Keeping any domain logic out ...
7
votes
How to ensure long-term enterprise software stability with changing frameworks / things going out of support?
The more you leverage Other Peoples Work TM the more your are at the whim of other people.
So there are four ways to handle this:
Pay a Not Inconsequential Amount of Money to develop and maintain 100%...
6
votes
Resolving circular dependency between two classes
The simple solution to this is to recognise that Controller doesn't need a dependency on Messenger, it needs a dependency on send. So provide it with that dependency:
interface Sender {
void send(...
6
votes
Accepted
Is it a bad idea to model dependencies using a project's directory structure?
This approach is not as good as good as it might appear. Directory structures are not as flexible as programming languages expressivity.
Let's look at some problems you have to think of in your ...
6
votes
Accepted
Should we include the entire sources of the libraries used in our project?
Putting the entire source of a library in your project allows you to:
Maintain and update the library in the event that it is abandoned.
Make alterations to the library to advance goals for your ...
6
votes
Accepted
Matching dependency versions across multiple Python projects
60 repos containing Python packages
I have a few years' experience working with about double that.
Different repos had different policies.
Many of them would rev independently.
Keeping a repo small ...
5
votes
Accepted
Critical dependency is preventing me from updating my app to latest framework version
Because of reasons like this, dependencies are not just an asset but also a kind of liability: today's rapid development is tomorrows technical debt. Depending on the risks you forsee and want to ...
5
votes
Why prefer a package manager over a library folder?
It is the difference between just using libraries (lib directory), and using them, maintaining meta-information (package manager). Such meta-information concerns version numbers, (transitive) ...
5
votes
Accepted
Use deprecated library or copy the code I need from it into my codebase?
If you're building something to use longer than a quick throwaway experiment, then it's asking for trouble to depend on deprecated code, esp. open source code whose source is no longer posted online.
...
5
votes
Accepted
Where to put technical updates in git branching flow?
Feature branches are a general term that means "not the main branch" (or master). Don't get too complicated with this. Create a branch just to upgrade that dependency. This should capture ...
4
votes
"Crossing Boundaries" in Clean Architecture
First, let me strongly recommend that you read Robert Martin's book titled Clean Architecture if you haven't.
I assume that you have read it, but I don't know for sure, because many questions that are ...
4
votes
Accepted
Avoiding instantiating the whole application at startup when using a composition root
Say I want a timestamp that represents now. I can't create it at startup because at startup nothing knows when now is. I also don't want to hardcode the timestamp because I don't want to be tied to a ...
4
votes
Twelve-Factor App: Dependency Managment and binaries
It's about Deployment
If your product needs any system dependencies that are not a core component of the operating system, then your product needs to include it as part of the installation package. ...
4
votes
Accepted
How should projects that interact with or depend upon external binaries handle version specific failures?
I see two possible solutions. The good one, and the not-so-good one:
The good one: those binaries are dependencies and so should be bundled with the project. And in concrete versions. Just like every ...
4
votes
Accepted
How to deal with conflicting dependencies/versions?
There is no easy solution here. If an incompatible version of a library/library is released, there is little you can do using technology. But I find that kind of situation unlikely.
If a plugin or ...
4
votes
How to manage common library dependencies to prevent cross-application breakage?
Unfortunately, if you make a number of essentially independent codebases dependent on the always-latest version of a common library, then you get two problems.
One, is that any change to the common ...
3
votes
Accepted
Best practice of c/C++ dependency management on build servers?
Moving third party build dependencies into your repository is perfectly fine, and even has some advantages (eg. no version mismatches, tracked upgrades). But doing so should not touch your code.
C/C+...
3
votes
Critical dependency is preventing me from updating my app to latest framework version
The critical thing to sort out is the nature of your dependency. Does the older version provide one thing that your project needs or many things? Does the newer version provide one thing or many ...
3
votes
Why prefer a package manager over a library folder?
There are some cases where a lib folder might be necessary, for example when dealing with obsolete libraries (a version of it no longer maintained/available), a locally modified version of a library, ....
3
votes
"Crossing Boundaries" in Clean Architecture
Yes, the interactor is injected into the controller. When the application starts, the main module instantiates all application objects (interactors, controllers, views, etc.). In principle, a ...
3
votes
How to ensure long-term enterprise software stability with changing frameworks / things going out of support?
Summary
Abstract dependencies that can be reasonably abstracted, so you're prepared for needing to swap them out in the future.
If you're relying on vendor support, vet your vendors and take a good ...
3
votes
Accepted
Design class with different dependency requirements based on configuration
You've not abstracted this correctly.
Inject a dependency (IDependency) which has a method which returns a boolean. Your service does not need to know how the dependency works, it just knows that it ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
dependency-management × 127dependencies × 29
dependency-injection × 15
architecture × 10
git × 9
design × 8
java × 8
c# × 7
c++ × 7
.net × 7
libraries × 7
maven × 7
php × 6
versioning × 6
package-managers × 6
python × 5
microservices × 5
version-control × 5
builds × 5
circular-dependency × 5
nuget × 5
object-oriented × 4
unit-testing × 4
project-structure × 4
packages × 4