Windows Live Agents: Structuring data into n-tiers

BuddyScript doesnt supports classes, but leaves you a certain degree of flexibility to at least structure the code in tiers.

Today I'm a bit lazy to post code, so I'll just explain how we create our agents logic.

First of all, we have a DAL folder in which we place all the data retrieval code (whenever it's from external sources or files). XML and text file loaders, DataTables and Datasources go here.

Then we have a BLL folder in which we place all the logic. At this layer/tier, initially we don't use any DataTable or Datasources, I prefer handling lists of "buddyscript objects".

At last, we'll probably use the Chat folder the WLA template creates to store conversation handling. It's not always possible (mostly if you start doing asynchronous stuff, you'll be forced to put more code in the BLL), but helps too. You can think of it as the Presentation Layer.

I'm hoping to have more "free" time at work to try more advanced things, like trying to apply design patterns, but it's not easy not having interfaces and classes :/

Also, it has a nice feature I want to use somewhere... a Javascript-like eval }:)
Used carefully can be really powerful...

Comments?

Posted by Kartones on 2007-10-29