首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Parsley框架 范例演示

2012-10-24 
Parsley框架 实例演示Good Examples:http://www.ivanalvarez.com/2010/09/parsley-framework-good-example

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.

项目介绍:见附件截图

步骤如下:

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.

parsley框架学习:http://www.spicefactory.org/parsley/docs/2.1/manual/?page=overview&section=whatsnew

热点排行