mixin_conversion branch

46 views
Skip to first unread message

Jacob

unread,
May 7, 2014, 12:10:33 PM5/7/14
to def...@googlegroups.com
Hi, I have a couple questions:

1) How reliable at this point is mixin_conversion?
2) Is there documentation?

Thanks

Brian Kotek

unread,
May 7, 2014, 12:35:26 PM5/7/14
to deftjs
The mixin branch should be pretty reliable (all the tests passed at the last commit). But we've been so focused on Ext 5 (and Deft 5) that we haven't thought about it much lately. I'll try to talk to John and figure out what we're going to do there.


--
Deft JS home page: http://deftjs.org/
Wiki: https://github.com/deftjs/DeftJS/wiki
For rules and tips on asking questions on the Deft JS mailing list: https://github.com/deftjs/DeftJS/wiki/Asking-Questions-on-the-Mailing-List
---
You received this message because you are subscribed to the Google Groups "Deft JS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deftjs+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/deftjs/0fb95116-def4-4b6e-b735-22f2a78f5324%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jacob Gur

unread,
May 8, 2014, 9:49:09 AM5/8/14
to def...@googlegroups.com
Thanks a lot Brian. I think it would also be really useful to have documentation on usage.


On Wed, May 7, 2014 at 12:10 PM, Jacob <ja...@fareclock.com> wrote:

--
Deft JS home page: http://deftjs.org/
Wiki: https://github.com/deftjs/DeftJS/wiki
For rules and tips on asking questions on the Deft JS mailing list: https://github.com/deftjs/DeftJS/wiki/Asking-Questions-on-the-Mailing-List
---
You received this message because you are subscribed to a topic in the Google Groups "Deft JS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/deftjs/9ywLL9x8Ke8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to deftjs+un...@googlegroups.com.

Brian Kotek

unread,
May 8, 2014, 11:36:07 AM5/8/14
to deftjs
If/when it is merged and released, we'll definitely be updating the docs. 

If I recall correctly (it's been a little while since I last worked on it), the major changes are:
  • Class preprocessors no longer used, so the Controllable and Injectable mixins need to be added to classes using control/inject. This should avoid the problems with Cmd ignoring the preprocessors.
  • The control: configuration in the ViewControllers is now merged with any superclass ViewControllers. This seemed very useful, but since Ext 5 ViewControllers implement their own control: logic, and since Sencha is pushing hard for people not to use control: but instead to use the reference config in your view elements, using the Deft merging logic is probably irrelevant in Ext 5. :-(
  • The controller: for a view can be set from the outside (when creating the view). I haven't had a chance to test Ext 5 to see if it will also allow this.
  • ViewControllers can compose additional ViewControllers with the companions: config. This also added a lot of flexibility, but it looks like this will be impossible in Ext 5 due to the way ViewControllers handle view events. :-(
As you can see, part of the issue is that some of the cool new features (control merging and companions) are pretty much untenable for Ext 5 / Deft 5. So now we have to figure out what should stay in and what should be omitted.
  


You received this message because you are subscribed to the Google Groups "Deft JS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deftjs+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/deftjs/CAGXqJGoj7GEMesZ%3DDU_gkc1R3KGO_-sTqTqeDRJMLAy9LxBZ_g%40mail.gmail.com.

Jacob Gur

unread,
May 8, 2014, 11:49:55 AM5/8/14
to def...@googlegroups.com
Thanks a lot Brian for the detailed information. I agree with your decision to prudently investigate the effect of Ext 5 on the future of Deft, before merging in possibly incompatible features.

I am using a crude version of mixins that I implemented myself (was discussed with you a year or two ago), but am having some limitations with it. For example, the control merging of mixins into the controller can cause component selector collision, which I shamelessly work around by figuring out unique selectors for the same component.

At the end of the day, there is definitely great value in adding multiple inheritance to controllers, be it by mixins or whatever.


Brian Kotek

unread,
May 8, 2014, 12:41:44 PM5/8/14
to deftjs
On Thu, May 8, 2014 at 11:49 AM, Jacob Gur <ja...@fareclock.com> wrote:
At the end of the day, there is definitely great value in adding multiple inheritance to controllers, be it by mixins or whatever.


I agree, which is why I'm a bit disappointed that Ext 5 will make this rather difficult. As I understand the advocated Sencha event handling setup, a given view event locates one (and only one) corresponding referenceHolder for the component. When using a ViewController, the referenceHolder is the ViewController (http://docs.sencha.com/extjs/5.0.0/whats_new/5.0/whats_new.html#References_and_Listeners). But nothing else happens beyond that, meaning event handlers on any "companion" ViewControllers will never be invoked. :-/

Mixins are an option, but not really a good one. There's a real danger of mixed in properties or methods squashing existing ones with the same names. The great thing about the companion approach was that each ViewController was encapsulated, so there was no danger of conflicts or overwrites. 

Jacob Gur

unread,
May 8, 2014, 8:41:23 PM5/8/14
to def...@googlegroups.com
Thanks Brian.

--
Deft JS home page: http://deftjs.org/
Wiki: https://github.com/deftjs/DeftJS/wiki
For rules and tips on asking questions on the Deft JS mailing list: https://github.com/deftjs/DeftJS/wiki/Asking-Questions-on-the-Mailing-List
---
You received this message because you are subscribed to a topic in the Google Groups "Deft JS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/deftjs/9ywLL9x8Ke8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to deftjs+un...@googlegroups.com.

Ben Quarmby

unread,
Jan 3, 2015, 9:55:20 PM1/3/15
to def...@googlegroups.com
You're absolutely right about mixins. On one hand they're extremely powerful and the only way to do certain things, but there is a big maintainability cost. I've seen them totally abused, with collisions and prototype bloat causing a real headache. I'd go so far as to call them an anti-pattern for sharing anything other than true low level behavior (i.e. Observable, Injectable).

Have you ever used Ext plugins? They have some great advantages for attaching common behaviors:
  • They're discreet. No collisions to worry about.
  • They're self initializing. It's almost like a per-instance visitor pattern.
  • They're configurable. You can have multiple plugins each configured differently.
The obvious downside is that they're tied to the Component class. There is also some tight coupling there; it'd be great if they could be created with the injector.

Since the original design for companions isn't possible with Ext 5, perhaps the concept could be reborn as a more generic way of attaching cross cutting concerns to any class, not just a ViewController? They could have all of the benefits of plugins without coupling to components.
Reply all
Reply to author
Forward
0 new messages