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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:18:23+00:00 2026-05-15T07:18:23+00:00

In our system, we have a number of classes whose construction must happen asynchronously.

  • 0

In our system, we have a number of classes whose construction must happen asynchronously. We wrap the construction process in another class that derives from an IConstructor class:

class IConstructor {
    public:
        virtual void Update() = 0;
        virtual Status GetStatus() = 0;
        virtual int GetLastError() = 0;
};

There’s an issue with the design of the current system – the functions that create the IConstructor-derived classes are often doing additional work which can also fail. At that point, instead of getting a constructor which can be queried for an error, a NULL pointer is returned.

Restructuring the code to avoid this is possible, but time-consuming. In the meantime, I decided to create a constructor class which we create and return in case of error, instead of a NULL pointer:

class FailedConstructor : public IConstructor
    public:
        virtual void Update() {}
        virtual Status GetStatus() { return STATUS_ERROR; }
        virtual int GetLastError() { return m_errorCode; }
    private: int m_errorCode;
};

All of the above this the setup for a mundane question: what do I name the FailedConstructor class? In our current system, FailedConstructor would indicate “a class which constructs an instance of Failed“, not “a class which represents a failed attempt to construct another class”.

I feel like it should be named for one of the design patterns, like Proxy or Adapter, but I’m not sure which.

EDIT: I should make it clear that I’m looking for an answer that adheres to, ideally, one of the GoF design patterns, or some other well-established naming convention for things of this nature.

  • 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-15T07:18:24+00:00Added an answer on May 15, 2026 at 7:18 am

    I’d name it NullConstructor in line with the null object pattern, which is the pattern you’re using. See http://en.wikipedia.org/wiki/Null_Object_pattern

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

Sidebar

Related Questions

We have two tasks (T1 and T2) in our vxWorks embedded system that have
We have a query that is taking around 5 sec on our production system,
We have lots of logging calls in our app. Our logger takes a System.Type
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
in the System.Linq namespace, we can now extend our IEnumerable's to have the Any()
We have a bit of a messy database situation. Our main back-office system is
I have written an application that unit tests our hardware via a internet browser.
We have a Java product that uses a lot of FOSS/COTS software. A number
So we are trying to deprecate some of our existing classes, and have started
In the construction of our booking system client can view their bookings online. At

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.