Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22436 > unrolled thread

Composer.js released for simple object composition

Started byJoshua Tenner <tenner.joshua@gmail.com>
First post2013-12-27 09:34 -0800
Last post2014-01-01 19:32 -0800
Articles 3 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  Composer.js released for simple object composition Joshua Tenner <tenner.joshua@gmail.com> - 2013-12-27 09:34 -0800
    Re: Composer.js released for simple object composition "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-12-29 14:46 -0800
      Re: Composer.js released for simple object composition "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-01-01 19:32 -0800

#22436 — Composer.js released for simple object composition

FromJoshua Tenner <tenner.joshua@gmail.com>
Date2013-12-27 09:34 -0800
SubjectComposer.js released for simple object composition
Message-ID<f65ec491-6139-474a-97b8-f6b5882db680@googlegroups.com>
http://jtenner.github.io/Composer.js/

Check it out!

Thanks.

[toc] | [next] | [standalone]


#22485

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2013-12-29 14:46 -0800
Message-ID<ac4bebc8-9e5e-4973-8fd7-9e5dec4eb0c0@googlegroups.com>
In reply to#22436
On Friday, December 27, 2013 11:34:46 AM UTC-6, Joshua Tenner wrote:
> http://jtenner.github.io/Composer.js/
> 
> Check it out!
> 
> Thanks.

Do you have any practical examples? My feel is that this is overcomplicated, but I'd like to see a side by side comparison with other solutions for a better evaluation.

[toc] | [prev] | [next] | [standalone]


#22514

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2014-01-01 19:32 -0800
Message-ID<ffd2d9ae-b147-41fa-84ff-637ab45b2612@googlegroups.com>
In reply to#22485
On Sunday, December 29, 2013 4:46:55 PM UTC-6, Michael Haufe (TNO) wrote:
> On Friday, December 27, 2013 11:34:46 AM UTC-6, Joshua Tenner wrote:
> 
> > http://jtenner.github.io/Composer.js/
> >
> > Check it out!
> > 
> > Thanks.
> 
> Do you have any practical examples? My feel is that this is overcomplicated, but I'd like to see a side by side comparison with other solutions for a better evaluation.

After spending a little more time looking at this, I'm disappointed and confused. The author doesn't seem to understand the language well enough and the documentation is hard to follow. There seem to be at least three ways to create the objects. Sometimes "mixins" are used and sometimes prototypical inheritance with explanation to why.

There is also a somewhat inaccurate/incomplete claim made about IE8 regarding getters/setters. The author then claims that his library resolves this issue by relying on ES5 features (In three different ways of course).

There exist some forms of "factory" composition/collapsing (mixins?), but how this works is not clear especially if the components are a sequence of objects and constructors.

There is a fluent interface, but I'm not certain if these are static methods or not (or both).

The final section of the documentation is what scares me away from looking at this library any deeper:

> Composer was designed with portability in mind.
> Check out the following example.

> var store = Composer().phrase(function(values){
>   var key, myStore = {};
>   for(key in values){
>     set(key, values[key]);
>   }
>   function get(myKey){
>     return myStore[myKey];
>   }
>   function set(myKey, val){
>      myStore[myKey] = val;
>      return this;
>   }
>   this.set = set;
>   this.get = get;
> });

> Now just use your factory.

> var myStore = store({
>   "foo": "bar",
>   "baz": "nee"
> });

> myStore.get("foo");
> //"bar"

> myStore.get("baz");
> //"nee"

> myStore.set("baz","blah").get("baz");
> //"blah"

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web