Reputation: 1837
I've been playing around with the bot framework and have created a new bot using the LUIS engine based on Azure Functions. My main code at the moment is in the CSX file, but I quickly run in to the point where that doesn't feel like it's the right thing to do.
So I was trying to find some best practices on how to best structure these kinds of projects. At the moment I see the following three things that in my opinion need to be separated:
What I'm looking for is some real world experience on how to set-up an architecture that a) works and b) is usable. And with usable I mean: of course one can create micro services for each little thing, but how to deal with maintenance, source control, updates and all of that stuff. I very much understand that there is probably not one correct answer, but something that points in the right direction would be very helpful to start.
Upvotes: 0
Views: 214
Reputation: 1344
Well it's quite broad question. And I will try to cover as much as I can. So first of all I will highly recommend you going through the C# documentation. There should be fundamentally no difference between CSX and your CS classes. If things feel too hard or you need an IDE experience you can always create a Visual Studio project with all your logic that you will have; and then use the compiled binary assemblies in your function linking the classes.
I think the framework itself provides you with the basic building blocks and then leaves it to your imagination just like any good framework should. The way to organize your code is too subjective. My opinion may not match with what you might have, and there is not fixed patterns like MVC or MVVM here. I usually try to organize my code into 2 parts.
Now in case of really huge projects I will probably build nugets out of these layers and reuse it as imported packages in your CSX. In that case the CSX part is really like router, it gives you debugability, local testability via emulator and testcases, and it can be easily deployed by CI just by pushing changes to packages.json
.
Upvotes: 1