There are many components in one ZF2 system. Each component has its own presentation layer, business layer, and data layer. The problem is when component Foo has a Controller which uses component Bar's data layer.
example:
<inside modules, each module can be individually deployed or removed> \modules \Foo ; one module (this directory) can be added or removed \view ; presentation layer (view) for all subcomponents \Subcomponent1 \Action1 \Subcomponent2 \Action2 ... \src \Subcomponent1 \Entity ; data layer (model) \Controller ; business layer (controller) \Service ; service layer (service) \Subcomponent2 \Entity \Controller \Service \Subcomponent3 ... \Bar \view ... \src \Subcomponent1 ... \Baz \src \Subcomponent1 ... Subcomponents are strongly coupled with Entities from other subcomponents, often from different components entirely. That is the case for Controllers and Services. Can this be resolved?
Foo\Subcomponent1 has a FooSub1Service which uses entity from Bar\Subcomponent1 to process passed data and import them in DB. Baz\Subcomponent1 has an AuthenticationService which uses Bar\Subcomponent1 entities to find user by ID, etc.
I am aware of dependency injection, but in this case there is EntityManager in every subcomponent, and it is instructed to find an entity by name and PK i.e. find("Bar\Subcomponent1\Entity\User", 123). And also, when persisting entities I have to instantiate anything that has a foreign key, i.e. UserAddress and add it to the User. Every time I call x = new NameOfEntity(), I tightly couple a subcomponent with some entity from a subcomponent, often from a different system module.