Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is "chain" delegation bad design?

Tags:

objective-c

Is it "alright" to "chain" delegate?

Object A delegates to Object B which in turns delegate the same method to Object C …

I have a view that needs data from a model connected to it's view controller's parent view controller. Basically there are 2 VCs between the view and the model.

Or is there a better way to do it.

like image 571
WanderingInLimbo Avatar asked Aug 02 '11 10:08

WanderingInLimbo


1 Answers

There is no "good" or "bad" patterns.

You should use your common sense to know whether your "chain" delegation makes sense or not.

  • Will it make future changes easier?

  • Is the code more independently modularized that way?

  • Is this chain delegation just bloating the code uselessly?

...there is no "good" or "bad". Some patterns fit better in some situations, some in others ...and usually the most direct way is the best.

like image 107
dagnelies Avatar answered Oct 17 '22 07:10

dagnelies