One of the key goals of Crosslight is to enable code sharing at user interaction and unify the application logic layer across the supported platforms mentioned above. Crosslight made its way through diligently-engineered platform abstractions that bridges the communication and data flow between the shared application layers with the platform-specific layers.
Crosslight fills its role on platform abstractions through a layer called Crosslight Foundation. Crosslight Foundation includes a comprehensive set of frameworks that work in conjunction to allow streamlined communication with the platform-end in loosely coupled fashion. In addition to the Foundation, Crosslight is comprised of application components and services at each of the platform-end. See the following diagram for an overview of the Crosslight architecture.
As seen in the above illustration, Crosslight is architected around the .NET Framework through Microsoft’s own implementation as well as third-party .NET implementation such as Xamarin Mono frameworks. Xamarin frameworks provide comprehensive base class libraries that are on-par with Microsoft .NET Framework 4.5 as of this writing – allowing Crosslight to build its foundation to target iOS and Android in addition to Windows Phone and Windows Store.
Crosslight creates an architectural bridge between the development frameworks and the native mobile platforms through two major components – Crosslight Foundation and Crosslight UI Platforms – which are discussed in more details below.
At the heart of Crosslight architecture is the Crosslight Foundation which comprises of fundamental frameworks and core components that work together to facilitate mobile application development across various supported mobile platforms through maximized code sharing and unified application logic layer.
Crosslight Foundation includes the following core components:
- MVVM Framework
Contains a set of pre-built models, interfaces and ViewModels that can be easily consumed in the shared application layer. Many of the ViewModels – for example, the ListViewModelBase(T) Class and EditorViewModelBase(T) Class – are thoughtfully modeled based on typical business application design pattern which makes business-oriented mobile apps development a breeze.
- Application Framework
Contains application services that manage the life cycle of the Crosslight application. It also provides application initializer and application context that can be reliably accessible throughout the shared application layer as well as in the platform-specific application layer.
- Binding Framework
Contains the binding implementation that is on-par with those provided in Windows Phone and Windows Store. The binding framework serves as the core component responsible in dispatching data communication flow between the View and ViewModel, and brings the possibility to leverage MVVM design pattern to the platforms that do not support data binding such as iOS, Android and any future platforms that may be supported.
- Abstraction and Extensibility Framework
Contains high-performance and memory-efficient IoC container framework of which the entire Crosslight platforms and services stacks are built upon. The container framework is the foundation of the Service Provider in Crosslight which is designed for extensibility. It also allows you to easily create your own services abstraction, or to extend existing Crosslight services with your own.
- Command Framework
Contains delegate command implementation based on industry standards command design pattern. The command framework is essential to resemble a piece of application logic that is commonly actionable through user input, for instances, when user taps on a button, or on a menu item.
- Messaging Framework
Contains messaging infrastructure such as Event Aggregrator that allows loosely-coupled communication across multiple ViewModels, as well as between ViewModels and Views.
- User Interaction Framework
Contains user interaction components that allow you to write common user interaction logic in the shared application layer. This framework includes two major services that are essential in creating successful business-oriented mobile apps – which are navigation and presenter services. The universal navigation service lets you navigate between screens from within the shared application layer, while the presenter service allows you to present a piece of information to users commonly as the results of a certain action.
- Data Management Framework
Contains a set of reusable data components that makes building data-driven apps a breeze. The data framework lets you write code that manipulates the items source – such as group or filter them – right from the shared application layer. It also contains sophisticated form builder that automatically generates data form based on the specified model which you can customize through the provided metadata definition. In short, the powerful data framework lets you write once and run on any supported mobile platforms.
- Mobile Services Framework
Contains a comprehensive set of services that makes it possible to access mobile-related functions from within the shared application layer – from making phone calls, sending short messages to capturing photos from camera, navigating to an address in map, and more. It shrinks the complexity that commonly require hundreds line-of-code down to a single line, which makes cross-platform mobile development easy and compelling.
In summary, the Crosslight Foundation is comprised of frameworks essential to rapidly build business-oriented mobile applications that target various supported platforms. It allows you to write shared application logic that shows a list of data, navigates between screens, execute commands, capture user inputs, present results, and access mobile-specific functionality such as making phone calls, capturing photos through camera hardware, locating an address, posting an interest to social medias, and more.
Crosslight UI Platforms
In addition to the Foundation that serves as the core architecture, Crosslight also includes specialized components to support the mobile platforms at native layer and provides implementations to the abstractions exposed in the Foundation. In short, Crosslight includes a set of platform assemblies such as follows:
Each platform-specific Crosslight assembly adheres to the native platform design guidelines and best practices, while at the same time provides seamless integration to the shared application layer through the comprehensive frameworks and functionality in the Crosslight Foundation.
For more information about the platform-specific features and capabilities in Crosslight, see Platform-specific Guides.