{"id":13743982,"url":"https://github.com/whitered/Kote","last_synced_at":"2025-05-09T02:32:01.431Z","repository":{"id":795030,"uuid":"493641","full_name":"whitered/Kote","owner":"whitered","description":"Kote is a fast and lightweight MVC framework for ActionScript 3 that brings together the best of PureMVC and as3-signals","archived":false,"fork":false,"pushed_at":"2013-03-18T23:12:45.000Z","size":864,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T15:41:29.334Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://wiki.github.com/whitered/Kote/","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whitered.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-01-29T14:14:43.000Z","updated_at":"2020-12-12T12:12:21.000Z","dependencies_parsed_at":"2022-08-16T10:55:14.742Z","dependency_job_id":null,"html_url":"https://github.com/whitered/Kote","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitered%2FKote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitered%2FKote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitered%2FKote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitered%2FKote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whitered","download_url":"https://codeload.github.com/whitered/Kote/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253177766,"owners_count":21866397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:01:00.928Z","updated_at":"2025-05-09T02:32:01.150Z","avatar_url":"https://github.com/whitered.png","language":"ActionScript","funding_links":[],"categories":["Frameworks"],"sub_categories":["MVC Framework"],"readme":"*Kote* is a lightweight and easy to use MVC framework for ActionScript and Flex.\nKote brings together the best features from \"PureMVC\":http://puremvc.org and \"as3-signals\":http://github.com/robertpenner/as3-signals\n\nh2. Overview\n\nh3. Notification\n\np. Notification represents an event that occure in your application. \n\n\nh3. Facade\n\np. Facade is the central part of the framework. It manages mediators, proxies and commands. This is a good place to list your notifications.\n\nbc.. public class ApplicationFacade extends Facade\n{\n  public static const CHAT_MESSAGE_RECEIVED:Notification = new Notification(\"chat message received\");\n  public static const SEND_CHAT_MESSAGE:Notification = new Notification(\"send chat message\");\n\n  public function ApplicationFacade()\n  {\n    addCommand(SEND_CHAT_MESSAGE, new SendChatMessageCommand());\n\n    addProxy(new ChatServiceProxy());\n    addMediator(new ChatLogMediator());\n  }\n}\n\nh3. Command\n\np. Commands are the *controller* of your application. Any command is an object that handles notification. This is part of controller of your application. Typical command has @run()@ method which accepts arguments that were specified when the notification sent.\n\nbc.. public class SendChatMessageCommand extends Command\n{\n  public function run(receiver:Person, message:String):void\n  {\n    ChatService.instance.pushMessage(receiver, message);\n  }\n}\n\np. Now we can send a notification like this:\n\nbc. sendNotification(ApplicationFacade.SEND_CHAT_MESSAGE, myCat, \"Hello, Kote!\");\n\np. Command can also abort notification. When notification aborted, no more commands will be executed and subscribed mediators will not receive it.\n\np. To abort notification override command's @execute()@ method to return false:\n\nbc.. override public function execute(notificationObject:NotificationObject):Boolean\n{\n  notificationObject.parameters = [\"this notification is aborted\"];\n  return false;\n}\n\np. Note that argument type of execute() method is NotificationObject, which allow to change notification parameters.\n\nh3. Proxy\n\np. Proxy represents a *model* of your application.\n\nbc.. public class ChatServiceProxy extends Proxy\n{\n  public function pushMessage(receiver:Person, message:String):void;\n}\n\np. When @ChatServiceProxy@ receives a message from server, it can send a notification:\n\nbc.. private function handleServerMessage()\n{\n  sendNotification(ApplicationFacade.CHAT_MESSAGE_RECEIVED, myCat, \"Kote atakue!\");\n}\n\nh3. Mediator\n\np. Mediators represent *view*. A mediator usually controls a visual object. It can subscribe for notifications.\n\np. To handle a notification in mediator subscribe for it and create a handler function:\n\nbc.. public class ChatLogMediator extends Mediator\n{\n\n  public function ChatLogMediator()\n  {\n    subscribe(ApplicationFacade.CHAT_MESSAGE_RECEIVED, handleChatMessage);\n  }\n\n  private function handleChatMessage(sender:Person, message:String):void\n  {\n    // show message\n  }\n}\n\np. Note that each handler should accept the same type of arguments that were passed to the notification.\n\np. Notifications also have signals (similar to \"Robert Penner's as3-signals\":http://github.com/robertpenner/as3-signals):\n\n* @onSubscribe@\n* @onUnsubscrive@\n* @onAdd@\n* @onRemove@\n\np. To listen for a singnal just add listener for it:\n\nbc.. public function ChatLogMediator()\n{\n  onSubscribe.addCallback(handleSubscribe);\n  onRemove.addCallback(handleRemove);\n}\n\nprivate function handleSubscribe(mediator:Mediator, notification:Notification):void\n{\n  trace(\"Mediator has subscribed for\", notification);\n}\n\nprivate function handleRemove(mediator:Mediator, facade:Facade):void\n{\n  trace(\"Mediator was removed from facade\", facade);\n}\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitered%2FKote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhitered%2FKote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitered%2FKote/lists"}