Skip to content

Modular application hierarchy #3

@dnut

Description

@dnut

Currently you need a single application struct that provides all dependencies. This is typically accomplished with a single global invocation of the application macro. It would be nice if you could instead have one parent application that inherit the components from children applications. Something like this...

struct MyApp;

application! {
    self: MyApp
    children: [DataProvider]
    components: [MyService] // depends on DataComponent, which it pulls in via DataProvider
}

struct DataProvider;

application! {
    self: DataProvider
    components [DataComponent]
}

Maybe application would no longer be the right terminology. Maybe a more streamlined macro should be used.

Ideally, DataComponents could even be declared in a separate crate. But with the current design, I think the rust compiler will complain about forward compatibility issues with trait implementations if they are in separate crates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions