In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail what are the advantages and disadvantages of Cairngorm and Mate in Flex framework. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.
How to Choose a Flex Framework
Cairngorm
Cairngorm is a well-known legacy Flex framework. It's a microarchitecture--a collection of design patterns designed to make collaboration easier for teams.
Cairngorm brings a lot of development ideas from the Java world and focuses on three key areas: handling user actions, encapsulating server-side interactions and business logic, and managing client-side state and interface rendering.
To build a project using Cairngorm requires separating the application code into different packages and inheriting Cairngorm classes. Here are some of the main parts and classes of the Cairngorm project.
ModelLocator is a singleton that stores data representing the state of the program. The nature of a singleton class ensures that all components in a program get the same data.
ServiceLocator is another singleton that centrally manages all services such as HTTP Services. Also, because it is a singleton, all components in the program get the same service.
The business logic is encapsulated in the command class. Commands implement command patterns that represent the logic of corresponding user events.
Events are handled by the FrontController class, which maps events to the appropriate Command.
The Delegate class acts as a proxy to request and respond to remote services.
advantages
Cairngorm is well known in the Flex community as a member of the Adobe open source project with an active community and developer support.
Secondly, the framework draws on a lot of valuable experience in Java development and is successfully used in large-scale project development.
And Cairngorm is ideal for team development because it provides a structured approach to building applications that facilitates distributed development.
disadvantages
A large number of classes need to be written should be Cairngorm's most negative comments. In Cairngorm, each event corresponds to a command; therefore, you need to write a command class for each event that your program fires. Also, write some other classes for command, such as delegates. Even a medium-sized application can lead to a large number of classes.
Second,Cairngorm implements its own set of event-handling methods. This adds complexity to Flex's built-in event model, and it has limitations. Since each event has its own command, the responder to the event is limited to one. In addition, Cairngorm's events do not bubble, so if you want to send data to other levels of the container, you need to implement it yourself.
A third common criticism is Cairngorm's reliance on global singletons, which makes module and unit testing difficult. Although it is possible to break the model in a singleton to simplify testing, it adds additional procedures.
resources
Cairngormdeveloperdocumentation
DevelopingFlexRIAswithCairngormmicroarchitecture–Part1:IntroducingCairngorm(StevenWebsterandLeonTanner,August2008)
ExampleCairngormproject
Mate
Mate is a label-based, event-driven Flex framework. Tag-based means that it can be fully implemented in MXML. The purpose of this framework is to simplify the declaration of event responders.
Using Mate in a project requires only two aspects: using one or more events, there is an MXML file called "eventmap"-an MXML file contained in the main program. It defines what events to listen for and how to handle them. There must be 1 eventmap, and multiple eventmaps are allowed.
Mate also implements the idea of dependency injection-sometimes referred to as the Hollywood Principle, or "don't callus,we'll call you." An object is created in such a way that data is created and injected into the object. That is, the object doesn't shout for data ("don't call us"), but the data is passed to the object ("we'll call you").
advantages
Mate uses dependency injection to improve loose coupling. Because components do not depend on global singletons, they are more free to act as opposites. Mate doesn't prevent you from using Flex's built-in event mechanism, nor does it use a separate response for each event like Cairngorm. Mate's MXML tag file is easy to use, and the documentation is excellent. There are a lot of code examples on the official website.
disadvantages
Mate is built using MXML files, and as an ActionScript developer you need to adjust your habits. And Mate doesn't lay out the structure for the app, leaving that job to developers.
Therefore, teamwork is needed to ensure code compatibility. There is also a problem with Adobe LiveCycle Data Services ES, knowing that Mate is not yet able to handle the data management features provided by LiveCycle Data Services.
About "Flex framework Cairngorm and Mate advantages and disadvantages are what" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.