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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:03:54+00:00 2026-05-27T13:03:54+00:00

we have to control some hardware, due to driver’s limitation all calls shall comes

  • 0

we have to control some hardware, due to driver’s limitation all calls shall comes from the same caller object, so i implemented as singleton pattern.

the driver might hang, in this case it has to be killed and the application shall try to initiate it again… so i modified the singleton as resurrect-able – sorry i just coined this term as i don’t know what’s the correct one.
basically its life style is like this:
not exist => singleton #1 => hang => killed => singleton #2 …

during code review my colleague said he never seen such singleton before, as he understands a singleton is THE only one during whole application lifetime….

is there such a “resurrect-able singleton” design pattern? is there some pitfalls i shall be aware?

oh i’m using C#, though i take this more a general OO design topic…

  • 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-27T13:03:54+00:00Added an answer on May 27, 2026 at 1:03 pm

    The singleton pattern doesn’t really apply here, since you said yourself more objects need to be created.

    I would suggest you use something similar to a factory pattern instead:

    • call factory.get()
    • if no objects exist, create a new object
    • if an object exists and is valid, return it
    • if an object exists and is hanging, kill it and create a new object

    You implement a factory such that there is only one object created at a time.

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

Sidebar

Related Questions

I have control, subclassed from CDialogBar, it has some buttons(like on toolbar). When I
I have some control like <ListBox ItemsSource={Binding tests, UpdateSourceTrigger=PropertyChanged} ItemTemplate={StaticResource TestTemplate} /> When user
Let's say I have some Control that has been disabled. It contains a bunch
I am working for an intranet application. Therefore I have some control on the
Some code that I don't have control over is overriding the global JSON object
I have a control that goes inactive under some conditions in my iPhone app.
I have a JQuery control which has some private methods. I would like to
I have got 5 user controls placed in some Control folder, at run time
I have a FrameLayout view which contains one (MapView-like) control and some additional buttons
I have a custom control which displays results of some operations. It is hidden

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.