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 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

I have a process where an incoming user request to our system is being
While debugging an issue with our system, I have discovered a thread contention that
I have a library that interacts with our phone system, ie, Hey phone, call
I have a C# app that subscribes to a topic on our messaging system
In our application, we have a number of Windows Services (more than 30) that
I am trying to construct a serialisation system for our application that must be
We have a number of MSMQ queues throughout our system, both private and public
We have a number of small projects within our system running on Linux (Slackware
I have a number laptops that run our application while connected to each other
I have inherited a Java project which includes a number of classes that are

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.