magento2 – Magento 2. How does Magento avoid the circular dependence of Magento Backend Model Url?

Magento Uses


as a preference for


now MagentoBackendModelUrl
has a dependency on


that depends of


which in the administration area is implemented by


that depends of
`Magento Framework Session SidResolverInterface`

which is implemented by


which in turn depends on


in the end what we have is a circular dependency

BackendModelUrl <- depends -> FormKey

I checked three times to see if a different implementation is provided for SidResolverInterface in the administration area, one that does not depend on Magento Framework UrlInterface. This is not the case.

So how does Magento avoid this circular dependence? Why doesn't it fail? What am i missing?

html – Warning: 6+ angular angular dependence detected

I have two; form A and form B.

  • formA has a button, and when clicked, open formB and close formA.
  • formB has a button, and when clicked, you must open formA again.

I have a function in the component (form A) that opens the component (form B), but when I import a function in the component (form B) to reopen the component (form A), it gives me a circular dependency. How can I avoid it?

Relationship between continuous multiple dependence and set topology

This proposition is found in Shub's book: global stability of dynamic systems. here $ R $ It is a rectangle. I was wondering why in this part marked the continuous dependence of multiple stable ones implies that the given sets are open and closed. Is it a multiple property? or something else?
enter the description of the image here

architectural patterns: include dependence on another microservice or isolate the dependence on a third microservice?

New in the field of microservices, and working through some "guiding concepts" for architecture.

Assume a "User" microservice that identifies users. A second microservice, "System," identifies the systems. To associate users / access to a system, there will normally be a union table, and "it seems reasonable" that this table lives in "User" or "System".

But what happens when "Organization" is introduced? Does the "User" (assuming he had the "System" union) have to be updated to include a new union? Or would it be cleaner to implement separate "System User" and "User Organization" services, creating a more hierarchical dependency and avoiding direct awareness among the "User", "System" and "Organization" microservices?

design – Resolving dependence on events in systems driven by events

There are 60 million shipments per day. Each shipment has around 50 metrics to calculate.
Each metric is calculated based on a type of event (let's say event 1 has the information required to calculate metric_1, event_2 .. metric_2 and so).
All events are independent of each other, apart from a dependency, a single event (let's say event 1) that has vital information required to process each of the other events.

The current design:

(In order) Scenario 1:event 1 come first, we calculate metric_1 and store the vital information required to process other events in DynamoDB. Other events(event_4, event_2, …) arrive and are processed by accessing DynamoDB information.

(Out of service) Scenario 2: event_3 arrives first, the system verifies the information required in DynamoDB and fails, the system places the event in the queue of messages not delivered to be retried after a period of time. One event 1 It arrives and is processed, the other events pass.

It is using a retry and data storage mechanism the correct approach to solve the dependency in the base event (event 1)?

Are there better approaches / patterns to solve the problem of event dependence?

Additional context: Although I think this information is irrelevant, I am giving it anyway if it helps. Origin of events: SNS issues, event processing: SNS-> SQS-> Lambda, data warehouse: DynamoDB, metrics are stored in RedShift.

Find redundant variables specific to linear dependence in SAS

I am carrying out canonical correlations in SAS. On the one hand, I am creating ten variables with a fictitious code, but one goes as zero. My hunch is that there is a linear dependence between all the dummy encoded input variables.

The correlations do not yield anything. Can anyone suggest an easy-to-use way to find which variable (s) is causing the linear dependency?

Functional programming – Free FP dependence injection Monad vs OOP

I have written my first moderately large project in functional style (in F #) and I can see the advantages. The main challenge was to achieve the architecture "Onion", that is, an impure shell with a pure / thin core and "silent" large and "intelligent". It took most of the time, but it also produced the greatest benefits (better proofing, proofreading, code reuse, etc.) and I want to know more.

I started looking for a common approach to segregate IO / pure logic effects and I found a lot of material about Free Monads, mainly in Haskell (I know that F # does not have HKT or native free monads, but anyway).

From what I have read, I understand correctly that:

  • The free monad is not the recipe to achieve the architecture of the onion, but the architecture of the onion is a prerequisite to make the most of the free monad
  • The free monad on the undisciplined and disordered code has little or no advantage over the simple injection of dependence

For example, if the results of IO operations (summarized by the free monad or not) are used for the bifurcation / decision making interleaved with another logic without any discipline, in short, if the function is not reduced to a flat list or a very simple instruction tree that can be further simplified by the free monad interpreter.

Am I missing something fundamental here?

8 – Problems of dependence on migration

I'm learning D8 migrations and working on user roles and migrations.

I copied the default d7_user_role.yml template of the user migration module in the kernel, and made simple adjustments to the I.D Y label, additional group_migration and saved it as migrate_plus.migration.d8_user_roles as follows:

uuid: 8e055d1d-f57b-4af1-90e0-bf4d99ba27c8
langcode: in
state: true
dependencies: {}
id: d8_user_roles
class: null
field_plugin_method: null
cck_plugin_method: null
- & # 39; Drupal 7 & # 39;
- Configuration
group_migration: D7-A-D8
Tag: & # 39; D8 user roles & # 39;
plugin: d7_user_role
plugin: machine_name
name of the source
plugin: user_update_8002
Label name
plugin: static_map
source: permissions
bypass: true
& # 39; use PHP for block visibility & # 39 ;: & # 39; use PHP for configurations & # 39;
& # 39; Manage contact form throughout the site & # 39 ;: & # 39; Manage contact forms & # 39;
& # 39; Post comments without approval & # 39 ;: & # 39; omit approval comment & # 39;
& # 39; edit own blog posts & # 39 ;: & # 39; edit own blog content & # 39;
& # 39; edit any blog post & # 39 ;: & # 39; edit any blog content & # 39;
& # 39; Delete own blog posts & # 39 ;: & # 39; Remove content from own blogs & # 39;
& # 39; delete any blog post & # 39 ;: & # 39; delete any blog content & # 39;
& # 39; create forum topics & # 39 ;: & # 39; create forum content & # 39;
Remove any forum topic & # 39 ;: delete any forum content & # 39;
& # 39; delete the forum's own themes & # 39 ;: & # 39; delete the content of the forum itself & # 39;
& # 39; edit any forum topic & # 39 ;: & # 39; edit any forum content & # 39;
& # 39; edit the forum's own themes & # 39 ;: & # 39; edit the content of the forum itself & # 39;
plugin: flatten
Weight: weight
plugin: & # 39; entity: user_role & # 39;
dependency_migration: null

The migration worked fine, all 6 roles of my D7 site were migrated to my D8 site.

I tried the same with d7_user.yml, copied, edited by personalizing the identification, tag, added the migration group, saved as migrate_plus.migration.d8_users just like I did with the d8_user_roles.yml. The only difference is that I added d8_user_roles.yml as a migration dependency for d8_users.yml, as shown below:

uuid: 2617bd64-fe61-4c7c-ad59-f1d989e3e8cb
langcode: in
state: true
dependencies: {}
id: d8_users
class: Drupal  user  Plugin  migrate  User
field_plugin_method: null
cck_plugin_method: null
- & # 39; Drupal 7 & # 39;
- Content
group_migration: D7-A-D8
Tag: & # 39; D8 user accounts & # 39;
plugin: d7_user
uid: uid
name name
pass: pass
mail: mail
created: created
Access: access
login: login
state: state
Time zone: time zone
plugin: user_langcode
source: entity_language
fallback_to_site_default: false
preferred code_lang:
plugin: user_langcode
source language
fallback_to_site_default: true
plugin: user_langcode
source language
fallback_to_site_default: true
init: init
plugin: migration_lookup
migration: d7_user_role
Source: roles
user image:
plugin: default_value
Source: photo
default_value: null
plugin: migration_lookup
migration: d7_file
plugin: & # 39; entity: user & # 39;
- d8_user_roles
- d7_field_instance
- d7_file
- language
- default language
- user_picture_field_instance
- user_picture_entity_display
- user_picture_entity_form_display

The migration status showed 51 users ready for migration.

Both files remained almost unchanged, except for the changes I mentioned.

The problem is when I try to execute the d8_users Migration I get the following error:

Migration d8_users did not meet the requirements. Lost migrations
d8_user_roles Requirements: d8_user_roles.

I do not understand that because d8_user_roles It is clearly included as a required dependency.

I also tried to execute the migration without dependencies configuring dependency_migration to null but that returns the following much uglier error:

InvalidArgumentException: the passed variable is not an array or an object in /var/www/d8/core/modules/migrate/src/Plugin/migrate/process/Flatten.php:52                         [error]
Battery tracking:
0 /var/www/d8/core/modules/migrate/src/Plugin/migrate/process/Flatten.php(52): ArrayIterator -> __ construct (NULL)
1 /var/www/d8/core/modules/migrate/src/MigrateExecutable.php(394): Drupal  migrate  Plugin  migrate  process  Flatten-> transform (NULL,
Object (Drupal  migrate_tools  MigrateExecutable), Object (Drupal  migrate  Row), & # 39; permissions & # 39;)
2 /var/www/d8/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php(221): Drupal  migrate  MigrateExecutable-> processRow (Object (Drupal  migrate  Row), Array)
3 /var/www/d8/core/modules/migrate/src/MigrateExecutable.php(380): Drupal  migrate  Plugin  migrate  process  MigrationLookup-> transform (Array,
Object (Drupal  migrate_tools  MigrateExecutable), Object (Drupal  migrate  Row), & # 39; roles & # 39;)
4 /var/www/d8/core/modules/migrate/src/MigrateExecutable.php(203): Drupal  migrate  MigrateExecutable-> processRow (Object (Drupal  migrate  Row))
5 /usr/local/share/drush/includes/ Drupal  migrate  MigrateExecutable-> import ()
6 /usr/local/share/drush/includes/ drush_call_user_func_array (Array, Array)
7 /var/www/d8/modules/contrib/migrate_tools/ drush_op (Array)
8 [internal function]: _drush_migrate_tools_execute_migration (Object (Drupal  user  Plugin  migrate  User), & # 39; d8_users & # 39 ;, Array)
9 /var/www/d8/modules/contrib/migrate_tools/ array_walk (Array, & # 39; _drush_migrate _... & # 39 ;, Array)
10 /usr/local/share/drush/includes/ drush_migrate_tools_migrate_import (& # 39; d8_users & # 39;)
11 /usr/local/share/drush/includes/ _drush_invoke_hooks (Array, Array)
12 /usr/local/share/drush/includes/ drush_command (& # 39; d8_users & # 39;)
13 /usr/local/share/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch (Array)
14 /usr/local/share/drush/includes/ Drush  Boot  BaseBoot-> bootstrap_and_dispatch ()
15 /usr/local/share/drush/drush.php(12): drush_main ()
16 {main}

And … I'm not sure how to interpret that error.

I would really appreciate some help to solve the dependency problem and how to interpret that final error.

magento2: how to solve the circular dependence when an auxiliary class is of another auxiliary class

Have a module called Cancel Search in which there are two kinds of helpers

1. Cancel  Search  Helper  Data.php
2. Cancel  Search  Helper  Util.php

Both helpers are dependent on each other, thus giving circular dependence error.

Exception # 0 (LogicException): circular dependency: 

Test 1:
– using their namespaces in the header in the following way but still with the same error:

use  Override  Search  Helper  Data as Override_MainHelper;

Test 2:
– Adding initialization in the constructor as below

public function __constructed (
//Other classes
 Override  Search  Helper  Data $ searchHelperMain
) {
//Other classes
$ this -> _ searchHelperMain = $ searchHelperMain;

The next class is Main Data.php

_storeModelStoreManagerInterface = $ storeModelStoreManagerInterface;
$ this -> _ backendModelUrl = $ backendModelUrl;
$ this -> _ searchHelperConfig = $ searchHelperConfig;
$ this -> _ psrLogLoggerInterface = $ psrLogLoggerInterface;
$ this -> _ catalogModelProduct = $ catalogModelProduct;
$ this -> _ taxHelperData = $ taxHelperData;
$ this -> _ modelEntityType = $ modelEntityType;
$ this -> _ modelEntityAttribute = $ modelEntityAttribute;
$ this -> _ localeCurrency = $ localeCurrency;
$ this -> _ currencyFactory = $ currencyFactory;
$ this -> _ configDataCollection = $ configDataCollection;

// Other functions


The next class is Main Util.php

_searchHelperMain = $ searchHelperMain;

// Other functions


Have some idea about the proxy and the class of factories, but I'm not sure what the pros and cons of those features are, except for some lazy charges and dependency injection.

Circular dependency: Magento Backend Helper Data depends on Magento Backend Model Url and vice versa

What is suitable here that can cover the compatibility with previous versions also that is, 2.1.x and 2.2.x and 2.3.x?
Proxy or factories or some third way?

Circular dependence – Is there a good design to eliminate?

I was writing a code and I came across a scenario where I was thinking about making a circular dependent class, something I had not done before. Then I looked for the circular dependencies and if they were inadmissible, and I found that it is feasible but not desirable. But I have some dilemma about how to implement it without circular dependencies, so I thought you should see if there are other suggestions available.

Imagine that you are creating an index for a number of files, and those files have a number of attributes, including an attribute that records what files the particular file refers to.

Trying to configure some classes that imitate this structure, I have written several classes.

  1. subclass It includes the definition of attributes of a file, let's call it.
    set of attributes A

  2. subclass B It includes classification attributes of a file, let's call it.
    this set of attributes B

  3. fileObject is an object that represents a file, and has one
    subclass object and one subclass B object.

  4. fileSet is an object that represents a particular set of files, and
    it's essentially a collection of fileObjects

How I was creating subclass B, I realized that the information related to the reference files within subclass B it's really fair fileSet with limited subclass information. Is it prudent then simply circular reference inside subclass B a fileSet object? Or if that is a terrible idea, how should one store the information? Technically, we can create another collection class object under fileObjectthat will store a lot of subclass objects, but I'm really not in favor of that since I would need to duplicate certain functions of fileSet within that new class definition (for example, functions that check those objects, combine those objects, etc.).

And if I do it where I have a object_M which includes a collection of subclass and other object_N which includes a collection of subclass B (who has a object_M included), and a higher level fileSet which includes one object_M Y object_N, that will solve the problem, but suddenly we have a new problem of needing some form of linking objects within object_M Y object_N Together in some way, another complexity in itself.

With the given scenario, should I just go with the circular dependency? Or is there a better way to do it altogether?