Skip to main content
8 events
when toggle format what by license comment
May 15 at 8:40 comment added kiner_shah It's better to draw some diagrams - class diagram, state machine diagram. These can help you to refine your design. One suggestion I can think of is to introduce callbacks. Like if a state is reached, call the callback function which in your case, will trigger something in Algorithm2.
Mar 7 at 20:32 review Close votes
Mar 12 at 3:01
Mar 7 at 20:17 comment added gnat please don't cross-post: stackoverflow.com/questions/79491997/… "Cross-posting is frowned upon as it leads to fragmented answers splattered all over the network..."
Mar 7 at 18:45 history became hot network question
Mar 7 at 14:27 answer added Doc Brown timeline score: 3
Mar 7 at 12:39 comment added Filip Milovanović Along the same lines, I don't particularly like that 'inData' is shared/accessible at the algorithm level, especially if not all algorithms use all of inData. I'd be more inclined towards algorithm-specific inputs with less generic type names, extracted from inData by, say, your Manager class. Think of ctor params as configuring the object in general, and of method params as pertaining to a particular call, then decide which inputs to pass to the ctor vs the execute method. But I don't know enough about the project, so maybe there's good justification for the way it's currently designed.
Mar 7 at 12:38 comment added Filip Milovanović If there is no compelling reason (such as polymorphism) to make all the algorithms have the same interface (execute()), then I would actually prefer option 3, except that I'd only pass the state (a copy of it) to algorithm 2. This communicates that this specific algorithm requires additional, just-in-time information in order to run. If that's not feasible, then I'd consider other options.
Mar 7 at 10:37 history asked Rares Dima CC BY-SA 4.0