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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:32:32+00:00 2026-05-31T16:32:32+00:00

I’m building a pet software that the description is: a shell on the web.

  • 0

I’m building a pet software that the description is: “a shell on the web”. I’ll do a shell to comunicate with API mainly to agilize all tasks you do frequently on the web.

I need help to how design this software in .NET 4 (C#).

I’m in the beginning and the Software was separated in 3 DLL: a UI -> Connector -> Commands[]. (Is not 3 DLL because each command is in a separate DLL)

UI execute a command that was in another .dll using Connector Project which has an interface that a Command Project implement. Using reflection (in UI) I execute the implementation of that Interface, so all commands are independent and separate from the main project.

In that Connector project a have a type named Shell which is a facilitator to send the output to the UI. So when someone is building a Command he will send texts or other stuff like using System.Console of the .Net framework.

I really want to keep this SHELL class static, but that class have state and each Request must have a independent state. So, by my knowledge a static class will have a lifetime for Application Pool. I’m correct?

  • 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-31T16:32:33+00:00Added an answer on May 31, 2026 at 4:32 pm

    If you recognize that Shell must have state, then it shouldn’t be static. No matter if it’s a console app or a web application. One thing is that you can use it safely in a single thread app where you know no-one else uses your class, but a very different thing is that that’s a good design.

    If your class has some kind of configuration that needs to be shared for many functions and all the instances, it’s ok to declare static properties or fields for that data. But the data which need to be different for different threads, must be non-static.

    Besides, in a multi-thread environment, like a web app, you must design your class so that it’s thread safe, or you’ll run into troubles. If you have a class that hast static methods, but not static data, then you don’t have to worry about thread-safety.

    As long as the “life expectancy” of your static class in a web app, it will survive a number of requests, but remember that the main thread of the web server will restart automatically from time to time (depending on IIS configuration) so that you can’t trust on static members to keep data “for ever”. You should set-up your static data on Application Start event, and should store changed data in a permamnet store (generally a database) to assure it can be recovered after an application restart.

    So you’re better off changing your class design. That shouldn’t suppose doing many changes in your console app (apart from using a few more new’s).

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.