Current Status: Alpha - Actively developed, expect bugs, contributions welcome!
BeepDM is a modular, extensible data management engine designed to streamline connecting, managing, and synchronizing data across diverse sources. It provides a robust framework for developers, supporting databases, files, and in-memory stores with programmatic control over connections, data movement, and entity management.
- Modular Architecture: Flexible components for data sources, ETL, workflows, and add-ins.
- Wide Data Source Support: Connect to databases (e.g., SQLite, SQL Server), files (e.g., CSV, XLS), APIs, and in-memory stores via
IDataConnectionandIRDBSource. - Data Synchronization:
DataSyncManagerfor real-time or scheduled sync with metrics and logging. - Entity Management:
UnitofWork<T>for CRUD operations, change tracking, and transactional commits. - ETL & Import:
DataImportManagerfor transforming and importing data with batch processing. - Dependency Injection: Supports Microsoft.Extensions.DependencyInjection and Autofac.
- Configuration Management: Centralized settings via
IConfigEditor. - Extensibility: Add custom functionality with
IDM_Addinand extend connections/data types.
These are the primary interfaces driving BeepDM’s functionality:
IDMEEditor: The mother class, orchestrating all components below. Acts as the central hub for data management operations.IConfigEditor(ConfigEditor): Manages framework configurations (e.g.,DataDriversClasses,DataTypesMap,QueryList,DataConnections), persisting them to JSON files.IDataSource: Defines the contract for all data source implementations (e.g., SQLite, XLS), providing methods likeGetEntity,CreateEntityAs, andUpdateEntities.IETL: Handles Extract, Transform, and Load operations for data integration.IDataTypesHelper: Manages data type mappings and configurations, supportingIDataSourcetype translation.IUtil: Provides common utility functions used across the engine.IAssemblyHandler: Loads assemblies and extracts implementations (e.g.,IDataSource, drivers,IDM_Addin, extensions).IErrorsInfo: Handles error reporting and management.IDMLogger: Manages logging across the framework.IJsonLoader: Handles loading and saving JSON configuration files.IClassCreator: Generates classes/types for data source entities.IWorkFlowEditor: Manages data workflows.IWorkFlowStepEditor: Manages individual steps/stages within workflows.IRuleParser: Parses data rules used in workflows.IRulesEditor: Manages data rules configuration.
Every BeepDM project follows this directory structure:
- Addin: Stores DLLs implementing the
IDM_Addininterface (e.g., user controls, forms, classes). - AI: Stores AI scripts (for future use).
- Config: Contains configuration files:
QueryList.json: Defines query types for retrieving metadata from data sources.ConnectionConfig.json: Defines drivers, data source classes, and metadata (e.g., icons).DataTypeMapping.json: Maps data types between data sources.DataConnections.json: Stores data source connection details.
- ConnectionDrivers: Holds data source driver DLLs (e.g., Oracle, SQLite, SQL Server).
- DataFiles: Primary storage for project data files.
- DataViews: Stores JSON files for federated views of data source entities.
- Entities: Temporary storage for data source entity descriptions.
- GFX: Stores graphics and icons used by the application.
- LoadingExtensions: Contains classes implementing
ILoaderExtentionto dynamically load additional functionality. - Mapping: Stores mapping definitions between data sources.
- OtherDLL: Holds miscellaneous DLLs required by the application.
- ProjectClasses: Primary folder for loading custom implementations (e.g.,
IDataSource, add-ins). - ProjectData: Stores project-specific files.
- Scripts: Stores scripts and logs.
- WorkFlow: Stores workflow definitions.
BeepDM is in alpha and offers programmatic control over data operations. Below are examples using Autofac to demonstrate core functionality with IDataSource-based data sources.
- .NET Framework or .NET Core (specific version TBD).
- NuGet packages:
Autofac. - Database drivers (e.g., SQLite) or file access for your data sources.
- Clone the repository:
git clone https://github.com/The-Tech-Idea/BeepDM.git
- Open the solution in Visual Studio.
- Restore NuGet packages.
- Build the project.
After bootstrapping with IBeepService, perform these steps to populate ConfigEditor with defaults, enabling IDataSource operations:
Populates ConfigEditor.DataDriversClasses with default drivers.
using TheTechIdea.Beep.Container;
using TheTechIdea.Beep.Helpers;
beepService.AddAllConnectionConfigurations();Populates ConfigEditor.DataTypesMap with default type mappings.
using TheTechIdea.Beep.Container;
using TheTechIdea.Beep.Helpers;
beepService.AddAllDataSourceMappings();Populates ConfigEditor.QueryList with default SQL queries for RDBMS.
using TheTechIdea.Beep.Container;
beepService.AddAllDataSourceQueryConfigurations();using Autofac;
using TheTechIdea.Beep.Container;
using TheTechIdea.Beep.Container.Services;
static void Main()
{
var builder = new ContainerBuilder();
BeepServicesRegisterAutFac.RegisterServices(builder);
var container = builder.Build();
BeepServicesRegisterAutFac.ConfigureServices(container);
var beepService = BeepServicesRegisterAutFac.beepService;
// Initialize for IDataSource support
beepService.AddAllConnectionConfigurations();
beepService.AddAllDataSourceMappings();
beepService.AddAllDataSourceQueryConfigurations();
}Ensure data source configurations are registered in ConfigEditor. The initialization steps add defaults for common IDataSource implementations (e.g., SQLite, XLS). Custom data sources require additional setup (see "Extending BeepDM").
IDMEEditor must be initialized to use BeepDM. Here’s an implementation using Autofac:
using Autofac;
using TheTechIdea.Beep;
using TheTechIdea.Beep.ConfigUtil;
using TheTechIdea.Beep.Container.Services;
using TheTechIdea.Logger;
using TheTechIdea.Util;
static void Main()
{
var builder = new ContainerBuilder();
builder.RegisterType<DMEEditor>().As<IDMEEditor>().SingleInstance();
builder.RegisterType<ConfigEditor>().As<IConfigEditor>().SingleInstance();
builder.RegisterType<DMLogger>().As<IDMLogger>().SingleInstance();
builder.RegisterType<Util>().As<IUtil>().SingleInstance();
builder.RegisterType<ErrorsInfo>().As<IErrorsInfo>().SingleInstance();
builder.RegisterType<JsonLoader>().As<IJsonLoader>().SingleInstance();
builder.RegisterType<AssemblyHandler>().As<IAssemblyHandler>().SingleInstance();
var container = builder.Build();
BeepServicesRegisterAutFac.ConfigureServices(container);
var beepService = BeepServicesRegisterAutFac.beepService;
// Initialize framework
beepService.AddAllConnectionConfigurations();
beepService.AddAllDataSourceMappings();
beepService.AddAllDataSourceQueryConfigurations();
}- All features are pluggable; replace implementations (e.g.,
DMLoggerwithYourLogger) as needed.
using TheTechIdea.Beep.ConfigUtil;
using TheTechIdea.Beep.DataBase;
var config = beepService.DMEEditor.ConfigEditor.DataDriversClasses
.FirstOrDefault(p => p.DatasourceType == DataSourceType.SqlLite);
if (config == null)
throw new Exception("SQLite config not found in ConfigEditor.DataDriversClasses.");
var connProps = new ConnectionProperties
{
ConnectionString = "Data Source=./Beep/dbfiles/northwind.db",
ConnectionName = "northwind.db",
DriverName = config.PackageName,
DriverVersion = config.version,
DatabaseType = DataSourceType.SqlLite,
Category = DatasourceCategory.RDBMS
};
beepService.DMEEditor.ConfigEditor.AddDataConnection(connProps);
var sqliteDB = (SQLiteDataSource)beepService.DMEEditor.GetDataSource("northwind.db");
sqliteDB.Openconnection();
if (sqliteDB.ConnectionStatus == ConnectionState.Open)
Console.WriteLine("SQLite connection opened successfully");-
Implement
IDataSource:using System; using System.Collections.Generic; using System.Data; using TheTechIdea.Beep; using TheTechIdea.Beep.DataBase; [AddinAttribute(Category = DatasourceCategory.CLOUD, DatasourceType = DataSourceType.WebService)] public class AzureCosmosDataSource : IDataSource { public string GuidID { get; set; } = Guid.NewGuid().ToString(); public event EventHandler<PassedArgs> PassEvent; public DataSourceType DatasourceType { get; set; } = DataSourceType.WebService; public DatasourceCategory Category { get; set; } = DatasourceCategory.CLOUD; public IDataConnection Dataconnection { get; set; } public string DatasourceName { get; set; } public IErrorsInfo ErrorObject { get; set; } public string Id { get; set; } public IDMLogger Logger { get; set; } public List<string> EntitiesNames { get; set; } public List<EntityStructure> Entities { get; set; } = new List<EntityStructure>(); public IDMEEditor DMEEditor { get; set; } public ConnectionState ConnectionStatus { get; set; } public string ColumnDelimiter { get; set; } = "''"; public string ParameterDelimiter { get; set; } = ":"; public AzureCosmosDataSource(string name, IDMEEditor editor) { DatasourceName = name; DMEEditor = editor; } public ConnectionState Openconnection() { /* Implement */ return ConnectionState.Open; } public ConnectionState Closeconnection() { /* Implement */ return ConnectionState.Closed; } public bool CheckEntityExist(string EntityName) { /* Implement */ return false; } public bool CreateEntityAs(EntityStructure entity) { /* Implement */ return false; } public object GetEntity(string EntityName, List<AppFilter> filter) { /* Implement */ return null; } public IErrorsInfo UpdateEntities(string EntityName, object UploadData, IProgress<PassedArgs> progress) { /* Implement */ return null; } // Implement other IDataSource methods... public void Dispose() { /* Implement cleanup */ } }
-
Add to
ConfigEditor:- Place driver DLLs (if needed) in
ConnectionDrivers. - Update
ConnectionConfig.jsonor use the Beep Enterprize Winform app:var driver = new ConnectionDriversConfig { GuidID = "azure-cosmos-guid", PackageName = "AzureCosmos", DriverClass = "AzureCosmos", version = "1.0.0", DbConnectionType = "AzureCosmosConnection", ConnectionString = "AccountEndpoint={Host};AccountKey={Password};Database={Database};", classHandler = "AzureCosmosDataSource", DatasourceCategory = DatasourceCategory.CLOUD, DatasourceType = DataSourceType.WebService, ADOType = false }; beepService.DMEEditor.ConfigEditor.DataDriversClasses.Add(driver);
- Place the DLL in
ProjectClasses.
- Place driver DLLs (if needed) in
-
Implement
IDM_Addin:using TheTechIdea.Beep; using TheTechIdea.Beep.Addin; [AddinAttribute(Caption = "Copy Entity Manager", Name = "CopyEntityManager", misc = "ImportDataManager", addinType = AddinType.Class)] public class CopyEntityManager : IDM_Addin { public string AddinName => "CopyEntityManager"; public IDMEEditor DMEEditor { get; set; } public IPassedArgs Passedarg { get; set; } public IDMLogger Logger { get; set; } public IErrorsInfo ErrorObject { get; set; } public void Run(IPassedArgs pPassedarg) { var ds = DMEEditor.GetDataSource(Passedarg.DatasourceName); if (ds != null) ds.Openconnection(); // Implement logic } public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, IPassedArgs e, IErrorsInfo per) { DMEEditor = pbl; Passedarg = e; Logger = plogger; ErrorObject = per; } }
-
Deploy: Place the DLL in
AddinorProjectClasses. It will appear in the add-in tree.
-
Implement
ILoaderExtention:using TheTechIdea.Beep; using TheTechIdea.Util; public class CustomExtension : ILoaderExtention { public IAssemblyHandler Loader { get; set; } public CustomExtension(IAssemblyHandler ploader) { Loader = ploader; } public IErrorsInfo LoadAllAssembly() { var er = new ErrorsInfo(); // Custom loading logic return er; } public IErrorsInfo Scan() { var er = new ErrorsInfo(); LoadAllAssembly(); er.Flag = Errors.Ok; return er; } }
-
Deploy: Place the DLL in
LoadingExtensions.
- Alpha Phase: Core features functional, APIs may evolve.
- Contributions: Welcome! See CONTRIBUTING.md (TBD).
BeepDM is licensed under the MIT License.