Replies: 1 comment 2 replies
-
I am definitely doing and going to do more method chaining, so I’ll be using this design pattern to some degree. Some of the internal refactoring I’ve been doing lately will make this much easier. It does not appear to favor to static classes, so it should still work with non-static classes, which will come in handy when we get around to streaming use cases. The link you provided is interesting because it seems to be just a bunch of methods doing micro-changes on the same class which seems kind of silly to me, but maybe it’s meant to be on overly simple example. Most of our untilities use some form of method chaining using extensions methods. It definitely makes the interface easier to use. |
Beta Was this translation helpful? Give feedback.
-
Dave,
are you aware of Fluent API interface pattern as defined by Martin Fowler many moons ago?
https://dotnettutorials.net/lesson/fluent-interface-design-pattern/
I think this pattern fits perfectly to wrap your Stock.Indicators. Writing a super-class with methods that return a normalized object (that can be passed to the next method) would need no modifications of your library at all!
I implemented it in my dev branch and it looked really nice - before I abandoned the concept:
Why did I abandon it yet I recommend it to you? Well, I'm glad you asked... :-)
Seriously, I think you should give fluent interface a try and add a new fluent class with chainable normalized methods that can pass outputs to each other!
Beta Was this translation helpful? Give feedback.
All reactions