SAIF.Framework.Core overview¶
Documentation context: Packaged Component (NuGet)
SAIF.Framework.Core is a cross-cutting platform framework — not a business-domain library — and is the root of the SAIF.Framework.* family: it is the package other Framework4-classified libraries reference (SAIF.Framework.*), and it defines the foundational abstractions those libraries and consuming applications build on, including environment/configuration resolution, Active Directory-backed authorization, a generic data-access contract, and WCF/REST-fronted platform services.
Purpose¶
- Serve as the root framework library of the SAIF.Framework.* family: it defines the
IEnvironmentService/EnvironmentServiceBaseenvironment-configuration abstraction, theIUnitOfWork/IRepository<TEntity>data-access contract, and the Autofac-based composition pattern (ServiceRegistrations) that every downstream Framework4 library and consuming application relies on. - Provide a first-class Active Directory integration provider (
ADService,MachineSecurityService) and front two external, configurable security back ends — a WCFSecurityServiceand a REST Security API — behind framework-owned façades (SecurityGroupService,SystemUserProfile,SecurityApiClient). - Implement concrete platform services — validation, document generation, fax, imaging, PDF, print, preference, UC4, work-calendar, user-profile, email, and logging — each backed by a WCF/REST client proxy, so application code depends only on framework interfaces rather than on WCF channel plumbing.
- Consumed by downstream Framework4 libraries (project references and NuGet package consumers of
SAIF.Framework.Core) and by web/Windows applications built on the SAIF platform, via theServiceRegistrations.RegisterCoreServicesForWeb/RegisterCoreServicesForWindowsAutofac composition entry points.
Responsibilities¶
- Define and implement the environment/configuration abstraction (
IEnvironmentService,EnvironmentServiceBaseand its four concrete subclasses) with layered configuration resolution: developer-override JSON → in-memory cache → Environment API section fetch. - Provide AD group-membership lookups (
ADService) and machine-authorization gating (MachineSecurityService), used internally to determine developer-machine status and exposed as a general capability. - Front the WCF
SecurityServiceand REST Security API behind framework façades for resource/role authorization and user-profile retrieval. - Define the generic repository/unit-of-work data-access contract (
IUnitOfWork,IRepository<TEntity>,IRepositoryFactory,ISessionHelper) consumed by downstream libraries; ships only an in-memoryTestRepository/TestUnitOfWorktest double, no production implementation. - Implement validation (
FluentValidationService), document/fax/imaging/PDF/print services, user-profile services, and a REST-backed log4net appender. - Supply the Autofac composition root (
ServiceRegistrations) that consuming applications call at startup.
Key components¶
IEnvironmentService/EnvironmentServiceBase: central configuration/context contract and its four concrete environment flavors (WindowsEnvironmentService,WebEnvironmentService,WcfEnvironmentService,CustomEnvironmentService).ADService/MachineSecurityService: direct Active Directory group-membership provider and machine-authorization façade.SecurityGroupService/SystemUserProfile/SecurityApiClient: WCF and REST security façades fronting external authorization back ends.IUnitOfWork/IRepository<TEntity>/IRepositoryFactory: generic data-access abstraction (contract only; in-memoryTestRepositorytest double shipped here).FluentValidationService/ValidatorFactory: validation service built on FluentValidation and Autofac.Services.Utilities.Documents.*(DocumentService,FaxService,ImagingService,PDFService,PdfConvertAndMergeService,PrintService): WCF/SOAP-backed document processing services.UserProfileServiceand theApplicationUserProfile/ExternalUserProfile/SaifUserProfile/SystemUserProfilefamily: user-profile model and retrieval.ServiceRegistrations: Autofac composition root (RegisterCoreServicesForWeb/RegisterCoreServicesForWindows).
Related documentation¶
- Index
- Architecture
- Dependencies
- Configuration
- Operations and processes
- Business rules
- Security and authorization
- API reference
Sources¶
Core\SAIF.Core\SAIF.Framework.Core.csprojCore\SAIF.Core\SAIF.Framework.Core.nuspecCore\SAIF.Core\Core\Services\IEnvironmentService.csCore\SAIF.Core\Services.Common\EnvironmentServiceBase.csCore\SAIF.Core\Core\Services\ADService.csCore\SAIF.Core\Core\Services\MachineSecurityService.csCore\SAIF.Core\Services\ServiceRegistrations.csCore\SAIF.Core\Data\Interfaces\IUnitOfWork.cs