Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8888701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:06:00+00:00 2026-06-14T22:06:00+00:00

There are many components in one ZF2 system. Each component has its own presentation

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:06:01+00:00Added an answer on June 14, 2026 at 10:06 pm

    In ZF2, coupling between modules can be reduced using the EventManager, see also here.

    In addition, module/config/module.config.php serves as a Facade.

    All entities can be defined ONCE in any module’s module/config/module.config.php file. Other modules can then use the ServiceManager to resolve their dependencies.

    The ServiceManager implements the Service Locator pattern.

    With the Facade (module.config.php) and EventManager, coupling between modules was successfully reduced.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are many errors here in SO, but this scenario I think its different.
There are many similar questions, but I didn't find one that gets straight to
There are many questions like this but I can't find one that seems to
One way of doing it is double-clicking on each component and it will automatically
I have a wicket form which contains many TextField input components. There's a Validator
I'm creating a site on which there are many page components that refer to
In a system I'm currently working on, I have many components which are defined
My application has a pipeline concept that runs through and executes one to many
I have found some similar questions like this one, however there are so many
I have a database of components. Each component is of a specific type. That

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.