Silverlight vs Flash

来源:互联网 发布:c语言中num是什么意思 编辑:程序博客网 时间:2024/04/29 09:25

Silverlight将打败Flash,是这样吗?可能会。许多人都告诉过我这一点,我开始怀疑他们的观点是否有一定的道理。

 

进行不到15分钟的搜索后,我确定Silverlight可能不会打败Flash,但它肯定会对Flash的市场份额造成严重破坏。

 

为什么这样说呢?我们来了解一些事实。首先,在Flash中进行开发需要开发者在Flash语言Actionscript方面有着特殊的技能。其次,这类Actionscript程序员非常少见(我不是在说我的堂兄,他参加了一个周末课程,就能摆弄一些图形)。

 

我说的是那些真正了解编程、逻辑和结构的程序员,他们能够创作出一个相当有创意的作品,利用数据库或让用户沉浸在整个的内容环境中。

 

了解一下Silverlight,它的显著不同在于它能用更加常用的语言,如C#、.NET环境、Ruby或是Python编程。寻找熟练应用这些语言的程序员要比寻找Actionscript程序员容易得多。

 

因此,突然之间,有了Silverlight,可供选择的程序员数量激增,许多组织也不再需要雇佣Flash专家资源。

Silverlight打动我的另一个优势在于:它可以依靠微软机器、MSDN、所有现有基础架构和MSSQL之类工具已有的大量开发者资源,以及对Windows Media内容流的丰富经验。

 

我想我不必告诉你Flash视频流是多么低效,它通常需要双倍的带宽才能达到和Windows Media相同的视频质量。不管采用哪种方法,你都可以将流视频数据成本减半。你已经发现了一个好方法!

 

简单来说,对Silverlight的盲目崇拜只是已有开发者工具集的另一个显示层或前端增进,使得世界范围内的一批开发者不必学会深奥的Flash语言就能建立类似Flash的界面。

 

即使软件巨头的内容创建和开发工具并不总是最好的,但你不能说微软没有向开发和内容社区充塞大量工具箱和选项,以帮助他们实现他们的目标。

 

这些工具包括简单的Web工具,如Expression;以及完全整合的套件,如Visual Studio。

 

那么,对于“Silverlight是否将打败Flash”这个问题的答案是怎样的呢?假如我们能够使用现有的跨越多种语言、可在多种形式的开发环境和工具集中使用的低成本开发资源,开发出更具吸引力的界面,那么我想Adobe可能很难赢得这场战争。

 

(by Scott Bradley Pearce )

 

Flash与Silverlight的区别

简略讲述一下Silvrlight和Flash,XAML和MXML之间的区别。我对Silverlight用的不多,更不要谈深入的开发了。因此,本文只是一个Flash RIA开发者对于Silverlight和XAML的一些印象。如有错漏,回帖指出,好帖则奖励积分。

首先,要明确两点:Silverlight的前身就是WPF/E; WPF/E不是WPF,而是WPF的一个子集。WPF主要开发桌面应用程序,Silverlight主要用于开发Web客户端应用程序,是一个浏览器插件。
Silverlight主要使用XAML语言进行开发,但SilverLight 1.1开始支持JavaScript,C#,VB,Ruby以及Python等多种开发语言。相比Adobe AIR,显然它讨好的开发者群体更加多。但是我个人觉得AIR支持JavaScript, AS3等符合ECMAScript4的语言就可以了,没有必要再去趟更多的混水。虽然有中间语言(IL)的支持,但像微软这样一口气支持这么多的语言还是要花费大量人力的,我除了佩服之外,有着更多的怀疑和关注,看看日后的反映怎样。要知道,Adobe才支持Javascript, AS3,html开发AIR,已经被开发人员戏称为精神分裂症式的开发方式了,呵呵。

XAML和MXML

Silverlight中的XAML是WPF的XAML的一个简化了的子集,功能也要弱很多。 即使如此,也必须说,XAML比MXML要强大很多,它的理念也贯彻的更加彻底。

XAML可以描述画面结构。似乎MXML也是类似的描述界面的标记语言,但实际上XAML走的更远。XAML有点类似Adobe以前的SVG,但又包含着更深层次的含义。XAML是界面设计师和开发人员的共同语言,这是最爽的地方。也就是说,美工人员使用微软的Expression作出的美工设计图也是XAML语言的,那么开发者可以直接从这个代码开始继续开发,省去了大量的转换时间。显然,Adobe也注意到了这一点,这就是为什么最近推出"Thermo"来。Thermo是用于整合设计师和开发者,我们也可以把它理解成MXML版的Expression。这就是推出Thermo深层次原因,真正了解业界动态的人都会特别注意一个产品推出的动因和时机。

 

实际上,Silverlight和Flash RIA像是两个相互竞争的兄弟,不仅长得像,连实质都很类似。两个人你追我赶,互相取长补短。往往这个人,出了一点什么,另一个人很快赶上。这很好,这才是技术的良性竞争。我对Silverlight技术不抱有任何的恶感,我只是对微软的市场策略有些不爽。
哪个强一些?

Silverlight比Flash强?或者Flash 比Silverlight强?

这个问题没有必要。因为所有的回答都是针对当下的情况,而两个产品都是在不断发展。

前段时间Silverlight正式版刚出,轰轰烈烈宣传自己比Flash有多少多少优点,结果3,4个月不到,基本上这些比较优势都不存在了。

 

 

Silverlight支持高清视频?

不错,是支持,但是只是微软自家的WMV9。众所周知,Flash Player 9 update(MovieStar)已经支持了行业标准的H.264 video和HE-AAC ,一下子将微软抛在后面。

 

Silverlight支持GPU?

真正的谣言。Silverlight只是说支持硬件加速辅助系统,从未说支持GPU。WPF支持对GPU的调用,但这并不说明Silverlight(WPF/E)支持啊。估计谣言从这儿来的。相反,黑羽从某些小道消息知道,Flash Player 10(AStro)将会和GPU发生某种暧昧的关系。


Silverlight是XML DOM型嵌入网页的,而不是二进制文件!

我都不知道这到底是优点呢,还是缺点。优点说,就是以XML形式描述了DOM结构,容易被外部Javascript调用,容易被搜索引擎搜录。那么我来分析分析:将应用程序的内部结构暴露给外部的脚本是否总是好的呢?符合封装的要求吗?被搜索引擎搜录,那也只是嵌在XAML里面的静态内容。RIA程序读取的动态内容还是搜不到啊。嵌在XAML里的静态内容又有多少价值呢?Google现在一样可以搜索到普通Flash swf里面的静态文本内容啊。

最后,二进制swf文件的执行效率从理论上来说肯定要比这样的XAML语言再通过Silverlight执行要快很多。不知现实如何,希望有人测测。


Silverlight只是windows平台的,比不上AIR?

那是暂时的,目前Silverlight支持windows, 苹果。通过Mono项目,不久之后也会支持Linux平台。AIR的这方面优势只是暂时的。

 

我们选择谁?

选择谁,要进行多方面的考量。在二者功能和实现都较相似的情况下,技术只是其中一个重要的子因素,而不是决定性因素。

技术因素
技术方面,我已经说了,二者你追我赶,目前的优势都是暂时的。

要指出的一个区别是:Silverlight的靠山是.NET统一战线,而Flash RIA(包括AIR)目前的走向是积极拥抱Java社区和开源社区。虽然微软也有一些开源计划,但不如Adobe的行为更得开源社区人心。君不见,Thinking in Java的作者Bruce Eckel已经开始为Flex摇旗呐喊。众多的Java开发者都积极看好Flex和Flash RIA。
但Silverlight依然是有一些明显的比较优势,比如先进的XAML理念、强大的.NET、与Windows平台的整合优势等等。.NET社区人员规模也不是小数目。

普及率
似乎很多人认为这是Flash RIA的优势,但我又不得不怀疑这一点。是的,目前Flash Player是事实上的最广泛的RIA平台,Flash player 9推出短短一年,全球普及率就超过90%。这是相当惊人的速度。但这是Flash Player的强大优势吗?在微软强大的操作系统捆绑能力面前,即使算优势,也只是一个暂时的不足以成为决定性因素的小优势。再想一想当初微软对ActiveX控件才做了一点点限制,就逼得我们所有Flash开发者必须更改swf的插入方式。这还能算Flash的优势吗,兼容未来技术变动的速度能比得上微软自家的Silverlight吗?要算普及率,不要算Silverlight的普及率,Windows的普及率才是正主。

Workflow和设计、开发人员
比一比双方从美工设计、代码开发到产品发布,一整套的工作流程:微软是Expression Blend + Visual Studio;Adobe是Creative Suite 3 + Flex(or Flash CS3) +未来的Thermo。CS3里包括了全世界公认的业界标准的设计工具包:Photoshop,Illustrator, AfterEffect, Dreamweaver, Flash。绝大部分专业美工人员都会使用这些工具。但是你问问他们,知道Blend吗?答案百分之90以上都会是No。
这才是现在Flash RIA的一个明显的优势。非常的有意思,不懂代码的美工兄弟们反而成为了我们坚定的靠山。相信微软要说服这么广大的设计团体使用Blend,要耗费巨大的力气。美工都是很懒的(我也做过美工),不要说用惯了Adobe,就看现在PS,IL,AE和Flash结合的如此漂亮,就根本不太会愿意用别的东西。况且我对微软的美工设计工具真的是没有什么感兴趣的地方,和Adobe差距大着呢。


综合以上三点,都不能说明谁比谁强。谁比谁强是一个动态的不断变化的过程。试想,如果Microsoft把Painter,Coreldraw收购并整合了呢(纯粹猜想,哈哈),那么Flash RIA第三点优势也并不会明显了。
那么到底选择谁?这是一个宗教信仰问题。前两天还看见国外两个大腕在论坛上吵C和C++到底那个好。各种技术之间的争论永无休止。在Flash RIA和Silverlight这两个如此相似的兄弟身上,我相信庞大的口水战才刚刚来到。
未来的RIA前景无限美好,我们可以相信,微软和Adobe绝对不会放弃竞争,一定会玩命的改善自己的产品。做为最终开发者的我们,只要坚定信念,选择一个,学精学好,肯定会有用武之地。总比把时间花在无休止的等待、犹豫和口水战上要好得多不是。


P.S 其实我真的很想提一下JavaFX,但是到目前为止,实在看不到Sun公司拿出能和这两个兄弟竞争的筹码。希望JavaFX能够在未来也给予我们惊喜,成为第三个兄弟。三国大战,更有效率,哈哈。

 

 

(by 黑羽翔天)

 

 

A few people didn’t like my proclaimation that Flash is dead. This is understandable. It is a bit premature to make such claims, but the Silverlight model is pretty amazing. As someone who works with Flash on an ongoing basis, I thought I'd chime in with a more in depth look at the issues.


First off, let me explain my background for those of you who may not know. Way back in the day, when Flash 4 was the latest and greatest, Macromedia decided to “open up” the Flash file format. They released documentation (which was poor at best) and an SDK (which was horrible at best). I saw the potential here. Finally, the format third party developers could unleash their creativity and usher in all kinds of amazing tools. Unfortunately, the documentation was full of errors and the SDK was so riddled with bugs that you spent more time debugging it than using it.

Nevertheless, debug I did. I came up with quite a list of fixes to the SDK, fixes which would render it near complete and bug free. I signed up for a free hosting account and promptly placed a list of the updates you had to make to the SDK in order for it to be bug free online. Macromedia’s response: cease and decist. Rather than integrating the changes themselves or acknowledging that they solved a serious problem, they told me that it was a violation of the license agreement to be posting that kind of information…. Some definition of “open” they have there.

Not to be dismayed, I determined that the source code license was just far to restrictive then and I would create my own SDK. As familiar with the spec as I had become, it didn’t take long for me to put something together. In a few short weeks, I had an SDK that was far more complete, far less buggy, and far easier to work with than the Macromedia SDK. It wasn’t long before hundreds, then thousands of developers were downloading the SDK and posts to Macromedia’s own open-swf forum turned from questions about the Macromedia SDK to questions about this new alternative SDK. It wasn’t too long before Macromedia completely discontinued their SDK (rumor has it that product teams internal to Macromedia even considered using the SwfSource code for their own projects).

Ever since then, I've been working with the Flash File Format. I've helped put together some award winning tools that are arguably some of the most successful SWF generation tools outside of Macromedia. This gives be a unique perspective on the differences between the two formats and how these formats enable developers to create tools that work with each of them.

Admittedly, my view point isn’t the same as  a lot of people, who are perfectly content just buying the Flash IDE and can do everything they will ever need to do from there. I create tools that work with the File Format itself, tools that export their content into the Flash Format. So, if you are a software developer like myself (which is probably a good chance if you are reading this blog), then you would almost assuredly come to the same exact conclusion as myself if you knew the details of the two formats.


Animation

The Flash format itself has no notion of animation other than transformation matrices. You can apply a matrix to an element on a per frame basis to move it around. Want to move something across the screen in 3 seconds? Calculate how many frames 3 seconds will take, then calculate the matrixes required for each frame along the way. Oh, and don’t forget that the player won’t actually maintain any frame rate unless you embed blank audio tracks, so that 3 seconds might turn out to be 2 or 6 or 5, it just depends what kind of mood the machine is in.

Silverlight supports the WPF animation model, which is not only time based instead of frame based, but lets you define the start and end conditions and it will figure out how to get there for you. No need to deal with matrixes. No need to calculate positions on various frames. It just works.

Shapes

Flash stores its shapes using binary shape records. In order to write shape definitions, you will need to either license a 3rd party Flash file format SDK, or build your own. It isn’t too difficult, but it does require a bit of a learning curve and the ability to manipulate things at the bit level, since shape records don’t align on byte boundaries. Needless to say, it isn’t the kind of thing most people can write and have all debugged in one afternoon.

Silverlight uses XAML. XAML is text based and can be output using a simple XML object. No need to buy special libraries to write files. No need to write your own libraries. Just stream some text to a file and you’re done--easily the type of thing that can be debugged and finished in an afternoon.

Text

Flash stores its fonts glyphs using the same exact shape definitions that are used for any other shape. The player itself does not understand TTF files, so you’ll end up digging deep into the Win32 APIs and the fairly vague definitions in the Flash file format documentation to come up with something that sort of does the trick. You’ll probably spend ages trying to deal with all the intricacies of fonts, because it turns out that typography is actually fairly complex… and you will have to deal with all those complexities yourself.

WPF/E lets you embed true type font information directly into your projects, and download that information with the downloader object. No need to do anything special. No need to handle anything yourself. It just works.

Video / Audio

Flash supports multiple video formats. The latest codec is really high quality and the bandwidth usage is nice. There is one problem though if you are creating a tool that outputs Flash content… the formats it supports aren’t really used by anyone else. The original video codec, Sorenson’s proprietary H.263 implementation is a mutant version of H.263. The compression follows the spec fairly closely, but there are a bunch of features dropped out and you can’t exactly just go find a complete spec on how to build your own encoder. The later codec from On2 puts you in an even worse position. Licensing Sorenson’s codec isn’t that expensive, but On2 will rape you with fees. They are relying on revenue from licensing the codec used by Flash to revive their $2 a share stock price. It is also a completely proprietary format (where at least the Sorenson one was loosely based on a standard). The audio formats Flash supports are all proprietary, except for ADPCM, which no one uses because of its horrible compression, and MP3, which is decent but dated, and still requires licensing fees and 3rd party conversion libraries.

Compare that to the Silverlight story. Silverlight implements industry standard VC-1 codec for video, as well as offering support for WMV and WMA. Just about everyone already has Windows Movie Maker, but if they don’t it’s not a big deal. Why? Because Microsoft makes available a free Encoder SDK for producing WMA and WMV. So, not only are you using formats that people are more likely to be able to encode themselves, but Microsoft also provides your product with SDKs if you want to do the encoding yourself. The best part about it is that Microsoft doesn’t rely on WMA/WMV licensing revenue to keep themselves alive, so not only is it easier to integrate, but it’s also cheaper.

Scripting

You can reuse C# classes from your tool inside your exported content. There is no development environment out there for creating real desktop applications which is based on ActionScript. If you go the Flash route, this means that all your classes and objects have to be written twice. You need .NET classes to handle the author time experience and Flash classes to handle the run-time. If you have server components, once again you need to switch back to .NET and throw out all the classes that the run time is using. For example, let’s say you are creating a tool that outputs rich media quizzes. With Silverlight / .NET, the same entity classes you use to deal with results in the player could be reused on the server side. With Flash, you’d have to write all that logic 2x and keep it in sync as your tool changes.

Tools

You can create Silverlight content with the same tools you use on a daily basis. Visual Studio.NET is by far the most powerful and most popular IDE. You can potentially have all the code for the server components, the authoring tool components, and the runtime/player components inside the same project. No extra skills required. No needing to hire some special Flash guru to do the graphics junk. Every developer can contribute to every part of your application.

The bottom line: about the only thing Flash has going for it from my perspective is adoption. Adoption isn't hard to achieve, especially for the people that ship the operating system 90% of the world uses. As such, it's just a matter of time till that is no longer part of the equation. Adobe has a lot of work to do in the mean time, and the clock is ticking. Open sourcing Flex is a really good start in the right direction... unfortunately, Flex was built on top of the wrong platform from the start (something I told the Flex team while Flex was still in Alpha), so this last effort, while a good one, still might not be big enough to turn the tide that is coming. Now, this isn't to say that Flash isn't a great format and doesn't enable a lot of scenarios (like I said, my job is working with Flash and I'd be doing something completely different if it wasn't for Flash). So, Flash is great. Silverlight just solves a lot of the major problems that I've run into with Flash.


 

(by Jesse Ezell  http://weblogs.asp.net/jezell/archive/2007/05/03/silverlight-vs-flash-the-developer-story.aspx)

 

这是资深flash开发者全方位深入的对比评论。所谓设计和开发是两码事的K,设计方面Adobe赢都赢了,但微软实在猫撒,VB,VC,C#,VS.NET打堆堆…… 对于专写代码的程序员来说,学习Silverlight是很撇脱的事了。二天.NET Framework,Silverlight虚拟机等等的都嵌进大多数用户系统中,flash担因只有请个半仙来抵事咯。

 

From the purely technical point of view, Silverlight beats Flash hands off and blindfolded.

There's a subtle problem that keeps me holding on into adopting Silverlight.

Adobe is an OS independent company, therefore they have the best interest in promoting their product to the widest market as possible.

Microsoft is the maker of the Windows OS and the maker of Silverlight.

Once Silverlight becomes popular, how long would it take for them to drop support for, let's say MacOS, older version of Windows, and so forth?

They can use Silverlight as a tool to force people into using their latest OS.

They have already done that. Once upon a time there was Internet Explorer for Linux, quickly dropped once IE became popular.


by Giuseppe

 

老霸道了。抹法

 

事情还早,相信很多普通网民都μ盯到过Silverlight。Flash再啷个撇,现在还是最为流行……

原创粉丝点击