Class BringApplication

java.lang.Object
com.bobocode.bring.core.BringApplication

public class BringApplication extends Object
The BringApplication class provides a simple entry point to initialize and run a BringApplicationContext. It allows the user to create and configure a BringApplicationContext either by specifying a base package for component scanning or by providing a class that contains configuration information.

The class includes two static methods, run(Class) and run(String), which both perform the following steps:

  1. Create a new BringApplicationContext instance.
  2. Register Bean definitions based on the provided class or base package.
  3. Create Bean objects.
  4. Invoke Bean Post Processors.

Usage examples:


 // Example 1: Using a configuration class
 BringApplicationContext context = BringApplication.run(MyConfigurationClass.class);

 // Example 2: Using a base package for component scanning
 BringApplicationContext context = BringApplication.run("com.example.myapp");
 

The BringApplication class is designed with a private constructor to enforce the use of its static methods for initializing and running the application context.

Since:
1.0
Author:
Blyzhnytsia Team
  • Field Details

  • Constructor Details

    • BringApplication

      private BringApplication()
      Private constructor to prevent instantiation of the class. Instances of this class should be created using the static methods run(Class) or run(String).
  • Method Details