SAIF.Presentation.ConsoleApplication overview¶
Documentation context: Packaged Component (NuGet)
SAIF.Presentation.ConsoleApplication is a presentation-tier base-class library (OutputType=Library, no entry point) that defines clsConsoleBase and clsBatchBase, the abstract ancestor classes consumed by actual SAIF console/batch applications elsewhere in the enterprise. Despite its folder location and "ConsoleApplication" name, it is not itself a runnable console batch application* — its build pipeline uses the NuGet packaging template rather than the console-app template, and it contains no Sub Main entry point or concrete subclass.
Purpose¶
- Provide a reusable template-method lifecycle (
Execute()→Initialize()→ValidateCommandLine()→RunAppLogic()→Uninitialize()) for command-line applications to implement by subclassingclsConsoleBaseorclsBatchBase. - Provide command-line argument parsing, exception-diagnostics formatting, and (for batch-style apps) multi-stream file logging and batch header/footer status reporting.
- Consumed by separate, actual console/batch application repositories that inherit from
clsConsoleBase/clsBatchBase; this library itself defines the base classes rather than running as an application.
Responsibilities¶
- Define the abstract lifecycle contract (
RunAppLogic,ValidateCommandLine) that concrete console/batch applications must implement. - Parse and normalize command-line arguments (
/Name:Valueor-Name:Valuestyle, case-insensitive). - Format exception diagnostics recursively, including special handling for the framework's
clsSAIFExceptiontype. - Layer multi-stream, environment-variable-driven file logging and batch header/footer reporting on top of the console base lifecycle (
clsBatchBase).
Key components¶
clsConsoleBase: rootMustInheritancestor for all SAIF console applications; owns theExecute()template method,ReturnCodesenum, command-line parsing helpers, and exception formatting.clsBatchBase:MustInherit, inheritsclsConsoleBase; adds theBatchStreamsenum, multi-stream log-file registration, and batch header/footer console reporting.
Related documentation¶
Note: Statements marked with
*are inferred from code behavior rather than explicit documentation or comments.
Sources¶
Presentation\SAIF.Presentation.ConsoleApplication\clsConsoleBase.vbPresentation\SAIF.Presentation.ConsoleApplication\clsBatchBase.vbPresentation\SAIF.Presentation.ConsoleApplication\SAIF.BOF.Presentation.ConsoleApplication.vbprojPresentation\SAIF.Presentation.ConsoleApplication\Pipelines\build.yml