سؤال

Possible Duplicate:
What are the downsides to using Spark over Halo in Flex?

What is the difference between Halo and Spark in Flex3 and Flex4?

هل كانت مفيدة؟

المحلول

Spark is a new theme introduced (in addition to Halo) with Flash builder 4 (Flex4). These two themes support different kinds of styles. With Flex4, you can choose which one you want to use depending on design considerations for your application. Spark is more convenient if you want to use custom skins on your components; Halo, on the other hand, has more built-in styles for components.

نصائح أخرى

A lot of other answers focus on the themes; and while Halo and Spark do have default themes; I think that is like saying comparing a Honda Civic to a Porsche and focusing on the tires.

The main difference between Spark and Halo really get at the underlying architecture used for building components. Halo is the Flex 2[and 3] architecture and has methods like createChildren(), commitProperties(), measure(), and updateDisplayList(). To build components, you will override these methods in your own component, which extends UIComponent somewhere in the class hierarchy. Sometimes this is called the MX Architecture.

In the Halo approach, all visual design and business logic were combined into the same class file. The Spark architecture is a new architecture introduced in Flex 4 that allows for greater flexibility when skinning and building components. It uses a two class system, with one class being the component class that will contain business logic and the other class being the skin class which will perform the visual display.

Spark components have a new parent component, named SkinnableComponent. SkinnableComponent actually extends UIComponent, so the original lifecycle methods are still there; but SkinnableComponent provides new hooks so we create components differently. Instead of overriding createChildren() we would override partAdded() or partRemoved(), for instance. All updateDisplayList() and measure() code is moved into the skin class as another example.

Additionally, there is a separate set of UI components for Halo and Spark. Spark components are known for being lighter and more flexible, but they also have less features. A Spark Combobox does not have the same API as the Halo Combobox for example.

Tooling around the relative component ecosystem is also a consideration. Flash Catalyst will only work with Spark components, for example.

Read Adobe's documentation on the subject:

http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html

The differences in state threw me for a loop at first.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top