Switch lights with MS LightSwitch

With a name like that, you know one of us had to do it.

[url]http://staceyw1.wordpress.com/2011/06/13/switch-your-lights-with-lightswitch/[/url]

Nice! In general, how do you find the “LightSwitch” development experience? See my comment on your blog about thinly wrapping the NETMF side of the code to plug in the lightswitch :smiley:

A real fancy Light switch. Good work :slight_smile:

Interesting. I also would like to hear your thoughts on LightSwitch in general.

I like LS well so for. You have to kinda buy into the metaphor. A lot more power then Access and you have native access to the whole framework. It both seperates and integrates client side and server side. Validations as run on both sides. You hook into server side events (i.e. added, changed, etc) easy. If you are used to winforms or SL free-form UI dev, then it is big difference as it lays out fields in rows or cols for you. You layout with a treeview on the left. So you don’t get free-form control as such. If you can live with that model, it saves a ton of time. Going from table design to screen is seconds instead of hours and you don’t have any middleware or network stuff to hookup as that is all done for you. A lot to like about it especially if you have done client-server apps before. Backend is SQLExpress or SQL, so full db power. One big drawback for V1 is no integrated reporting. There is a 3rd party free solution, but strange omission for v1.

Hi EricH. I read your post. But not sure what you have in mind. Could you expand on your thougt. tia

Sure thing. Background - I’ve been toying with various designs for a PC side ‘sensor manager’ service. The service needs a management UI, and LS seems to fit the bill. These days there are a lot of Model View Controller (MVC) design pattern derivatives out there (MVP, MVVM, et al) that make consuming service data very easy. If LS can take care of a basic UI (a.k.a. the View), what I’m proposing is to create a layer that exposes data from FEZ boards in a way that LS can easily digest as a discoverable service. That’s the Controller piece. So much like you point LS at sql express, you can also point it at a datasource that serves FEZ data. Make sense? The trick is to design this layer in a way that makes it easy to plug in any kind of data stream from a FEZ. Generally this can be done with well thought out interfaces, for example, maybe one for each supported protocol. The interfaces could also be component based. A diagram with few boxes and arrows would nail down the concept better than I can here. To date, I have not been totally satisifed with the combination of architectures I’ve tried to work into this sensor manager app. LightSwitch seems to be a good candidate for the UI piece, and with a clever custom data source for NETMF microcontrollers providing a data stream, I think I may have at last landed on a decent design. More to follow as I chew on this for a bit.

Microsoft thinks the same thing. You can surface a backend as a RIA service (in same LS solution), which LS can consume as a Datasource and actually “see” it as a table. It works pretty slick. I thought about doing that here, but wanted to keep the sample simple as possible. Another abstraction seemed like it would distract from the purpose. Also, making another hop into a RIA service seemed to be redundant overhead as I already have the data row needing update. But it would be another way to do this kind of thing which would also allow other clients (besides LS) to call into the same service api.

LS seems to make it fairly trivial to crank out a no frills data management app, RIA is perfect for the service piece, so now I just need to wrap up FEZ output in a decent data tier.

Here is a good link to get you started on RIA service project and using from LS. Eric is doing aggregation queries here, but you can do anything else with the same pattern.

[url]http://blogs.msdn.com/b/lightswitch/archive/2011/04/08/how-do-i-display-a-chart-built-on-aggregated-data-eric-erhardt.aspx[/url]

I’ve done a bunch of RIA/SL at my day job, which is what prompted my curiousity about LS. I’m generally skeptical of ‘do it for you’ stuff like this, as they tend to autogenerate a ton of unnecessary code that ends up masking or even creating issues (ever forced to use FrontPage?). The 80/20 rule works in this case - if LS can do 80% of what I need for a UI, I’m game. Thanks for the feedback.