{"id":21353425,"url":"https://github.com/feathersui/feathersui-cairngorm","last_synced_at":"2026-01-03T07:08:03.813Z","repository":{"id":145394364,"uuid":"395133451","full_name":"feathersui/feathersui-cairngorm","owner":"feathersui","description":"A port of the Cairngorm microarchitecture to Feathers UI for Haxe and OpenFL","archived":false,"fork":false,"pushed_at":"2024-08-28T22:16:18.000Z","size":248,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T17:28:55.869Z","etag":null,"topics":["cairngorm","feathers-ui","haxe","mvc","mvc-framework","openfl"],"latest_commit_sha":null,"homepage":"https://api.feathersui.com/feathersui-cairngorm/","language":"Haxe","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feathersui.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"joshtynjala","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-08-11T22:45:39.000Z","updated_at":"2024-08-28T22:16:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"fee511c6-1869-4857-9c2c-80b9f592e6c9","html_url":"https://github.com/feathersui/feathersui-cairngorm","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feathersui%2Ffeathersui-cairngorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feathersui%2Ffeathersui-cairngorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feathersui%2Ffeathersui-cairngorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feathersui%2Ffeathersui-cairngorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feathersui","download_url":"https://codeload.github.com/feathersui/feathersui-cairngorm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826795,"owners_count":20354221,"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":["cairngorm","feathers-ui","haxe","mvc","mvc-framework","openfl"],"created_at":"2024-11-22T03:17:34.699Z","updated_at":"2026-01-03T07:08:03.787Z","avatar_url":"https://github.com/feathersui.png","language":"Haxe","funding_links":["https://github.com/sponsors/joshtynjala"],"categories":[],"sub_categories":[],"readme":"# Cairngorm for Feathers UI\n\nA port of Cairngorm framework from [Apache Flex](https://flex.apache.org/) (formerly Adobe Flex) to [Feathers UI](https://feathersui.com/) for [Haxe](https://haxe.org/) and [OpenFL](https://openfl.org/).\n\n## What is Cairngorm?\n\nThe Cairngorm Microarchitecture is a lightweight yet prescriptive framework for Rich Internet application (RIA) development.\n\nCairngorm is an implementation of design patterns that the consultants at Adobe Consulting have successfully taken from enterprise software development (with technologies including J2EE and .NET) and applied rich Internet application development.\n\n## Cairngorm API Overview\n\n### `FrontController`\n\nA subclass of `FrontController` defines global _event_ constants and maps them to _commands_. Typically, a _view_ will dispatch an event, and the front controller will respond by executing the associated command.\n\n```haxe\nclass MyAppController extends FrontController {\n\tpublic static final LOGIN_EVENT = \"LOGIN_EVENT\";\n\n\tpublic function new() {\n\t\tsuper();\n\t\taddCommand(AppController.LOGIN_EVENT, LoginCommand);\n\t}\n}\n```\n\n### `IModelLocator`\n\nAn `IModelLocator` implementation is a singleton class that stores the application's data model. Typically, data loaded by services gets stored using simple classes called _value objects_ (often abbreviated as _VO_).\n\n```haxe\nclass MyAppModelLocator extends EventDispatcher implements IModelLocator {\n\tprivate static var model:AppModelLocator;\n\n\tpublic var items:ArrayCollection\u003cMyItemVO\u003e = new ArrayCollection();\n\n\tprivate function new() {\n\t\tsuper();\n\t}\n\n\tpublic static function getInstance():AppModelLocator {\n\t\tif (model == null) {\n\t\t\tmodel = new AppModelLocator();\n\t\t}\n\t\treturn model;\n\t}\n}\n```\n\nThe model locator may be accessed globally, and is often referenced inside `ICommand` implementations and views.\n\n```haxe\nprivate var model = MyAppModelLocator.getInstance();\n```\n\n### `CairngormEvent`\n\nA base class for all events dispatched from views using the `CairngormEventDispatcher`.\n\n```haxe\nclass LoginEvent extends CairngormEvent {\n\tpublic function new(username:String, password:String) {\n\t\tsuper(MyAppController.LOGIN_EVENT);\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t}\n\tpublic var username:String;\n\tpublic var password:String;\n}\n```\n\n### `CairngormEventDispatcher`\n\nUsed by views to dispatch a `CairngormEvent` to the `FrontController`, which will execute a command using the event's properties.\n\n```haxe\nvar cgEvent = new LoginEvent(username, password);\nCairngormEventDispatcher.getInstance().dispatchEvent(cgEvent);\n```\n\n### `ICommand`\n\nImplementations of the `ICommand` interface are executed by the `FrontController` when an associated `CairngormEvent` is dispatched from a view. A command typically calls a service or modifies the model (or both).\n\n```haxe\nclass LoginCommand implements ICommand {\n\tprivate var model = MyAppModelLocator.getInstance();\n\n\tpublic function execute(cgEvent:CairngormEvent):Void {\n\t\tvar loginEvent = cast(cgEvent, LoginEvent);\n\t\tvar username = loginEvent.username;\n\t\tvar password = loginEvent.password;\n\t\t// call a service or modify the model\n\t}\n}\n```\n\nIt's common for an `ICommand` implementation to also implement `IResponder` from the [_feathersui-rpc-services_](https://github.com/feathersui/feathersui-rpc-services/) library to receive the result of a service call.\n\n### `ServiceLocator`\n\nA subclass of `ServiceLocator` stores the services used to send and receive messages with an external data source, such as a REST API or database. Typically, services are instances of the `HTTPService` or `RemoteObject` classes from [_feathersui-rpc-services_](https://github.com/feathersui/feathersui-rpc-services/) library.\n\n```haxe\nclass Services extends ServiceLocator {\n\tpublic var loginService:HTTPService;\n\tpublic function new() {\n\t\tsuper();\n\t\tloginService = new HTTPService();\n\t\tloginService.url = \"https://example.com/api/login\";\n\t\tloginService.resultFormat = HTTPService.RESULT_FORMAT_HAXE_XML;\n\t}\n}\n```\n\n## Minimum Requirements\n\n- Haxe 4.1\n- OpenFL 9.2\n- Feathers UI 1.0\n\n## Installation\n\nRun the following command in a terminal to install [feathersui-cairngorm](https://lib.haxe.org/p/feathersui-cairngorm) from Haxelib.\n\n```sh\nhaxelib install feathersui-cairngorm\n```\n\n## Project Configuration\n\nAfter installing the library above, add it to your OpenFL _project.xml_ file:\n\n```xml\n\u003chaxelib name=\"feathersui-cairngorm\" /\u003e\n```\n\n## Documentation\n\n- [API Reference](https://api.feathersui.com/feathersui-cairngorm/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeathersui%2Ffeathersui-cairngorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeathersui%2Ffeathersui-cairngorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeathersui%2Ffeathersui-cairngorm/lists"}