How morganstanley/composeui works
Main Components
• Shell (UI Container): At the heart of the project is the Shell component. It is responsible for hosting the UI, orchestrating hosted modules, managing layout, and providing the overall user interface. It sits at the center of the system.
• DesktopAgent: A dedicated component to manage FDC3 operations and context handling. It exposes endpoints (via a message router) and communicates with various FDC3 client modules.
• AppDirectory: A catalog or registry for available applications and modules. It provides metadata and discovery for hosted applications.
• Module Loader: A subsystem that dynamically loads native and web-based modules (or apps) into the Shell. This component addresses concerns like module lifecycle management, event handling (startup, stop, errors), and security.
• Messaging Subsystem (Message Router and Clients): A core messaging component responsible for inter-component communication. It implements the FDC3 messaging protocols and handles routing between endpoints (for instance, between the Shell, DesktopAgent, and individual modules).
• Layout Persistence: A component that is responsible for saving and restoring the UI layout state. It ensures that the user’s desktop configuration can be persisted across sessions.
• Supporting Shared Libraries/Utilities: These include common utilities (like command-line parsing and shared native methods) and abstraction layers that support the different modules.
• JavaScript/Node Modules: Managed via Lerna, these incorporate parts like the “composeui-messaging-client” and “composeui-node-launcher” for launching or interfacing with the container from the JavaScript/web side.
Relationships and Interactions
• The Shell communicates bidirectionally with the DesktopAgent and Module Loader: it hosts UI content and leverages the Module Loader to dynamically inject modules.
• DesktopAgent (along with its FDC3 messaging support) connects with the Messaging Subsystem so that intents, context updates, and data sharing can occur across components.
• The Messaging system provides the glue between the Shell, DesktopAgent, and the various modules. It exposes defined endpoints (using protocols) and uses dependency injection for flexibility.
• The AppDirectory acts as a source for application metadata and module configurations; it interacts with both the Module Loader and the Shell to discover what apps are available.
• Layout Persistence is integrated into the Shell (and possibly shared across other UI components) to save and restore window states and user configurations.
Architectural Patterns and Design Principles
• Modular / Plug-in Architecture: The system is designed as a container with a clean separation of responsibilities (module loading, messaging, layout management).
• “Dependency Injection” is used extensively, which can be noted in the project’s DI directories (e.g., in DesktopAgent and ModuleLoader).
• Compliant with FDC3 2.0 focuses on interoperability so external messaging protocols and standardized APIs are critical parts of the design.
Final Recommendation
• Use annotations to indicate where architectural patterns (like dependency injection or messaging standards) are applied.
• That all components are distinctly labeled with both their technology stack (e.g., “.NET – DesktopAgent”, “JS – Messaging Client”) and their functional role in the overall UI container architecture.
• Finally, include notes that explain the relationships (e.g., “Shell uses Module Loader to inject web or desktop modules”, “DesktopAgent communicates via the messaging subsystem to enact FDC3 intents”) to provide context.