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

  • SEARCH
  • Home
  • 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 6113957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:55:07+00:00 2026-05-23T14:55:07+00:00

The common Prism’s way of designing complex applications is to have each module implementing

  • 0

The common Prism’s way of designing complex applications is to have each module implementing an IModule interface to Initialize itself for being able to work.
In most cases this “initialization” is mostly about registering some types with an IoC container. So, in our case IModule usually looks like this:

public class Module : IModule {
    private IUnityContainer _container;
    public Module(IUnityContainer container) {
        _container = container;
    }

    public void Initialize() {
        //register public types
        _container.RegisterType<IMyPublicInterface, MyImplementation>();


        //register internal dependencies
        _container.RegisterType<IInternalDependency1, InternalDependency1>();
        _container.RegisterType<IInternalDependency2, InternalDependency2>();
        //..etc.
    }
}

Our modules usually have only one(or very few) public types, and much more internal classes/dependencies to register.

I’m a little bit worried, if that approach breaks an encapsulation principle?
It seems, that we’re registering everything (both internal and public types) within one global container, which could blur the module’s border (public and internal types registration is completely the same) and make potentially possible to .Resolve our “internal” classes in the other places.

Isn’t it better to register internal dependencies within a ChildContainer?

Or may be we’re doing something completely wrong? 🙂

  • 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-05-23T14:55:08+00:00Added an answer on May 23, 2026 at 2:55 pm

    Your question has the answer modules register their views and view models in child containers. Only sharable services are registered in global container.

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

Sidebar

Related Questions

A common (i assume?) type of query: I have two tables ('products', 'productsales'). Each
Common scenario: I have a library that uses other libraries. For example, a math
Common situation: I have a client on my server who may update some of
I have an application which I am developing using WPF\Prism\MVVM. All is going well
A common way to create a button to access another page (i.e. link) using
I am building a Prism 2.1 demo by way of getting up to speed
Common image questions in regards to developing WP7 applications which are all related to
A common problem that I have with web pages is floating div tags creeping
A common scenario when using source control is to have a development branch along
The common sense tells that the Doxygen comment blocks have to be put in

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.