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 6731363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:31:10+00:00 2026-05-26T10:31:10+00:00

I have an interface of global variables like so: public interface ClientSettings{ DateTime CurrentClientTime;

  • 0

I have an interface of global variables like so:

public interface ClientSettings{
    DateTime CurrentClientTime;
    string ClientImageFolder;    
}

The concrete class is persisted using settings files or a database table.

These values must be accessed by entities and services, both in the domain and the application layer. I have been using DI in my application layer, so access this from there is no problem.

But now that I need to access this interface from the entities I’m not sure of the best way to do so. I don’t really want to inject this into my entities. Is the service locator pattern appropriate here? Or do I have another option all together?

  • 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-26T10:31:11+00:00Added an answer on May 26, 2026 at 10:31 am

    In this type of situation I would try to design the entities and the application layer such that the application layer provides all required settings information to the entities when operating upon them. Settings are normally an application concern and should therefore be managed by the application layer. Furthermore, an application level settings container object, such as ClientSettings may contain settings for various parts of the application which may not be applicable for a given entity. This is another argument for relieving the domain entities of the responsibility.

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

Sidebar

Related Questions

Have a interface class abc { public: virtual int foo() = 0; ... }
Suppose we have: interface Foo { bool Func(int x); } class Bar: Foo {
I have an interface - here's a nicely contrived version as an example: public
I have a class called 'Constants' that I am storing a String variable in.
In a delphi unit, I have a global record called 'Context': interface type TContext
I have created a nice user interface, and I would like to add some
which is the cleanest way to use something like a global variable? Normally, using
If I have interface IFoo, and have several classes that implement it, what is
Lets say you have interface definition. That interface can be Operation . Then you
I have two questions 1) my interface i have interface called IRegister and within

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.