refactor: modularize Beam into new projects and interfaces

- Introduced modularity by splitting Beam into new projects: Beam.Abstractions, Beam.Models, and Beam.Downloaders.
- Refactored existing classes into appropriate namespaces and projects.
- Replaced specific implementations with abstractions (e.g., SourceLinkBuilder to LinkBuilder, State to IState, etc.).
- Updated interfaces: added ITemplate, IArticleData, IDownloadReport, and others for improved extensibility.
- Removed deprecated classes like SourceLinkBuilder and StateChangerFactory.
- Enhanced link handling in downloaders by refactoring to use `string` over `SourceLink`.
- Consolidated shared logic under Beam.Abstractions.
This commit is contained in:
qwsdcvghyu89
2025-09-22 01:51:46 +10:00
parent a7d148a96f
commit 7ed05abdb8
128 changed files with 2058 additions and 1804 deletions
+46
View File
@@ -0,0 +1,46 @@
using aeqw89.DataKeys;
using Beam.Abstractions;
namespace Beam.Dynamic {
/// <summary>
/// <para>
/// A collection of specific useful methods and constants that facilitate the use of the application; allows other parts of the application to depend on architecture-specific arbitrary choices without compromising the Single-Responsibility principle or increasing redundant code.
/// </para>
/// </summary>
public partial interface IArchitecture {
///// <summary>
///// Gets the metadata associated with a <see cref="ResourceDictionary"/>
///// </summary>
///// <param name="web">The web client to use when downloading <see cref="WebResource"/>s</param>
///// <param name="pieceKey">The key of the <see cref="ResourceDictionary"/> stored in the <paramref name="sdd"/></param>
///// <param name="sdd">The <see cref="BeamDataDictionary"/> to be used to retrieve information</param>
///// <param name="logger">Optional logger for logging debug information</param>
///// <returns>A <see cref="DownloadContext{T}"/> object with the required information to perform the download</returns>
//public DownloadContext<IDocumentMetaData>? GetMeta(HtmlWeb web, DataKey<ResourceDictionary> pieceKey, BeamDataDictionary sdd, CancellationToken ct = default, ILogger? logger = null);
///// <summary>
///// Gets the <see cref="DownloadContext{T}"/> of the text record associated with <see cref="ResourceDictionary"/>
///// </summary>
///// <param name="web">The web client to use when downloading <see cref="WebResource"/>s</param>
///// <param name="pieceKey">The key of the <see cref="ResourceDictionary"/> stored in the <paramref name="sdd"/></param>
///// <param name="sdd">The <see cref="BeamDataDictionary"/> to be used to retrieve information</param>
///// <param name="metadata">Optional book metadata to include with the final text record</param>
///// <param name="logger">Optional logger for logging debug information</param>
///// <returns>A <see cref="DownloadContext{T}"/> object with the required information to perform the download</returns>
//public DownloadContext<IDocument>? GetTextRecord(HtmlWeb web, DataKey<ResourceDictionary> pieceKey, BeamDataDictionary sdd, IDocumentMetaData? metadata = null, CancellationToken ct = default, ILogger? logger = null);
/// <summary>
/// The <see cref="DataKey{IDocumentMetaData}"/> to use when looking for the chapter metadata
/// </summary>
public DataKey<IDocumentMetaData> ChapterKey { get; set; }
/// <summary>
/// The <see cref="DataKey{IDocumentMetaData}"/> to use when looking for the book metadata
/// </summary>
public DataKey<IDocumentMetaData> BookKey { get; set; }
/// <summary>
/// The default architecture
/// </summary>
public static IArchitecture Default => new MainArchitecture();
}
}