Botframework-sdk: [Question] How to prevent code bloat for dialogs?

Created on 20 Nov 2017  路  4Comments  路  Source: microsoft/botframework-sdk

Bot Info

  • SDK Platform: Node.js
  • SDK Version: 3.9.1
  • Active Channels: Any
  • Deployment Environment: ngrok

Issue Description

Currently each dialog on bot is a function array that need to be preregistered at server start up.

It leads to 2 problems.

  1. Code bloat. As the function array or callstack functions have to be created for each and every dialog at server start up time and registered with the bot. If I have have 500 dialogues ( which is the case in my app) this leads to a huge code bloat.
  2. It does not allow to change the callstack at run time for each session. In a way the call sequence becomes static.

Code Example

callStack = [ fn1, fn2, fn3]
bot.dialog(id, callStack)

Expected Behavior

Is there a way not to define the callStack upfront that is common for all users of that dialog. The dialog should be able to jump to functions that are data driven than code driven. ie. generic functions.

e.g. two dialogues one wants to get date and another wants to get text. They can use the same function but invoke the necessary code to prompt a date or text based on passed params to that function.
The function should have a way to get additional params passed to it.

This change in design pattern is needed to prevent code bloat and provide some dynamic behavior.

Most helpful comment

@ubreddy You are in luck. The Bot Framework team is actually in the process of a complete re-write of the BotBuilder SDK dialog system in the v4 line.

Stay tuned for updates and SDK v4 preview early next year.

All 4 comments

@ubreddy You are in luck. The Bot Framework team is actually in the process of a complete re-write of the BotBuilder SDK dialog system in the v4 line.

Stay tuned for updates and SDK v4 preview early next year.

Great! looking forward to it. Hope we can get early in Jan ? or am I being ambitious :)

that's the plan

@nwhitmont Any date finalized for this SDK release ? or can we have a preview of the new design before the release?

Was this page helpful?
0 / 5 - 0 ratings