The Silverlight Object Model
Developing Silverlight applications is based on the Silverlight Object Model (a.k.a. SLOM) which corresponds to the The Smart Client Object Model (SCOM) used in a Silverlight environment. Hence, if ever you have developed CodeFluent Entities smart client application, you already possess 90% of the needed knowledge.
Indeed, the Smart Client Object Model and the Silverlight Object Model refer to the same content: an object model built for a smart clients (i.e. consuming services).
One definition is used rather than the other depending on the CLR used:
- the SCOM defines this object model used in a regular CLR .NET environment,
- whereas the SLOM refers to the same object model but compiled using the CoreCLR used by Silverlight applications.
However, in the end, it's the same content generated by the same producer that is to say the Service Object Model Producer which is a sub-producer to the Business Object Model Producer. Generating for Silverlight does not require any specific setting: the same code is produced independently of the platform.
The CodeFluent Silverlight Runtime
As Silverlight's CoreCLR doesn't include all .NET CLR classes, the generated object model needs a reference to the CodeFluent Silverlight Runtime to work. This runtime extends the Silverlight CoreCLR with the missing classes so the same object model compiles on Silverlight, and in addition it provides the Silverlight Automatic Asynchronous Proxy (SLAAP).
The Silverlight programming model imposes that server calls cannot be issued on the UI thread, therefore all server calls must be done asynchronously. Consequently, those calls must implement the IAsync interface, and the application's source code gets verbose with BeginOperation and EndOperation methods.
However, the SLOM contains methods which are simili-synchronous such as Load, LoadBy, Search, Save, Delete, etc. Those methods are said simili-synchronous because at runtime on the first call the SLAAP automatically creates an IAsync implementation and uses it to issue server calls. Therefore, from the developer's point of view, all we have to do is call this method from a non-UI thread and don't to bother implementing this interface anymore.
This way it takes a tremendous burden out of the developer's back, since we can develop Silverlight Smart Clients practically as if we were developing a standard .NET Smart Clients.
Other than the here-above concepts and few other Silverlight specific aspects discussed in this section, since the SLOM is the same as the SCOM, most of the information needed to develop a Silverlight application is contained in The Smart Client Object Model and the The Business Object Model sections of the developer guide.