LWAS goal is to make possible the development of application logic by people who aren't programmers. Actually, the less accustomed with the programming world is a user capable of implementing LWAS flows the better. To this point we follow the goals of a CMS, making things simpler to a larger spectrum of users.

Simple flows

LWAS narrows the application logic possibilities to the point that everything is a flow of data. If you put a value into a TextBox that's obvious a data flow - the value comes from somewhere (might be an absolute value i.e. hardcoded) and goes into the TextBox's Text property. What if you want to call a method of a webpart? With LWAS you do it the same way as with the TextBox before. The webpart must have a property which will proxy method calling like in greetingsForm.Command = view The Command property as it's name suggests does something rather than just storing something.

The webpart programmer will simply get the parameters required by the method from the context available to it or from the other properties exposed by the same webpart. In the following snippet the context webpart gets a key which he uses in the next statement to store something from the webpart commander
context.DataKey = my special set of records
context.DataSource = commander.LastResult

The context webpart uses both statements (which may not appear one next the other but have to appear in that order) to do an addition to internal dictionary. That translates to
((Dictionary<string, object>)internal_dictionary).Add(this.DataKey, this.DataSource)
Later on you can use that as follows
greetingsForm.CurrentItem.Data.UserGreetings = context.Data.my special set of records.SavedGreetings

Simple access

The previous convention led to another one showcased in the examples provided: point-separated access paths to properties. LWAS silently resolves these paths regardless of the underlying object type, be it POCO, DataRow, Dictionary, indexers, collections and a lot more.

Notice that context.Data.my special set of records.SavedGreetings doesn't need to escape the spaces for what it appears to be an identifier it's actually a dictionary key - plain text. But if you have the point . character in your data you have to escape it by surrounding it with simple quotes like in greetingsForms.CurrentItem.Data.UserGreetings = 'my.point.separated.greetings'

Last edited Oct 15, 2013 at 7:45 PM by t1b1c, version 7