ModularPipelines icon indicating copy to clipboard operation
ModularPipelines copied to clipboard

Add DependencyFor attribute.

Open ArkaHnat opened this issue 1 year ago • 5 comments

I added DependencyForAttribute as it would be good to be able to define dependencies also on dependent modules.

ArkaHnat avatar Apr 18 '24 05:04 ArkaHnat

Heya @ArkadiuszHnat

I'm not sure I want to do something like this. I don't really understand the benefit of it, especially when we've already got the DependsOn attribute. What problem is it solving?

It also wouldn't work if a module came packaged up in a library. You'd no longer have control over it's definition so wouldn't be able to use this attribute.

thomhurst avatar Apr 18 '24 06:04 thomhurst

In my opinion it incrases flexiblity. Nuke-build is using similar approach.

For example we can have modules hierarchy like this:

TopModule
   -->DepModule1
   --> DepModule2
   -->DepModule3

Then you can remove any of those modules without modification of TopModule.

Regarding packkaged modules. I'm not sure if I understand correctly but wouldn't we have similar situation with DependsOn if we will miss dependency?

ArkaHnat avatar Apr 18 '24 13:04 ArkaHnat

But if a module depends on another, you must specify that attribute. The compiler will force you to via the analyzers. So even if packaged up, it's still forced to have that attribute on it.

Then you can remove any of those modules without modification of TopModule.

But that's the existing behaviour. DepModule1 says it Depends on TopModule. You can then delete DepModule1 and nothing needs to change.

thomhurst avatar Apr 18 '24 18:04 thomhurst

We might not understand ourselves and probably talking about different cases. If you will look into ModularPipelines.Examples there is DependencyForReliantModule which is dependency for ReliantModule (really suprising;)). I can remove DependencyForReliantModule without need of modification of ReliantModule

ArkaHnat avatar Apr 19 '24 11:04 ArkaHnat

@ArkaHnat honestly I just think this makes it more confusing. It makes sense for a module to declare what it depends on, so it knows not to start before others. But the other way round doesn't make sense, because a module doesn't need to know what depends on it in order to do anything.

thomhurst avatar May 12 '24 17:05 thomhurst