# cpl_core.application

## cpl_core.application.application_abc

class cpl_core.application.application_abc.ApplicationABC(config: ConfigurationABC, services: ServiceProviderABC)

  Bases: `ABC`

  ABC for the Application class

  > config: `cpl_core.configuration.configuration_abc.ConfigurationABC`

  >   Contains object loaded from appsettings

  > services: `cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC`

  >   Contains instances of prepared objects

  abstract configure()

    Configure the application

    Called by `cpl_core.application.application_abc.ApplicationABC.run`

  abstract main()

    Custom entry point

    Called by `cpl_core.application.application_abc.ApplicationABC.run`

  run()

    Entry point

    Called by custom Application.main

  async run_async()

    Entry point

    Called by custom Application.main

## cpl_core.application.application_builder

class cpl_core.application.application_builder.ApplicationBuilder(app: Type[ApplicationABC])

  Bases: `ApplicationBuilderABC`

  This is class is used to build an object of `cpl_core.application.application_abc.ApplicationABC`

  > app: Type[`cpl_core.application.application_abc.ApplicationABC`]

  >   Application to build

  build() → ApplicationABC

    Creates custom application object

    > Object of `cpl_core.application.application_abc.ApplicationABC`

  async build_async() → ApplicationABC

    Creates custom application object async

    > Object of `cpl_core.application.application_abc.ApplicationABC`

  use_extension(extension: Type[Union[ApplicationExtensionABC, StartupExtensionABC]])
  use_startup(startup: Type[StartupABC])

    Sets the custom startup class to use async

    > startup: Type[`cpl_core.application.startup_abc.StartupABC`]

    >   Startup class to use

## cpl_core.application.application_builder_abc

class cpl_core.application.application_builder_abc.ApplicationBuilderABC(*args)

  Bases: `ABC`

  ABC for the `cpl_core.application.application_builder.ApplicationBuilder`

  abstract build() → ApplicationABC

    Creates custom application object

    > Object of `cpl_core.application.application_abc.ApplicationABC`

  abstract async build_async() → ApplicationABC

    Creates custom application object async

    > Object of `cpl_core.application.application_abc.ApplicationABC`

  abstract async use_startup(startup: Type[StartupABC])

    Sets the custom startup class to use async

    > startup: Type[`cpl_core.application.startup_abc.StartupABC`]

    >   Startup class to use

## cpl_core.application.startup_abc

class cpl_core.application.startup_abc.StartupABC

  Bases: `ABC`

  ABC for the startup class

  abstract configure_configuration(config: ConfigurationABC, env: ApplicationEnvironmentABC) → ConfigurationABC

    Creates configuration of application

    > config: `cpl_core.configuration.configuration_abc.ConfigurationABC` env: `cpl_core.environment.application_environment_abc`

    > Object of `cpl_core.configuration.configuration_abc.ConfigurationABC`

  abstract configure_services(service: ServiceCollectionABC, env: ApplicationEnvironmentABC) → ServiceProviderABC

    Creates service provider

    > services: `cpl_core.dependency_injection.service_collection_abc` env: `cpl_core.environment.application_environment_abc`

    > Object of `cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC`