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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:14:09+00:00 2026-05-21T03:14:09+00:00

Hey! First post for me but long time reader of Stackoverflow. Anyway, got a

  • 0

Hey! First post for me but long time reader of Stackoverflow.

Anyway, got a tricky problem wich is getting on my nerves. It’s questions about how configurable should a DIC (Dependency Injection Container) be. I’m working on a session handler for our framework we are setting up. The session handler is dependent on a storage service, some simple configuration parameters and is the one that generates a session id with a salt.

Session handler is loaded by our container wich takes all the settings, either as a configurator object or an array of parameters. The container checks the setting for what storage service is called for and loads the service and injects it to the session handler. The storage service does not take any constructor settings at the moment.

Session handler in it’s turn generates the session id from the settings it got injected. And from there injects the session id and other settings relevant to the that storage service.

My questions are:

  1. Is it proper to let the Session Handler inject settings to storage service? It’s like a 2 step rocket.
  2. Should I inject the session id and other parameters from start when I load the storage service in the container? Wich in the end leaves me with the problem of generating the session ID and have to rely on the storage service to do it.
  3. What problems would arise if I did either way from above proposals?
  4. Am I breaking anything “holy” 🙂
  • 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-21T03:14:10+00:00Added an answer on May 21, 2026 at 3:14 am

    I am a bit confused by this part:

    Session handler in it’s turn generates
    the session id from the settings it
    got injected. And from there injects
    the session id and other settings
    relevant to the that storage service.

    You already said that the session handler is dependent on the storage service. It would be a bad idea for the storage service to also have some dependency on session handler, because then your initialization process is way more complex and error prone than it needs to be.

    So here’s the question: what settings does the storage service need from the session handler? Can you remove any or all of these dependencies from the storage service? If so, you should do so.

    As a practical example: let’s say the storage service supports storage of data as named blobs (which may be implemented as files, or as rows in a database table, or whatever else). You use a name dependent on the session id to store the session data. What you need to do is not tell the storage service what the session id is, but have the session handler remember it instead and provide that information to the storage service only whenever it uses storage functionality.

    In other words, try to keep your data grouped logically. Is there a specific problem that prevents you from doing so?

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

Sidebar

Related Questions

Hey guys, this is my first time actually posting at stackflow but i've used
Hey all, my first post :D Problem: I'm trying to make a template gallery,
Hey all, first post and a noob in Android programming, but willing to learn!
Hey, first time post, I'm really stuck on httplib2. I've been reading up on
Hey, long time listener first time caller, and I'm asking a question related to
Hey i got a problem that might be easily solved, but i can't seem
Hey, this is my first post on stackoverflow. I'm trying to replace é with
Hey everyone, this is my first post up on StackOverflow! WOO! Anyhow, onto my
Hey guys, first time using stackoverflow. can you guys help me debug? Heres the
Hey everyone, my first time trying to draw a multi-color gradient in actionscript 3.

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.