In this installment of the series we will be looking at the software stack of LightSwitch HTML Client.
The LightSwitch HTML Client architecture is built on the MVVM (Model View ViewModel) pattern which is an adaptation of the MVC (Model View Controller) pattern. These patterns provide for much better separation of concerns and more maintainable code.
The Stack Components
- Base. This layer provides functionality used by all the other layers. It mostly builds on and uses the fundamental concepts taken from the WinJS library, such as namespaces, classes, events and promise objects.
- Model. This layer implements loading, parsing and processing of the LightSwitch application model. The model is converted from its original LSML form into a standard JSON representation for quick and easy consumption at application startup.
- Shared. This layer implements the concept of a business object, which, represents a base for both entities (data) and screens (view models).
- Data. This layer implements the LightSwitch data concepts, including entities, data services and data workspaces. It depends on the datajs library for underlying communication with the LightSwitch OData service.
- View Model. This layer implements the LightSwitch view model concepts, including screens and content items. It also implements the view model for the shell, which includes application-wide commands and the LightSwitch navigation model.
- View. This layer implements the LightSwitch view concepts, including controls, layout primitives and the visualization of the shell. It depends on the jQuery and jQuery Mobile libraries for DOM manipulation and other browser communication.
The layering of the LightSwitch HTML client architecture provides a solid foundation for enterprise applications that are highly maintainable and scalable. I will be reviewing each of the library components individually in subsequent installments of this series.