needle icon indicating copy to clipboard operation
needle copied to clipboard

Feature Request: Handle inheritance with Dependencies

Open rudro opened this issue 6 years ago • 4 comments

When a dependency is declared that is used by some Component in the system, it must directly inherit from NeedleFoundation.Dependency. You can't have some other dependency and then add to it by using it as a parent. Would be nice if needle looked at protocol inheritance and considered the union of all the properties.

rudro avatar Aug 24 '18 17:08 rudro

Note: This is unlikely to make it in 1.0. Would be nice to add this in 1.1.

rudro avatar Aug 24 '18 17:08 rudro

As discussed today, we might introduce a new "dependency packs" concept, such as the following:

public protocol MyBaseDependencyPacks: DependencyPacks {
    var commonObj1: Obj1 { get }
    var commonObj2: Obj2 { get }
    var commonObj3: Obj3 { get }
    var commonObj4: Obj4 { get }
}

public protocol SomeScopeDependency: Dependency, MyBaseDependencyPacks {
    var anObjectOnlyNeededAtThisScope: Obj { get }
}

neakor avatar Jan 31 '19 02:01 neakor

Hello there. It's been a while after last update about this question (as I have the same) and I see that DependencyPacks marked as "Not planned". Did you drop this idea at all, or decided to implement it in different way?

dehrom avatar Oct 17 '21 23:10 dehrom

Is there any update on this feature request by any chance? Do you live without by copy/pasting or is there a smarter suggested workaround?

aurelienp avatar Jul 15 '22 20:07 aurelienp