Parsley框架 实例演示
- Good Examples:
- http://www.ivanalvarez.com/2010/09/parsley-framework-good-examples/
- Introduction of Parsley framework:
Parsley is all about decoupling. It is a dependency injection framework and is has strong support for messaging. I like the way the dependency injection as well as message handling is configured. By using [INJECT] on a parameter, you tell parsley to inject an object of the type as specified by the parameter. We will see examples of the usage later on. Other things to inject are the [MessageDispatcher] that enables dispatching messages from each component.
The final component I want to mention is the DynamicCommand object . I use it more as a controller, still it is an interesting concept. We create one component that receives a message, does a remote call and handles the result of that call. All in one object. Again, an example will follow later on.
Parsley is an Application Framework for Flex and Flash Applications built upon an IOC Container and Messaging Framework that can be used to create highly decoupled architectures. It allows you to configure objects to be managed by the container with Metadata, MXML, XML or ActionScript and is easily extensible.
While many other Application Frameworks for the Flash Platform are either a pure Flex Framework that cannot be used without the Flex SDK or are a classic Flash Framework without any deeper integration with Flex, Parsley is both. The core of the framework (the IOC Container and the Messaging Subsystem) does not depend on the Flex SDK at all, but there are several additional modules that are specifically designed for Flex, providing support for MXML Configuration, View Wiring and Flex Modules.
-
Structure of the Parsley solution
- 项目介绍:见附件截图
-
步骤如下:
-
a) Create an application file.
b) Add all the required lib swc into Classpath.
c) Create a Config.as file to store all the configuration.
d) Load the config file through FlexContextBuilder.build('filename').
e) Registering the services to Config file.
f) In action service file, we need to write all the events that can be managed by [ManagedEvents] tag.
g) We need to Inject the services through [Inject] tag which will be called from Action class.
h) Dispatch Event based on user activity.
I) In view portion, we need to write the [MessageHandler] part to handle the result event.
j) Process the server result in Result Handler part.
上一篇: GitHub托管项目达到100万
下一篇: Flex初学者的福音
推荐阅读
-
CI框架简单邮件发送类实例_PHP
-
使用jQuery validate 验证注册表单实例演示_jquery
-
Python ORM框架SQLAlchemy学习笔记之数据查询实例
-
Python ORM框架SQLAlchemy学习笔记之映射类使用实例和Session会话介绍
-
Python ORM框架SQLAlchemy学习笔记之关系映射实例
-
Ement常用语法、元素四类属性、布局标签实例演示
-
在Laravel框架里实现发送邮件实例(邮箱验证),laravel发送邮件_PHP教程
-
一个可拖拽列宽表格实例演示_javascript技巧
-
常用PHP框架功能对照表_php实例
-
PHP中MVC框架之文件入口实例详解_PHP教程