Over 10 years of community discussion and knowledge are maintained here as a read-only archive. New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC
|
|
|
Show Posts
|
Pages: 1 2 [3] 4 5 ... 11
|
32
|
PureMVC Manifold / MultiCore Version / Packaging in Dart (or, what's up with all the 'MVC' classnames?)
|
on: March 09, 2012, 12:23:41
|
You may wonder why I chose to name all the PureMVC classes (but not the interfaces) with an MVC prepended (e.g., MVCMediator, MVCNotification). PureMVC contains a couple of classes whose names conflict with classes in the dart:html library. As a result, if you import both libraries, you can't compile. To resolve the conflict, you must either ... 1) Avoid use of both libs in the same program. (err, no.)2) Make developers prefix one of the libs on import and add to all class and interface uses in code. (ugh. mvc.Notification or html.document everywhere, even for non-conflicting classnames.)3) Name your class something different. (grrr. MVCNotification instead of Notification.) As much as I hate the wild west, claim-staking feel of number 3, I accepted the compromise. They owned Proxy and Notification because they got there first. But none of the interfaces (e.g., IMediator, INotification) were in conflict, so I left them as is. I hope this will change in the future, here is a post on Google+ about the problem and why we need proper packaging in Dart. https://plus.google.com/u/0/108661011132885730615/posts/GXn9GVExhpN-=Cliff>
|
|
|
34
|
PureMVC Manifold / Demos and Utils / ReverseText - A PureMVC Dart Demo
|
on: February 26, 2012, 07:30:49
|
This simple demo shows the most common actors and collaborations found in a PureMVC application. A form allows you to enter text, click a button and have the text reversed and displayed in another text box. A check box allows you to have your text reversed continuously as you type. Finally, when the text in the input box is the same as the text after reversal, the output text box's label changes to indicate that a palindrome was detected. Demonstrated are how to... - Use an MVCFacade to initialize and startup a PureMVC core.
- Prepare the Model, View, and Controller regions of the PureMVC core using MVCMacroCommand and MVCSimpleCommands.
- Use an MVCMediator to forward user input from view components on to other parts of a PureMVC core for processing.
- Use business logic in a MVCSimpleCommand that both updates data in an MVCProxy and conditionally notifies an MVCMediator with information about the process.
- Store data in an MVCProxy, and have the MVCProxy notify the rest of the core when that data is changed.
- Have an MVCMediator show interest in certain MVCNotifications and handle them by updating its view component.
Internet Explorer is not supported by this demo. In order to bring you a demo that shows only PureMVC and the DOM with no other interference or abstractions, we decided to support only on W3C compliant browsers. Twitter's Bootstrap is used only for its Base CSS, to make it look pretty. The demo has historically been located at http://trac.puremvc.org/Demo_Dart_ReverseTextIt has now been moved to https://github.com/PureMVC/puremvc-dart-demo-reversetext/wikiThe authors are Cliff Hall and David Foley.
|
|
|
35
|
PureMVC Manifold / Demos and Utils / ReverseText - A PureMVC JS Demo
|
on: February 25, 2012, 06:33:35
|
This demo shows the most common actors and collaborations found in a PureMVC application. A simple form allows you to enter text, click a button and have the text reversed and displayed in another text box. A check box allows you to have your text reversed continuously as you type. Finally, when the text in the input box is the same as the text after reversal, the output text box's label changes to indicate that a palindrome was detected. Demonstrated are how to... - Use puremvc.define() to create pseudo-classes.
- Use a Facade to initialize and startup a PureMVC core.
- Prepare the Model, View, and Controller regions of the PureMVC core using a MacroCommand and SimpleCommands.
- Use a Mediator to forward user input from view components on to other parts of a PureMVC core for processing.
- Use business logic in a SimpleCommand that both updates data in a Proxy and conditionally notifies a Mediator with information about the process.
- Store data in a Proxy, and have the Proxy notify the rest of the core when that data is changed.
- Have a Mediator show interest in certain Notifications and handle them by updating its view component.
Internet Explorer is not supported by this demo. In order to bring you a demo that shows only PureMVC and the DOM with no other interference or abstractions, we decided to support only on W3C compliant browsers. Twitter's Bootstrap is used only for its Base CSS, to make it look pretty. The demo has historically been located at http://trac.puremvc.org/Demo_JS_ReverseTextIt has now been moved to https://github.com/PureMVC/puremvc-js-demo-reversetext/wikiThe authors are David Foley and Cliff Hall.
|
|
|
38
|
PureMVC Manifold / Port to Dart / There will only be a MultiCore version
|
on: February 19, 2012, 05:50:50
|
There is no real reason to port the PureMVC Standard version, which uses singletons instead of multitons. The only real difference is that you use a 'multiton key' for each facade instance, and can therefore have any number of Model, View, Controller 'cores'.
|
|
|
39
|
PureMVC Manifold / Multicore Version / Native Port Demos
|
on: February 19, 2012, 11:06:46
|
Frederic,
I just talked with David and he was thinking of porting your Objs JQuery Employee Admin demo to use Native Port with puremvc.define(). That as well as todomvc. Just wanted to be sure those weren't something you were working on at the moment.
Also, David had only spent a few hours on StateMachine, and I am attaching what he sent me at the time. I thought if you were still interested in working on StateMachine, this might be a start. Seems like JSON as a way of defining the FSM would be better than XML since we don't have E4X in JS yet.
-=Cliff>
|
|
|
40
|
PureMVC Manifold / Multicore Version / Give us feedback on the native port's simple 'class inheritance' facility
|
on: January 23, 2012, 05:35:21
|
The Native JS port will include an optional function for emulating class inheritance. You'll be able to use this method to define your PureMVC subclasses (which make up most of your application aside from the view components).
The benefits of using this method would be that your PureMVC code would not be tied to your UI framework which probably does your class emulation as well. It gives you a shorthand way of emulating classes if you don't want to use a third-party lib for that. But you could use pure JS to do it yourself (as the framework will do internally, or a third-party lib for creating classes if you'd really rather go that way.
A fictitious example would be:
puremvc.define (
// class info- defined separately to avoid collision with property // names defined on the prototype. None of these properties are added // to the classes produced. { /** * The classlets qualified name. The framework will automatically * create this object hierarchy for you, and your classes * constructor will be its referent * * @type {String} */
classname: 'example.UserMediator'
/** * The classlets superclass. The helper method will take care * of subclassing your class. Optional. * * @type {Function} */ , parent: puremvc.Mediator
/** * Your classes constructor. If not provided, one will be created * automatically for you. The automatically created constructor will * take care of invoking super constructors if the class is * extended from another * * @constructor */ , constructor: function (viewComponent) { puremvc.Mediator.call(this.constructor.NAME, viewComponent); } }
// prototypal traits- all instances will have these properties and // you can override superclass methods , { /** @override */ listNotificationInterests: function () { return [ ]; }
/** @override */ , onRegister: function () { }
/** @override */ , onRemove: function () { }
/** * Get the UserMediators UiComponent * @return {User} */ , getUser: function () { return this.viewComponent; } }
, // static traits, i.e. properties which will be defined on constructors { /** * @static * @const * @type {String} */ NAME: 'UserMediator' } );
We're looking for input on a name for this function (remember, it'll have to be typed often so it should be short).
Some possibilities are bless, classlet, define, inherit.
Anyone have a better suggestion or a vote about one of these?
-=Cliff>
|
|
|
|
|
|