Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An example Analysis of the principle of Silverlight 4 Architecture

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail the example analysis on the principle of Silverlight 4 architecture. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Microsoft has released Silverlight 4, which has brought us a lot of innovation. It not only brings users a wealth of interactive Internet and multimedia content, but also provides us with a powerful lightweight platform.

We can develop portable, cross-platform, web-based applications on this platform, and integrate services and data from different sources. Compared with the interface of traditional Web applications, the interface of Silverlight applications is refreshing. It feels like Windows Form applications have been moved to Web.

Why do you need Silverlight 4

Earlier, when we developed Web applications, we encountered many technical problems, such as platform compatibility, different file formats and communication protocols, the performance of the same page on different browsers, and the interpretation of Javascript by different browsers. We often work overtime and stay up late for these problems. We did not spare our brains to try to solve these headaches. With Silverlight technology:

With ◆, we can overcome the incompatibility and inconsistency of the existing technology platform.

◆ gives us the ability to create a consistent user experience across multiple platforms and browsers, and applications are consistent in appearance and behavior wherever they are.

◆ enables us to integrate data and services from different network locations into one application using the familiar classes and capabilities of the .NET Framework.

◆ we can provide users with a multimedia, rich performance, strong operational user interface.

◆ Silverlight 4 provides us with more controls and more powerful functions, so that we can develop more powerful applications to better deal with business challenges.

What's new in Silverlight 4?

◆ several practical controls, such as RichTextBox, ViewBox, WebBrowser, WebBrowserBrush and so on.

◆ browser external operation support, browser external operation can be like ordinary window features, such as resizing, setting the top, and so on.

◆ promotes trusted applications, allowing trusted Silverlight programs to read and write user files and directories, full screen, call Windows API, etc.

◆ richer media to capture video signals and microphone voice.

◆ has stronger printing capabilities.

◆ has a stronger and more convenient UI interface, support for drag and drop, support for clipboard, etc.

◆ better data binding and WCF data services.

◆ WCF RIA services have stronger support for multi-tier applications.

Support for ◆ DLR.

What systems and browsers support Silverlight 4?

To build effective Silverlight 4 applications, developers need to understand the architecture of Silverlight 4.

Components of the Silverlight platform

Silverlight as a whole mainly consists of three parts, as shown in the following table:

The following is the official picture of MSDN, showing the parts of the Silverlight platform, as well as some related parts and services.

The core presentation component Core presentation framework includes XAML parser, UI Core, Inputs, DRM (digital rights management), Media, Deep Zoom, etc., most of which need to deal directly with the specific operating system API, so there is no CLR Execution Engine here.

◆ XAML parser is responsible for parsing XAML and is compatible with different specifications of XAML.

◆ UI Core is responsible for rendering vectors, bitmap, animation, and text.

◆ Inputs handles input from keyboard, mouse and other devices.

◆ DRM is responsible for digital rights management of digital media.

◆ Media handles multimedia processing and supports different media formats and encoders.

◆ Deep zoom is used for zooming in and out of high-resolution images.

◆ Layout is responsible for the positioning of UI elements.

The .NET framework for Silverlight is a commercial "library" for applications. Including Data, WCF, WPF, BCL and so on.

◆ BCL provides basic types on the .NET platform, such as collection collections, generic Generics, encryption, etc.

◆ WCF provides some types of applications that handle WCF-related functions, such as SOAP, REST, RSS/ATOM, and so on.

◆ Data provides LINQ, LINQ to xml, etc.

◆ WPF provides some UI controls that bind data to these controls, layout, and handle user input.

The .NET framework for Silverlight is distributed in several .NET assemblies. Some assemblies (such as BCL) are installed in the user's browser with the Silverlight installer, and some are in Silverlight SDK, where the application references the relevant assembly before it is released to the server with the application. When a user visits the application, these .NET framework assemblies are downloaded to the user's browser along with the application's assembly and executed by the CLR execution engine (CLR Execution Engine).

The CLR execution engine (CLR Execution Engine) is at the core of this, and is responsible for executing the. NET code of the application and the .NET code of the .NET framework. CLR is always based on a host. The usual host is a browser, and the host in a scene outside the browser is an operating system process. Silverlight 4 has improved its CLR, further narrowing the difference between the CLR of Silverlight 4 and the CLR of desktop applications.

DLR provides support for dynamic languages. JScript, Iron Python and Iron Ruby are currently supported. This is a new feature in Silverlight 4.

Silverlight 4 also has some programming-related features such as Isolated storage, background threads, safe file management, serialization, XAP packaging, XML processing, HTML interaction with managed code.

◆ isolated storage provides a secure way for Silverlight programs to access the browser's local file system.

◆ background threads make asynchronous and multithreading possible on Silverlight.

◆ secure file management provides a secure file opening dialog box that allows files to be uploaded, etc.

◆ serialization makes serialized storage and recovery of objects possible.

The ◆ XAP package provides Application classes and tools to package XAP. The .xap package has applications and entry points to allow the user's browser plug-in to run the .xap package. The release of an application requires a .xap package.

◆ XML processing includes the ability to handle Xml. The XmlReader class and the XmlWriter class provide the most basic XML processing capabilities, while XLinq allows developers to query data in Xml using c # or VB.NET.

The interaction between ◆ HTML and managed code allows developers to use HTML DOM directly in managed code to manage UI elements in HTML pages. At the same time, they can also write Javascript code to call managed code functions, access methods, properties, fire its events, and so on. This feature makes it possible for the Javascript Engine and MS AJAX Library in the figure above.

The browser host (Browser Host) in the figure above is an environment provided by the user's browser plug-in. It provides the basic environment for running a Silverlight application, such as Application services, HTML DOM integration, the foundation of network communication, and an installer. Silverlight applications that use managed API have a class that inherits the Application class, a program entry point, and the browser host (Browser Host) builds a running environment for the application before invoking the application's entry.

This is the end of the article on "sample Analysis of the principles of Silverlight 4 Architecture". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report