dependency injection – IoC / DI + constructor arguments "normal" mvvm

I am using the unit in C # to achieve dependency injection and control investment.

What if I have a class, say a view model, which depends on several services such as a repository, a validator and a record BUT it also depends on a simple list of data
objects, so I would have a constructor like this

ClientVM(DBService db, ClientValidator v, Log log, List clients)

The way I solved this at the moment is with a class that handles the creation of ClientVM, I call it a factory, however, after searching on Google I am no longer sure if it is the correct term.

public ClientFactory(DBService db, ClientValidator v, Log log) { ... }

public Client Create(List clients) {
    return new ClientVM(db, v, log, clients);

Then I can inject ClientFactory anywhere where I need to create new ClientVM.

This still feels something clean to me. But what happens if I expand it and say that I have a detailed view model in my ClientVM, their addresses, for example.

So my ClientVM now depends on an additional AdressVM, which would mean that I write a similar AdressFactory, inject it into the ClientFactory and then in my create () method I call the
AdressFactories Create () method.

It is starting to get complicated. Perhaps.

I wonder if this is a sign of bad design. How would it make it simpler? Can I avoid all these "factories"? Is that how it is, since I am quite close to the root of the composition and the logic of creation is still somewhat complex?

Unresolved dependency that updates the Views Module

I am updating the Views module on my D7 site and I receive this message when I update the database:

Requirements Issue

How do I solve this dependency problem when I first need to update the view module?

Thanks in advance.

centos – How to interpret this yum dependency error?

I am trying to install XRDP and I am hitting the following:

(root@box ~)# yum -y install xrdp
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base:
 * epel:
 * extras:
 * updates:
Resolving Dependencies
--> Running transaction check
---> Package xrdp.x86_64 1:0.9.10-1.el7 will be installed
--> Processing Dependency: xrdp-selinux = 1:0.9.10-1.el7 for package: 1:xrdp-0.9.10-1.el7.x86_64
--> Processing Dependency: xorgxrdp for package: 1:xrdp-0.9.10-1.el7.x86_64
--> Running transaction check
---> Package xorgxrdp.x86_64 0:0.2.10-4.el7 will be installed
--> Processing Dependency: xorg-x11-server-Xorg(x86-64) = 1.20.4 for package: xorgxrdp-0.2.10-4.el7.x86_64
---> Package xrdp-selinux.x86_64 1:0.9.10-1.el7 will be installed
--> Finished Dependency Resolution
Error: Package: xorgxrdp-0.2.10-4.el7.x86_64 (epel)
           Requires: xorg-x11-server-Xorg(x86-64) = 1.20.4
           Installed: xorg-x11-server-Xorg-1.20.1-5.6.el7_6.x86_64 (@updates)
               xorg-x11-server-Xorg(x86-64) = 1.20.1-5.6.el7_6
           Available: xorg-x11-server-Xorg-1.20.1-3.el7.x86_64 (base)
               xorg-x11-server-Xorg(x86-64) = 1.20.1-3.el7
           Available: xorg-x11-server-Xorg-1.20.1-5.el7.x86_64 (updates)
               xorg-x11-server-Xorg(x86-64) = 1.20.1-5.el7
           Available: xorg-x11-server-Xorg-1.20.1-5.1.el7.x86_64 (updates)
               xorg-x11-server-Xorg(x86-64) = 1.20.1-5.1.el7
           Available: xorg-x11-server-Xorg-1.20.1-5.2.el7_6.x86_64 (updates)
               xorg-x11-server-Xorg(x86-64) = 1.20.1-5.2.el7_6
           Available: xorg-x11-server-Xorg-1.20.1-5.3.el7_6.x86_64 (updates)
               xorg-x11-server-Xorg(x86-64) = 1.20.1-5.3.el7_6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Now, I understand that a dependency is missing, however, it seems to be saying that it requires xorg-x11-server-Xorg version 1.20.4.

Then continue saying version 1.20.1-5.6.el7_6 it's installed.

From where I am sitting, 4 is in the 1-5 range, so I am not clear what the problem is. All seem to be for the right architecture.

Is 1-5 a version string in itself instead of a range, or, if not, what am I missing?

dependency injection: why does Laravel support the use of facades while Symphony endorse DI?

I have a small experience working in Symfony and Laravel. At Symphony, I noticed that the use of dependency injection patterns is highly supported due to the nature of the framework.

On the other hand, Laravel, which uses Symfony components, supports the use of the Facade pattern, although dependency injection is also supported.

So, noticing this difference, I have these questions:

  1. Why in Laravel is it more common to use facades instead of ID?
  2. In the common components of Laravel (e.g. DB class) What benefit is obtained by using Facade instead of DI?
  3. On the side of Symfony, what benefit do I get with the intensive use of dependency injection?

Dependency injection: why laravel erda the use of facades while Symphony Erdoses DI?

I have a small experience working in Symfony and Laravel. In Symphony, I realize that the use of dependency injection patterns is very wrong in the nature of the frames.

On the other hand, the Laravel that uses the Symfony Components errata the use of the Facade pattern, although the Injection of dependencies is also compatible.

So, noticing this difference, I have these burning questions:

  1. Why in Laravel it is more common to use facades instead of ID.
  2. In the common components of Laravel (Im means the DB class) what benefit is obtained using Facade instead of DI.
  3. On the side of Symfony, what benefit do I get with the intensive use of dependency injection;

linux – yum install git in RHEL 6.7 (Santiago) fails with missing perl dependency

I am trying to install git using the yum package manager on a Linux Red Hat Enterprise v6.7 virtual machine (Santiago) and unfortunately I encounter the following problem after running: yum install git

Error package: git222-perl-Git-2.22.0-2.el6.ius.noarch (ius)
Requires: perl (error)

Note that perl already exists in that system:

$ what perl
$ / usr / bin / perl

Any clues on how to solve this would be greatly appreciated!


Dependency management in C ++ through projects.

We are developing a reference framework in C ++, with Make and CMake as compilation tools. The objective of the framework is to allow others who build algorithms to make direct comparisons with previous works. As such, we have integrated a series of cutting-edge algorithms that users can clone and test within the framework. Since many of the algorithms have standard dependencies (for example, Eigen, OpenCV, etc.), our current solution is to clone all dependencies with specific revisions in a deps/ Directory and make sure that all different algorithms link against these dependencies.

We are discovering that this approach makes it increasingly difficult to maintain something that can be easily built. As more algorithms are integrated into the framework, it is virtually impossible to find reviews that work on all algorithms. In addition, it is unlikely that all users are interested in creating all currently integrated algorithms.

One solution would be to clone the dependencies of each algorithm separately and build each algorithm separately. There are two problems I can find here:

  • Some of the common dependencies, such as OpenCV, are very large and require a lot of time to clone and compile.
  • In my experience, having several versions of the same library is meant to end CMake by choosing the wrong version for some reason and it is often difficult to restrict. Often, one ends up with dependency conflicts in different projects, the system, etc.
  • Whenever possible, it is preferable to ensure that the same version of dependencies is used in all algorithms. If one is to perform fair Direct comparison, the probability that a difference in performance between algorithm1 and algorithm2 is due to different versions of their dependencies should be minimized.

Attached to the tree, maybe I can give a better idea of ​​the overall structure

├── algorithms
│   ├──
│   ├── CMakeLists.txt
│   ├── algo1/
│   ├── algo2/
├── build
│   ├── algorithms/
│   ├── framework/
│   ├── bin/
├── datasets
│   ├──
│   └── dataset1/
│   └── dataset2/
├── deps
│   ├── dep1/
│   ├── dep2/
│   ├── build/
├── framework
│   ├── CMakeLists.txt
│   ├── include/
│   ├── src/
├── CMakeLists.txt

interfaces – Propper way of handling large injected dependency builders

I have many dataservices / classes injected into a constructor.

public MyClassConstructor (IAclass A, IBclass B, .... , IZclass Z){

The number that I have to pass goes beyond 100. To solve this, I created an injected class that contains all the data services.
Making it more agile:

public MyClassConstructor (IDataServices dataServices){...}

This works well, but unfortunately it is an anti-pattern. When testing, I must create a manual instance of all classes, even if only one is needed (for all functions).
As an alternative, I created interfaces that are transmitted only for the classes that are necessary.

public MyClassConstructor (IMainInterface mainInterface) {
    A = new A(mainInterface);
    B = new B(mainInterface);

public AClassContructor (IAInterface) {...}

public BClassContructor (IBInterface) {...}

This solves the two previous problems, but creates a new one where I am sitting with hundreds of different interface classes.

Which of these is the best approach, and is there any more efficient / better way to handle this problem?

java – How to prevent the circular dependency from abstracting the navigation in the desktop application?

I'm trying to abstract some functionality from my desktop application (JavaFX) to change the views.

So, what I'm thinking is:

Browser interface with methods like goToAccountsOverview (), goToAccountDetails (account account) etc. The implementation will depend on a ViewFactory to create the views and a ViewingChanger to change the view that is displayed.

There will be multiple browser interfaces depending on the state of the application, starting with:

  • NotConnectedStateNavigator (goToConnectToDatabase (), goToCreateDatabase () etc)

  • ConnectedStateNavigator (goToAccountsOverview (), goToAccountDetails (account account) etc)

Therefore, each state will have its own browser and views factory and a common view changer. View factories and browsers will not share a common interface (createView (ViewEnum v) Y goToView (View View) respectively).

While implementing this, I run into a problem. An example of the problem is this:

At AccountsOverviewView There is a table with all the accounts. Each account has a button to view the details. Pressing that button should navigate to the AccountDetailsVista with the ViewModel of the account (I am using some type of MVVM).

To do that I would call connectedStateNavigator.goToAccountDetails (accountVM) what would i call viewChanger.changeView (connectedStateViewFactory.createAccountDetailsView (accountVM)).

So he AccountsOverviewView you need the ConnectedStateNavigator, who needs the ConnectedStateViewFactory, you need to be able to build the original AccountsOverviewView, who needs the ConnectedStateNavigator etc.

Some code to explain it better:

public class AccountsOverviewView {
public accounts Overview (ConnectedStateNavigator browser, ...) {
accountDetailsButton.onClick (e -> navigator.goToAccountDetails (account));

public class ConnectedStateNavigator {
ConnectedStateNavigator public (ConnectedStateViewFactory viewFactory, ...) {...}

public void goToAccountDetails (account account) {
viewChanger.changeView (viewFactory.createAccountDetailsView (account));

public class ConnectedStateViewFactory {
Public ConnectedStateViewFactory (ConnectedStateNavigator browser, ...) {...}

Public view createAccountsOverviewView () {
return new AccountsOverviewView (new AccountsOverviewViewModel (browser, ...));

Public view createAccountDetailsView (account account) {...}

How could I design this better to avoid this cyclical reference?
Is the only solution using a configurator or an asynchronous event system?

Android: Gradle sync failed: in the & # 39; application & # 39; of the project, a dependency of the Google Play service library resolved depends on another in an exact version (for example, "[15.0.1]"

I was using Firebase Realtime Database in my project. Now I'm trying to add Firestore. But I get this error.


I've written a lot of code. That's why I do not want to open my project again. When I was using the database in real time, I got that error. And a new project was open. But it was then my project is empty. So I opened a new project directly.

I need to solve it before opening a new project. 🙁 Please help.

Gradle application

Apply the add-on: & # 39; & # 39;

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.yagoozonfirebasejava"
minSdkVersion 16
targetSdkVersion 28
versioncode 1
versionName "1.0"
testInstrumentationRunner ""
buildTypes {
launching {
minifyEnabled fake
proguardFiles getDefaultProguardFile (& # 39; proguard-android-optimize.txt & # 39;), & # 39; & # 39;

dependencies {
deployment fileTree (dir: & # 39; libs & # 39 ;, includes: ['*.jar'])
implementation & # 39; appcompat-v7: 28.0.0 & # 39;
implementation & # 39; design-restriction: 1.1.3 & # 39;
implementation (& # 39; firebase-core: 16.0.6 & # 39;) {
exclude group: & # 39; & # 39 ;, module: & # 39; support-v4 & # 39;
implementation & # 39; firebase-auth: 16.0.3 & # 39;
implementation & # 39; firebase-database: 16.0.2 & # 39;
implementation & # 39; firebase-storage: 16.0.2 & # 39;
implementation & # 39; firebase-firestore: 17.0.0 & # 39;
Test Implementation & # 39; junit: junit: 4.12 & # 39;
androidTestImplementation & # 39; runner: 1.0.2 & # 39;
androidTestImplementation & # 39; espresso-core: 3.0.2 & # 39;
implementation & # 39; com.squareup.picasso: picasso: 2.71828 & # 39;
implementation & # 39; recyclerview-v7: 28.0.0 & # 39;


apply the add-on: & # 39; & # 39;

Gradle application module

// Top-level build file where you can add common configuration options to all subprojects / modules.

buildscript {
repositories {
Google ()
jcenter ()

dependencies {
classpath & # 39; gradle: 3.2.0 & # 39;
classpath & # 39; google-services: 4.2.0 & # 39;

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

all projects {
repositories {
Google ()
jcenter ()


cleanup task (type: delete) {
remove rootProject.buildDir