=============== sup-di Composer =============== The ``sup-di-composer`` application is a command-line tool for executing dependency injection configurations. It provides a convenient way to test, debug, and automate DI workflows. **Command-Line Options** + ``-h`` or ``--help``: Display usage information. + ``-f `` or ``--file ``: Load, parse, and execute the specified XML file. Example usage: .. code-block:: sh ./sup-di-composer --file example.xml **Use Cases** 1. **Dynamic Configuration**: Modify object graphs and dependencies at runtime by editing the XML configuration. 2. **Testing and Debugging**: Quickly test DI configurations without modifying the source code. 3. **Automation**: Integrate ``sup-di-composer`` into build pipelines or scripts for automated testing and deployment. **Example** With the following code compiled as a shared library named libdi-test.so: .. code-block:: c++ #include #include #include const std::string PRINT_STRING_NAME = "PrintString"; bool PrintStringFunction(std::string str) { std::cout << str << std::endl; return true; } const bool PrintStringRegistered = sup::di::GlobalObjectManager().RegisterGlobalFunction( PRINT_STRING_NAME, PrintStringFunction); And the following XML configuration, example.xml: .. code-block:: xml ./libdi-test.so HelloWorld Hello, World! PrintString HelloWorld Run the ``sup-di-composer`` tool with the XML file: .. code-block:: sh ./sup-di-composer --file example.xml Expected output: .. code-block:: text Hello, World! This workflow demonstrates how ``sup-di`` simplifies the process of creating, managing, and testing object graphs and dependencies. By leveraging ``sup-di-composer``, developers can focus on building functionality while ``sup-di`` handles the complexity of dependency management.