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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:50:25+00:00 2026-05-16T18:50:25+00:00

I am developing a C++ application used to simulate a real world scenario. Based

  • 0

I am developing a C++ application used to simulate a real world scenario. Based on this simulation our team is going to develop, test and evaluate different algorithms working within such a real world scenrio.

We need the possibility to define several scenarios (they might differ in a few parameters, but a future scenario might also require creating objects of new classes) and the possibility to maintain a set of algorithms (which is, again, a set of parameters but also the definition which classes are to be created). Parameters are passed to the classes in the constructor.

I am wondering which is the best way to manage all the scenario and algorithm configurations. It should be easily possible to have one developer work on one scenario with “his” algorithm and another developer working on another scenario with “his” different algorithm. Still, the parameter sets might be huge and should be “sharable” (if I defined a set of parameters for a certain algorithm in Scenario A, it should be possible to use the algorithm in Scenario B without copy&paste).

It seems like there are two main ways to accomplish my task:

  • Define a configuration file format that can handle my requirements. This format might be XML based or custom. As there is no C#-like reflection in C++, it seems like I have to update the config-file parser each time a new algorithm class is added to project (in order to convert a string like “MyClass” into a new instance of MyClass). I could create a name for every setup and pass this name as command line argument.

    • The pros are: no compilation required to change a parameter and re-run, I can easily store the whole config file with the simulation results
    • contra: seems like a lot of effort, especially hard because I am using a lot of template classes that have to be instantiated with given template arguments. No IDE support for writing the file (at least without creating a whole XSD which I would have to update everytime a parameter/class is added)
  • Wire everything up in C++ code. I am not completely sure how I would do this to separate all the different creation logic but still be able to reuse parameters across scenarios. I think I’d also try to give every setup a (string) name and use this name to select the setup via command line arg.

    • pro: type safety, IDE support, no parser needed
    • con: how can I easily store the setup with the results (maybe some serialization?)?, needs compilation after every parameter change

Now here are my questions:
– What is your opinion? Did I miss
important pros/cons?
– did I miss a third option?
– Is there a simple way to implement the config file approach that gives
me enough flexibility?
– How would you organize all the factory code in the seconde approach? Are there any good C++ examples for something like this out there?

Thanks a lot!

  • 1 1 Answer
  • 1 View
  • 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-16T18:50:26+00:00Added an answer on May 16, 2026 at 6:50 pm

    I found this website with a nice template supporting factory which I think will be used in my code.

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

Sidebar

Related Questions

I am developing an application using Zend Framework 1.11.10. I have used this article
I'm part of a team developing a new web-based product for our company. Whilst
I have developing the application to fetching data from sd card. I used this
I am developing an application which could be used in small networks where the
I am developing an application in C# VS 2010 past 4 months. I used
I'm developing a windows application in C#. In my application I've used one static
We are developing a SaaS application in Asp.net, where we have used the Single
I'm currently involved with developing a C# CMS-like web application which will be used
We are planning to develop a web based application using Silverlight 2.0. The application
I am developing an application that will be primarily used by English and Spanish

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.