How medimnos/junoswift works
Main Components
• Library Core – Represented by the core entry point (JunoSwift.h and JunoSwift/Lib/Juno.swift). This is the primary interface for consumers of the library.
– Authentication.swift (authentication concerns)
– Connection.swift (handling network connections)
– Graph.swift (integration with Microsoft Graph)
– Outlook.swift and SharePoint-related code (offering specialized interactions with Office 365 services)
– NetworkClient.swift (abstracting HTTP communications)
– JunoHelper.swift and Log.swift (support services for logging and other utility tasks)
• Models – Under “JunoSwift/Models” (and the nested SharePoint directory), include data structures for SPAttachment, SPFile, SPFolder, SPList, SPListItem, and TokenStorage to model the domain data.
• Protocols – Found in “JunoSwift/Protocols”, these ensure abstraction especially for attachments and will underpin extension points.
• Resource – JunoSwift/Resource/JunoConfig.swift containing configuration or environmental details.
• Auxiliary Components – Unit tests (JunoSwiftTests directory) and Examples (the Xcode example project under the Examples directory) which provide practical instantiation and testing of the API.
Relationships and Interactions
• Consumer Application (Example App) → Library API (JunoSwift.h / Juno.swift): The app initializes and calls into the fluent APIs.
• API Core → API Modules: The core delegates specific responsibilities (e.g., authentication, network connection, logging) to their respective modules.
• API Modules ↔ Models: The API modules exchange well-defined data objects (e.g., SharePoint list items) as defined by the Models.
• API Modules → External Services: Modules like Graph.swift, Outlook.swift, and the SharePoint integrations directly interface with external services, sending requests via the NetworkClient.
• Protocols act as abstraction layers ensuring that implementations like “AttachmentActionDelegate” are pluggable and testable.
• Configuration and Logging: Centralized by JunoConfig and Log components to ensure consistent behavior and troubleshooting.
Architectural Patterns
• Layered Architecture: Separate layers for configuration, core logic (API orchestration), service integration (external API calls), and domain models.
• Abstraction/Interface Segregation: Use of protocols which decouple implementation from interface (e.g., AttachmentActionDelegate).
• Modular Design: Distinct files and directories for specific functionalities (Authentication, Connection, Graph, etc.) encourage separation of concerns and easier maintenance.